Thread 105762446 - /g/ [Archived: 572 hours ago]

Anonymous
7/1/2025, 7:04:45 AM No.105762446
20250701_074710
20250701_074710
md5: 3647dd466f14f184232b7b6f52d8e24d๐Ÿ”
Post screenshots of your comfy, hand-written code, correct picrel edition.
Replies: >>105763597 >>105764018 >>105765440 >>105765594 >>105767325 >>105767343 >>105768043 >>105770017 >>105770612 >>105774016 >>105774022 >>105774184 >>105774222 >>105775830
Anonymous
7/1/2025, 7:08:36 AM No.105762474
that's not handwritten
i guess you should try again
Replies: >>105762486
Anonymous
7/1/2025, 7:09:48 AM No.105762486
>>105762474
Don't be autistic. You know what I meant.
Replies: >>105765614
Anonymous
7/1/2025, 7:33:02 AM No.105762648
678638263728
678638263728
md5: 0d5e3404d899b72c0237603fc5339761๐Ÿ”
Replies: >>105763966 >>105765217
Anonymous
7/1/2025, 7:56:11 AM No.105762799
Only an ai bot would write such a switch statement
Replies: >>105763226
Anonymous
7/1/2025, 9:03:43 AM No.105763226
>>105762799
Nah, AI chat bots usually use the most boring formatting and alignment possible. I usually format code by hand so it's easily readable and I can look at it and quickly see patterns.
Anonymous
7/1/2025, 10:05:16 AM No.105763597
asdfds
asdfds
md5: 2e707ca83ee8d7b905a2ba3b5cdeb0b9๐Ÿ”
>>105762446 (OP)
>ITT we post our rust hello world examples
Replies: >>105771587
Anonymous
7/1/2025, 10:11:28 AM No.105763642
Screenshot 2025-07-01 111035
Screenshot 2025-07-01 111035
md5: e3b9d146395908dbf83d18a991503073๐Ÿ”
Replies: >>105763647 >>105765851
Anonymous
7/1/2025, 10:12:14 AM No.105763647
>>105763642
What's thr best way to learn asm?
Replies: >>105763687 >>105763694 >>105764036 >>105765887
Anonymous
7/1/2025, 10:20:00 AM No.105763687
>>105763647
why would you want to learn assembly?
once you have a good understanding of C, assembly is just useless mental gymnastics made obsolete by any compiler or godbolt if you prefer a web interface
Replies: >>105763733 >>105763986 >>105764036 >>105764105 >>105765241 >>105765640
Anonymous
7/1/2025, 10:20:58 AM No.105763694
>>105763647
reading lots of assembly code, unfortunately
Anonymous
7/1/2025, 10:27:03 AM No.105763733
>>105763687
> why would you
I'm just very irrational with my choices of what to learn, don't care about utility and I mostly go with what feels maxxcomfy but also weird at the same time.
Replies: >>105763752 >>105779490
Anonymous
7/1/2025, 10:31:10 AM No.105763752
>>105763733
your head's cooked my man
Replies: >>105763757
Anonymous
7/1/2025, 10:32:11 AM No.105763757
>>105763752
Tell me something I don't know.
Anonymous
7/1/2025, 11:05:14 AM No.105763966
>>105762648
cool comments timmy
Anonymous
7/1/2025, 11:07:50 AM No.105763986
>>105763687
Learn assembly for RISC-V and don't bother with the legacy real/protected/long bullshit of x86.
https://www.youtube.com/playlist?list=PLbtzT1TYeoMiKup6aoQc3V_d7OvOKc3P5
Anonymous
7/1/2025, 11:14:32 AM No.105764018
1721105321197959
1721105321197959
md5: e8f7cd1853b2805fe7e5c827abfd72a1๐Ÿ”
>>105762446 (OP)
I'm too retarded to code
Anonymous
7/1/2025, 11:17:56 AM No.105764036
>>105763647
https://chortle.ccsu.edu/AssemblyTutorial/index.html

>>105763687
its interesting and not everyone wants to be a codemonkey
Replies: >>105764067 >>105765166 >>105775189
Anonymous
7/1/2025, 11:23:01 AM No.105764067
>>105764036
it's not fucking interesting
if you actually gave a fuck about such "interesting" shit, you would implement your own virtual machine with your own register layout and whatever other weird shit you want to include, and you would consult existing architectures in the process. this would teach you a whole fucking lot more than any bullshit fucking around in x86 ASM as if you're doing anything of fucking value.
build actual fucking software that does interesting shit. that is the point of programming. not fucking around like some monk "speaking the language of the chip." it's fucking stupid as absolute shit.
Replies: >>105764114 >>105765104
Anonymous
7/1/2025, 11:29:30 AM No.105764105
>>105763687
>why would you want to learn
If you don't find joy in learning and understanding how things work you're some variety of nigger, pure and simple.
Replies: >>105765121
Anonymous
7/1/2025, 11:31:19 AM No.105764114
>>105764067
Did you actually just type all that with a straight face and think you're NOT going to be an underperforming wagie loser your whole life? Interesting.
Anonymous
7/1/2025, 1:50:12 PM No.105765104
>>105764067
post code of your virtual machine
Replies: >>105766955
Anonymous
7/1/2025, 1:52:01 PM No.105765121
>>105764105
learning assembly is like learning multipication by memorizing every possible combination. sure its good to memorize any X*Y=Z for X and Z < 20. but to memorize more than that is not "learning and understanding" its just stupid.
same with assembler. you need to know the basics, whats a jump, branch, comp, etc. but memorizing 500+ mnemonics is, well just stupid. you'll learn anyway, if you have to work with them.
Anonymous
7/1/2025, 1:57:36 PM No.105765166
>>105764036
>its interesting
not really, it's tedious and the lowest form of composition. literally a monkey playing with a shape sorting box.
Anonymous
7/1/2025, 2:03:17 PM No.105765217
>>105762648
cozy
Anonymous
7/1/2025, 2:06:23 PM No.105765241
>>105763687
>why would you want to learn assembly?
to implement forth interpreters
Anonymous
7/1/2025, 2:24:50 PM No.105765384
ss+(2025-07-01+at+14-23-28)
ss+(2025-07-01+at+14-23-28)
md5: 765902a9be7d0586f53e3e82aac57db4๐Ÿ”
I love macro DSLs
Replies: >>105773903 >>105776415
Anonymous
7/1/2025, 2:33:03 PM No.105765440
>>105762446 (OP)
you and me format code similarly,
based & beautipilled.
Replies: >>105765504 >>105765524
Anonymous
7/1/2025, 2:40:08 PM No.105765504
>>105765440
actually nevermind i just noticed that horrid if-else with switches inside
do not speak to me or my son again
Replies: >>105765524
Anonymous
7/1/2025, 2:42:45 PM No.105765524
>>105765440
>>105765504
Yeah, actually I never formatted ifs with switches that way until recently, but I think it's nice. Maybe takes time to appreciate. Share your code anin, I'm curious to see how you write it.
Anonymous
7/1/2025, 2:50:40 PM No.105765594
>>105762446 (OP)
i recently wrote this beauty right here https://pastebin.com/LqCmYPrR
Anonymous
7/1/2025, 2:53:20 PM No.105765614
>>105762486
You're a retard. You're no better than zoomers corrupting language through sheer unapologetic stupidity. Do better.
Replies: >>105765619 >>105775669
Anonymous
7/1/2025, 2:53:55 PM No.105765619
>>105765614
shut up fagget
Anonymous
7/1/2025, 2:57:57 PM No.105765640
>>105763687
>why would you want to learn assembly?
Exploit development and reverse engingeering
Anonymous
7/1/2025, 3:29:17 PM No.105765851
1747958639584618
1747958639584618
md5: 44ea7792e59560eead2b7c0ce8a60174๐Ÿ”
>>105763642
>AT&T syntax
Replies: >>105770204
Anonymous
7/1/2025, 3:35:19 PM No.105765887
81ZugrP5S3L._SL1500_[1]
81ZugrP5S3L._SL1500_[1]
md5: baedf23e909184205aaf764c0d211cd1๐Ÿ”
>>105763647
Hands down the best book to learn assembly.
There are also lecture videos somewhere on the authors' university's website if you don't like reading.
Anonymous
7/1/2025, 5:45:10 PM No.105766955
photo_2024-11-09_12-44-35
photo_2024-11-09_12-44-35
md5: 2633fa6873f0e26ab6cbd66a485d7fbf๐Ÿ”
>>105765104
ok
Anonymous
7/1/2025, 6:19:25 PM No.105767325
>>105762446 (OP)
Why would you write switch statements like that? Are you scared of new lines?
Replies: >>105767340 >>105771974
Anonymous
7/1/2025, 6:20:55 PM No.105767340
>>105767325
well he puts the bracket on the same line as the statement so, clearly.
Anonymous
7/1/2025, 6:21:09 PM No.105767343
>>105762446 (OP)
>enum
why
Replies: >>105768273
Anonymous
7/1/2025, 7:26:16 PM No.105768043
>>105762446 (OP)
why are you using braces around the switch if you're already disgustingly hiding it back there
Anonymous
7/1/2025, 7:55:25 PM No.105768273
>>105767343
why not? what would you do? use a number to indicate mode / direction? thats the same thing but you've just lost the name which is nice to have for clarity
Anonymous
7/1/2025, 9:56:47 PM No.105769558
Screenshot From 2025-07-01 20-52-58
Screenshot From 2025-07-01 20-52-58
md5: e1c4dd1649050765dcc5be38af74bc71๐Ÿ”
My fav pattern for fsm state functions.
Replies: >>105769574 >>105773517 >>105779548
Anonymous
7/1/2025, 9:58:42 PM No.105769574
>>105769558
i always make my switch case statements 1 liners. If the body cannot be squished into 1 line then i'll make it a function. I just love seeing
switch(X)
{
case A: ... ; break;
case B: ... ; break;
case C: ... ; break;
case D: ... ; break;
}


so clean
Replies: >>105769648 >>105770030
Anonymous
7/1/2025, 10:06:37 PM No.105769648
>>105769574
There's a satisfying aesthetic to it for sure.
Anonymous
7/1/2025, 10:40:45 PM No.105770017
>>105762446 (OP)
stop being such a special princess and format your code properly.
Replies: >>105772035
Anonymous
7/1/2025, 10:42:37 PM No.105770030
>>105769574
at that point you might as well make have a static const jumptable and just call it like myfunctions[case]();
Replies: >>105770170
Anonymous
7/1/2025, 10:52:36 PM No.105770131
arguably-comfy
arguably-comfy
md5: 8f08ca76820ddb1b6c96d90d59137499๐Ÿ”
Replies: >>105771592
Anonymous
7/1/2025, 10:57:07 PM No.105770170
>>105770030
i sometimes think about doing that but im not sure because the compiler can probably more easily interpret what im doing with a switch statement and so it can figure out whether to turn it into a literal jump table like that or not

then again im not sure the compiler will ever make a jump table if the case values are not consecutive
Replies: >>105783104
Anonymous
7/1/2025, 11:00:06 PM No.105770204
>>105765851
> at&t syntax
It was disassembled and lightly hacked. I hope.
Probably should have learned MASM.
Just like 99.99% of rust code was the output of c2rust, and then fucked with.
Anonymous
7/1/2025, 11:45:35 PM No.105770612
civil war 2024 cailee spaeny ๐Ÿ’Œ (10)
civil war 2024 cailee spaeny ๐Ÿ’Œ (10)
md5: 8572936f6456ca6d03f0036014eabd54๐Ÿ”
>>105762446 (OP)
Mixing code with unittests, You are a fucking monkey my friend.
Replies: >>105771374 >>105771998
Anonymous
7/2/2025, 1:16:09 AM No.105771374
>>105770612
> mix code and tests
Nobody in the real world does that.
We were also told to write the docs and tests first! Howโ€™d that work out?
โ€ฆ wait I think my โ€˜tangleโ€™ batch run is done..
Replies: >>105771981
Anonymous
7/2/2025, 1:45:15 AM No.105771587
>>105763597
OP said comfy, not 200 line function
Replies: >>105771617
Anonymous
7/2/2025, 1:46:16 AM No.105771592
>>105770131
nice filename
Anonymous
7/2/2025, 1:50:11 AM No.105771617
1747798823061861
1747798823061861
md5: 3ea2313f7d338e6ceb32eef2084cbce2๐Ÿ”
>>105771587
>OP said comfy, not 200 line function
Anonymous
7/2/2025, 2:37:13 AM No.105771974
>>105767325
I try to keep code under 80 chars, not because of some kind of autistic compulsion (well, maybe a little bit of it), but mostly because it's obviously easy for humans to comprehend information when it isn't stretched all over the screen and looks more like a newspaper column. So yeah, it does save space on the left inside the switch statement. But also it just makes sense to do it that way because it indicates immediately that the "if" only applies to "switch" and there's nothing else inside besides it.
Anonymous
7/2/2025, 2:37:35 AM No.105771981
>>105771374
I can't take seriously people who writes test code or TDD promoters.
Replies: >>105772005
Anonymous
7/2/2025, 2:40:32 AM No.105771998
>>105770612
I've never done this before until recently, then decided to try. It's super comfy and actually useful, because you can immediately see what's tested and don't need to jump between files abd serch for unit tests. Also when you do it this way, there's no need to name your tests, because it's immediately obvious which function they're testing - the one they immediately follow.
Anonymous
7/2/2025, 2:42:04 AM No.105772005
>>105771981
I don't promote TDD but not writing unit tests and not understanding why it is helpful both immediately and in the long term is very much a skill issue.
Replies: >>105772032
Anonymous
7/2/2025, 2:46:10 AM No.105772032
>>105772005
So, you need something to take your hand and guide you because you are not able to understand your own code and how it can potentially fail.
Replies: >>105772051
Anonymous
7/2/2025, 2:46:58 AM No.105772035
>>105770017
Whoa buddy, it's my code, it doesn't owe you any formatting. If you use go fmt or whatever equivalent - good for you, but I bet you're one of them people who cannot picture an apple in their heads or something. Many such cases.
Anonymous
7/2/2025, 2:50:48 AM No.105772051
>>105772032
You got it wrong. Say I'm writing a gui app, but this particular part is far removed from actual gui. Unit tests just make it possible to write without a) having gui part ready first b) having to constantly check said gui after every change to my code. If you claim you can just write any kind of code and make it immediately work, you're talking out of your ass.
Anonymous
7/2/2025, 7:24:13 AM No.105773517
>>105769558
absolutely useless comments
Anonymous
7/2/2025, 7:38:16 AM No.105773609
solve
solve
md5: 0ccf39c4851535ff16542b775bf65332๐Ÿ”
Replies: >>105773645 >>105774735 >>105775216 >>105776950
Anonymous
7/2/2025, 7:44:18 AM No.105773645
>>105773609
nice idiomatic Rust
Anonymous
7/2/2025, 8:29:35 AM No.105773903
>>105765384
>rust troon
>no code
>just literals and constants
>~50 lines
>there's a test after
>probably 1/3rd of the file
>another window
>less than a few hundred lines of code

it would be funny if not for the commonality
Replies: >>105775099 >>105775143
Anonymous
7/2/2025, 8:53:35 AM No.105774016
>>105762446 (OP)
Duplicate of >>105711980
Anonymous
7/2/2025, 8:54:20 AM No.105774022
>>105762446 (OP)
what theme is this?
Replies: >>105774085
Anonymous
7/2/2025, 9:02:02 AM No.105774085
>>105774022
I think it's something custom I edited out of an existing theme. I sometimes change background color when I'm bored, but most other colors work just fine woth any dark background.
Replies: >>105774118
Anonymous
7/2/2025, 9:06:26 AM No.105774118
>>105774085
it looks very nice
Replies: >>105774244
baritone !DIN0bsbxx2
7/2/2025, 9:17:48 AM No.105774184
1751152472214
1751152472214
md5: 4ffdc75881df454f613084076d625862๐Ÿ”
>>105762446 (OP)
java winned
Replies: >>105774730
Anonymous
7/2/2025, 9:23:46 AM No.105774222
>>105762446 (OP)
>Asserting twice unnecessarily.
>Branching on a condition youโ€™ve asserted canโ€™t happen.
>mode function is both a getter and setter depending on the arguments.
>Pausing twice removes history of originally paused mode.

The formatting is nice.
Replies: >>105774272
Anonymous
7/2/2025, 9:26:11 AM No.105774244
>>105774118
I think it's actually the font that makes it nice, haven't found a better one in years, desu.
Anonymous
7/2/2025, 9:28:07 AM No.105774253
I cant stop commenting my code
I cant stop commenting my code
md5: 236bc43e5e95bd02335bd32d46131a1a๐Ÿ”
I write more fucking comments than code, and I can't stop.
Replies: >>105774331
Anonymous
7/2/2025, 9:28:58 AM No.105774262
c3 duffs device
c3 duffs device
md5: f75c88ea46b136a2b7f652fd2f98f780๐Ÿ”
Not mine but look at this beauty.
Anonymous
7/2/2025, 9:31:44 AM No.105774272
>>105774222
> asserting twice
I think it's clear that way
> branching on a condition that can't happen
Where? It says step >= 1, not step > 0
> both getter and setter
Don't think so, this is D. If you mean that function is reloaded with different (0 and 1) number of args, then yeah. This actually allows me to say obj.mode and obj.mode = and is intended.
> pausing twice
Good catch
Replies: >>105774319
Anonymous
7/2/2025, 9:42:26 AM No.105774319
>>105774272
Reasonable answers. Although the mode thing would freak me out if I was working on this code.
Anonymous
7/2/2025, 9:44:33 AM No.105774331
>>105774253
the amount of comments isnt the issue, its your phrasing. its not your fucking diary lmao.
Replies: >>105774413
Anonymous
7/2/2025, 10:00:54 AM No.105774413
not too many comments you say
not too many comments you say
md5: 51aaba9a5c2702eb46c25ba30592b456๐Ÿ”
>>105774331
>the amount of comments isnt the issue
I guess?
Replies: >>105774427
Anonymous
7/2/2025, 10:02:58 AM No.105774427
>>105774413
yeah...
Anonymous
7/2/2025, 10:52:32 AM No.105774730
>>105774184
Disgusting
Anonymous
7/2/2025, 10:53:33 AM No.105774735
>>105773609
You're retarded
Replies: >>105774869
Anonymous
7/2/2025, 11:04:28 AM No.105774789
duolingo
duolingo
md5: 6557812a15d0be4a8e3199e1a94e365c๐Ÿ”
Anonymous
7/2/2025, 11:16:58 AM No.105774869
solve
solve
md5: 31ae379298dcd054f392ac8109e60731๐Ÿ”
>>105774735
wrong
Replies: >>105775150 >>105775208 >>105775216 >>105775260
Anonymous
7/2/2025, 11:55:08 AM No.105775099
tired-confused
tired-confused
md5: 259b82b3e5e4b0f651779d045813a009๐Ÿ”
>>105773903
Wtf are you even complaining about. Did you expected me to zoom out to show thousands of LoC or what is even your problem m8
Anonymous
7/2/2025, 12:02:08 PM No.105775143
carbon
carbon
md5: d043f95c7416f2b9b979e752f4729d60๐Ÿ”
>>105773903
Replies: >>105775208 >>105776426
Anonymous
7/2/2025, 12:03:06 PM No.105775150
>>105774869
Looking at this makes me want to kill myself.
Replies: >>105775156
Anonymous
7/2/2025, 12:04:56 PM No.105775156
solve
solve
md5: a814ef7db84e1d39365da2afd1c05048๐Ÿ”
>>105775150
cnile spotted
Replies: >>105775208
Anonymous
7/2/2025, 12:08:53 PM No.105775189
Screenshot_20250702-120601
Screenshot_20250702-120601
md5: 825f41b6ea0ca5cdd57244deac023e76๐Ÿ”
>>105764036
thanks bro
Replies: >>105775543
Anonymous
7/2/2025, 12:09:49 PM No.105775196
screenshot
screenshot
md5: 7dd7c33aefdeb746c629e0ad31b42562๐Ÿ”
Not a particularly elegant function as a whole, but it calculates the screen-space extents of a cube using just 4 AVX intrinsics at lines 30-33. What normally takes 8 mat4-vec4 multiplications compressed to one.
Part of a software octree splatter.
Replies: >>105776863
Anonymous
7/2/2025, 12:10:59 PM No.105775208
>>105775143
>>105775156
>>105774869
Damn people, I didn't have any particular opinion bout Rust before, but this, this is madness. Meds.
Replies: >>105775222 >>105775233
Anonymous
7/2/2025, 12:11:54 PM No.105775216
>>105773609
Why do you add these random code blocks for one liners?

>>105774869
If you used for instead of these ugly nested multi-line iterators, this code would be 100x more readable.
Replies: >>105775233
Anonymous
7/2/2025, 12:13:02 PM No.105775222
>>105775208
These are probably just write-only solutions for code challenges.
Akin to tacit APL code.
Replies: >>105775233
Anonymous
7/2/2025, 12:14:14 PM No.105775233
solve
solve
md5: 48c1fb6afc8ff964fabc4157c324fb88๐Ÿ”
>>105775208
git gud

>>105775216
for loops are slower

>>105775222
correct
Replies: >>105775238
Anonymous
7/2/2025, 12:15:45 PM No.105775238
>>105775233
>for loops are slower
They are not, they are the same.
Post any code that uses Iterator::for_each (in code blocks), and I will run a benchmark to prove you wrong.
Replies: >>105775245
Anonymous
7/2/2025, 12:16:43 PM No.105775245
>>105775238
https://godbolt.org/z/h9j1exchv
Replies: >>105775246
Anonymous
7/2/2025, 12:17:59 PM No.105775246
>>105775245
Where is Iterator::for_each?
Replies: >>105775248
Anonymous
7/2/2025, 12:18:23 PM No.105775248
>>105775246
https://godbolt.org/z/Eca4KKE1M
Replies: >>105775346
Anonymous
7/2/2025, 12:19:25 PM No.105775260
>>105774869
Nah man, your code is slop and isn't proof of your genius. People like you make Rust look bad
Replies: >>105775267
Anonymous
7/2/2025, 12:20:22 PM No.105775267
solve
solve
md5: 983f46c3ebca7beba603a457f4662c0b๐Ÿ”
>>105775260
Replies: >>105775271
Anonymous
7/2/2025, 12:21:02 PM No.105775271
>>105775267
holy fuck what a mess
Replies: >>105775279
Anonymous
7/2/2025, 12:22:31 PM No.105775279
solve
solve
md5: 922d61a40ec5cb75ebedb3a42918d052๐Ÿ”
>>105775271
Replies: >>105775289 >>105775353 >>105779052
Anonymous
7/2/2025, 12:23:46 PM No.105775289
>>105775279
post rustfmt config
Replies: >>105775294
Anonymous
7/2/2025, 12:24:14 PM No.105775294
>>105775289
comment_width = 100
force_multiline_blocks = true
group_imports = "StdExternalCrate"
hard_tabs = true
imports_granularity = "Crate"
max_width = 100
newline_style = "Unix"
style_edition = "2024"
trailing_comma = "Never"
unstable_features = true
use_field_init_shorthand = true
use_small_heuristics = "Max"
wrap_comments = true
Anonymous
7/2/2025, 12:32:49 PM No.105775346
>>105775248
If you split it into two fors it's pretty much the same.
avr min max
Foo: 9.18ms 8.94ms 13.56ms
Bar: 9.32ms 9.15ms 9.48ms

for 100000 elements arrays.
This only happens in certain adapters like you have read in the documentation. In your code where you just do slice::iter().enumerate() it literally won't make any difference and you are just making your code super ugly for no good reason.
Replies: >>105775362 >>105775422
Anonymous
7/2/2025, 12:33:36 PM No.105775353
mfwrust
mfwrust
md5: f527f6252ced0e251e9fcb2678854dfa๐Ÿ”
>>105775279
Anonymous
7/2/2025, 12:34:38 PM No.105775362
>>105775346
>super ugly
why do you consider that style ugly? with a normal ass for you have to look at surrounding variables to determine intent. a fold guarantees that you are combining a collection into some other variable.
it's literally just a matter of you learning how to read the functional style.
Replies: >>105775378
Anonymous
7/2/2025, 12:36:01 PM No.105775378
>>105775362
>why do you consider that style ugly?
For the same reason why LISP is ugly. It's just symbol soup that is hard to follow. For loops with proper flow control keywords are much more clean to look at than nested, multi-line closures.
Replies: >>105775386
Anonymous
7/2/2025, 12:37:43 PM No.105775386
Screenshot from 2025-03-22 10-25-06
Screenshot from 2025-03-22 10-25-06
md5: 237cb7c02a41cfad5072b8e82372a40f๐Ÿ”
>>105775378
Lisp is plenty readable when you learn that you should be looking at whitespace.
Replies: >>105775490 >>105775501
Anonymous
7/2/2025, 12:38:54 PM No.105775402
1721871432163866
1721871432163866
md5: 851ff4688cacf0f01c0593d714cb1b06๐Ÿ”
From my game project.
Anonymous
7/2/2025, 12:42:53 PM No.105775422
solve
solve
md5: 156bfbb68b33ab417dfdd0bf351f76b6๐Ÿ”
>>105775346
>If you split it into two fors
no thanks, for_each will do that for me
>super ugly
ok, cnile
Replies: >>105775446 >>105775475
Anonymous
7/2/2025, 12:45:30 PM No.105775446
1744340149514392
1744340149514392
md5: de3d0eaa658527dd12de7a679bd21d4d๐Ÿ”
>>105775422
>.for_each(|()| ());
Replies: >>105776348
Anonymous
7/2/2025, 12:48:56 PM No.105775475
>>105775422
>ok, cnile
I am a Rust programmer.
Replies: >>105775492
Anonymous
7/2/2025, 12:51:17 PM No.105775490
>>105775386
How is this readable? Literally a soup of words.
Replies: >>105775548
Anonymous
7/2/2025, 12:51:39 PM No.105775492
>>105775475
>rust programmer
>afraid of using the full potential of iterators
>thinks using continue/break results in clearer code
that's just sad. you have been bricked by c
Anonymous
7/2/2025, 12:53:11 PM No.105775501
>>105775386
Now count the amount of identifiers/atoms in this code and compare it to yours.
Anonymous
7/2/2025, 12:55:33 PM No.105775515
1747874745367241
1747874745367241
md5: 68145017a9afeb940f6acfefd0de7b36๐Ÿ”
From my MOD player.
Anonymous
7/2/2025, 1:00:29 PM No.105775543
>>105775189
turn off nigger mode
Anonymous
7/2/2025, 1:01:22 PM No.105775548
Screenshot from 2025-03-04 00-24-32
Screenshot from 2025-03-04 00-24-32
md5: 0ac438f9b994bb0006ec99b8d6745f6d๐Ÿ”
>>105775490
ok
Replies: >>105775617
Anonymous
7/2/2025, 1:12:34 PM No.105775617
>>105775548
Hey man, srsly, we all have mental issues, but you know, if you find this kind of code beautiful, then maybe you need to like go outside more often. Get a dog or something. Stop watching anime.
Replies: >>105775643
Anonymous
7/2/2025, 1:16:12 PM No.105775643
Screenshot from 2025-03-30 22-48-00
Screenshot from 2025-03-30 22-48-00
md5: 8657a9a26fdb088c1f125728cd6e5d07๐Ÿ”
>>105775617
imagine being so retarded that you cannot grasp the basics of nested parentheses
Replies: >>105775671
Anonymous
7/2/2025, 1:19:37 PM No.105775669
>>105765614
wtf I let it drop
why are you making me look bad
Anonymous
7/2/2025, 1:19:52 PM No.105775671
>>105775643
Anyone can grasp the semantics, it's just that it's literally hard to read, because it all looks like spaghetti. You're giving me strong tranny gay vibes btw, because you keep on posting screenshots as if posting more of the same would somehow normalize it and convince everyone it's beautiful while it isn't.
Replies: >>105775706
Anonymous
7/2/2025, 1:23:48 PM No.105775706
Screenshot from 2024-05-12 03-26-55
Screenshot from 2024-05-12 03-26-55
md5: dd0e27aeb24e1c8f318927317e69801d๐Ÿ”
>>105775671
it's hard to read because you are not used to it.
it's genuinely that simple.
do you think people that enjoy Lisp are just bullshitting when they say that the syntax is nice? no, they've put in their week of time with the syntax, internalized it, and began to cringe whenever they had to do superfluous bullshit when using another language.
here is a Lisp that I made, it does not allow for variadic arguments, so you do not need parentheses even.
Replies: >>105775718 >>105776361
Anonymous
7/2/2025, 1:26:05 PM No.105775718
>>105775706
Sorry man, you're just confirming my point.
> it's ugly
> here's more, because if you're overwhelmed with ugly it becomes beautiful
Replies: >>105775885
Anonymous
7/2/2025, 1:44:12 PM No.105775830
>>105762446 (OP)
Breh, what IDE is this, and what theme?
Replies: >>105775916
Anonymous
7/2/2025, 1:53:44 PM No.105775885
>>105775718
no, I've just coded more than you and in more languages than you. I've built more languages than you.
you just think you are correct because it is typical and predictable of humans to do that.
Replies: >>105775927
Anonymous
7/2/2025, 1:57:31 PM No.105775916
>>105775830
Vim snd some theme I customized.
Anonymous
7/2/2025, 1:58:44 PM No.105775927
>>105775885
That might be true, but that's no guarantee of taste.
Anonymous
7/2/2025, 2:47:08 PM No.105776348
>>105775446
kek
Anonymous
7/2/2025, 2:49:11 PM No.105776361
>>105775706
kissless, childless, on the brink
Anonymous
7/2/2025, 2:54:08 PM No.105776403
1724030105777
1724030105777
md5: b5e944027df973fa6f92df200bcf214d๐Ÿ”
Anonymous
7/2/2025, 2:56:01 PM No.105776415
>>105765384
neat. what ISA are you emulating here?
Replies: >>105776451
Anonymous
7/2/2025, 2:57:22 PM No.105776426
>>105775143
how do you even find out what a concurrent data access transactor is
Replies: >>105776857
Anonymous
7/2/2025, 3:00:26 PM No.105776451
1732941954882_thumb.jpg
1732941954882_thumb.jpg
md5: b383936ae45fb9c27418567526d929fb๐Ÿ”
>>105776415
A minecraft computer some youtuber made https://youtu.be/3gBZHXqnleU
Anonymous
7/2/2025, 3:55:13 PM No.105776857
>>105776426
by being a retard and trying to build wheels from scratch. I was not using a database, and wanted to support concurrent activity.
long story short: use Postgres and look into transactions and isolation levels.
Postgres will save you so much fucking time.
Anonymous
7/2/2025, 3:55:56 PM No.105776863
>>105775196
>if (1)
is there any reason why you added these?
Replies: >>105776903
Anonymous
7/2/2025, 4:00:23 PM No.105776903
>>105776863
They're to quickly disable or comment out blocks for testing or benchmarking.
Replies: >>105783104
Anonymous
7/2/2025, 4:06:02 PM No.105776950
>>105773609
joke language
Replies: >>105776984
Anonymous
7/2/2025, 4:09:34 PM No.105776984
1739658310786858
1739658310786858
md5: ecc6809e194627969f6572271147e95c๐Ÿ”
>>105776950
post your aoc solutions
Replies: >>105777026
Anonymous
7/2/2025, 4:13:15 PM No.105777026
Screenshot from 2025-07-02 16-12-40
Screenshot from 2025-07-02 16-12-40
md5: 506b822738e2f9278afbb9fc4d64646c๐Ÿ”
>>105776984
nta
but
>.;/:+=%รนยฃยต*$ยฐ)
Replies: >>105777051
Anonymous
7/2/2025, 4:15:05 PM No.105777051
>>105777026
>filtered by a hashmap
Replies: >>105777103
Anonymous
7/2/2025, 4:20:59 PM No.105777103
elvis-laugh
elvis-laugh
md5: fc246e60e7bb5c76558029a58c27d7ff๐Ÿ”
>>105777051
hashmaps are so retarded of a concept i didnt even have a word for that type of structure until i was years into programming in c
mfw i learned that an a 256-wide preliminary array which you use to cut on ordering your string based data is a fucking hashmap
Replies: >>105777157 >>105777341 >>105777475
Anonymous
7/2/2025, 4:25:48 PM No.105777157
1731088530456312
1731088530456312
md5: bf47f187cc8a508ea526bd993fce6e1c๐Ÿ”
>>105777103
Replies: >>105777205
Anonymous
7/2/2025, 4:29:39 PM No.105777205
ukaki
ukaki
md5: 12bb1486c33c58347cafe54b46a05a07๐Ÿ”
>>105777157
geg
i really dont look like a programmer irl, though
im a dropout, self taught
i was a physical worker during my whole wagie career
i done my programming heresies during the night
Anonymous
7/2/2025, 4:32:15 PM No.105777233
If I may interject for a moment what you're refering to as a hashmap is actually a lookup table or as I've taken to calling it a 2 + dimensional array available for lookup.
Replies: >>105777268
Anonymous
7/2/2025, 4:35:25 PM No.105777268
>>105777233
ah my bad, sory
again, im self taught. im bound to have holes in my knowledge esp in my vocabulary
Replies: >>105777440
Anonymous
7/2/2025, 4:43:08 PM No.105777341
>>105777103
>hashmaps are so retarded of a concept
this is a joke post, right?
Replies: >>105777375
Anonymous
7/2/2025, 4:46:42 PM No.105777375
>>105777341
i meant its basic
for me its just memory management
you figure out storage structures and interfaces to streamline the access to your data
i could take a function that atois a string into an int and then shove that into linked lists and make it live in arenas and you would say "thats a hashmap"
well, not in my mind
its an interface, and memory management in the larger sense
its not specific to your hasmap, it extends throughout the whole program
Replies: >>105777426 >>105777440 >>105777443 >>105777452
Anonymous
7/2/2025, 4:52:12 PM No.105777426
1732360469614638
1732360469614638
md5: 9d0725afcad0a4c6b1a774fe5a5334e6๐Ÿ”
>>105777375
post your code
Replies: >>105777477
Anonymous
7/2/2025, 4:53:34 PM No.105777440
>>105777268
>>105777375
(cont)
i mean
lets say you work with a big array
lets say you create a LUT to elements in your big array
lets say its for a game and you have an additional layer of abstraction, your scripting language
and you use that look up table to access the data of your game, idk, positional for ex
and that you have a function that turns a game id into a number which is then used for indexation

where does the hashmap starts and where does it end?
it there even one at all? because for me its just the interaction bw different subsystems
interfaces and memory management
Anonymous
7/2/2025, 4:53:43 PM No.105777443
>>105777375
>i could take a function that atois a string into an int and then shove that into linked lists and make it live in arenas and you would say "thats a hashmap"
I wouldn't, actually, because it has no bucketing, collision behavior, and atoi is not a good hash function
Anonymous
7/2/2025, 4:54:55 PM No.105777452
>>105777375
you're a retarded tranny. I swear to god the level of copes cniles go through because they can't accept the concept of template/generic code. absolutely retarded. kys.
Replies: >>105777489 >>105777491
Anonymous
7/2/2025, 4:57:10 PM No.105777475
>>105777103
>hashmaps are so retarded
Filtered by a hashmap kek
Anonymous
7/2/2025, 4:57:16 PM No.105777477
>>105777426
i dont have much on this pc
#include <stdio.h>
#include <stddef.h>

struct s_str;
typedef struct s_str t_str;

struct s_str
{
size_t size;
char text[];
};
#define STINGIFY(text) (t_str *)(&(const struct { size_t size; char str[sizeof(text) + 7]; }){ sizeof(text) - 1, text "\0\0\0\0\0\0\0"})

int main( void)
{
fprintf(stderr , "main ok\n") ;
t_str *string = STINGIFY("this");
fprintf(stderr, "string->text : |%s|\n", string->text);
fprintf(stderr, "string->size : %lu\n", string->size);
}

and iv e been lazying about recently
Anonymous
7/2/2025, 4:58:32 PM No.105777489
smiley-face
smiley-face
md5: 2b3ce02bbd35a5e54596e6493a2389f4๐Ÿ”
>>105777452
>template/generic code.
#include <stdio.h>

#define fn_print(type, value) fn_print##_##type(value)

void fn_print_int(int i)
{
printf("fn_print_int : %d\n", i);
}

void fn_print_float(float f)
{
printf("fn_print_float : %f\n", f);
}

int main(void)
{
fn_print(int, 5);
fn_print(float, 1.41);
}


crabs reliably incompetent, i see
Replies: >>105777556
Anonymous
7/2/2025, 4:58:36 PM No.105777491
>>105777452
troons dont use c
they use rust and lua.
Replies: >>105777498
Anonymous
7/2/2025, 4:59:18 PM No.105777498
>>105777491
>troons dont use c
lmao, yes they do you stupid faggot. do you homosexuals live in an alternative universe?
Replies: >>105777516
Anonymous
7/2/2025, 5:01:21 PM No.105777516
>>105777498
>t. rany. seething.
Anonymous
7/2/2025, 5:05:12 PM No.105777556
>>105777489
>cniles can't overload functions
man I fogot how dogshit that language is.

in C++, this is just:
int x(int i) {
return 0;
}
int x(float i) {
return 1;
}
Replies: >>105777596
Anonymous
7/2/2025, 5:08:39 PM No.105777596
overload
overload
md5: b13cd32a3ca314525e1c36543b634627๐Ÿ”
>>105777556
Replies: >>105777614
Anonymous
7/2/2025, 5:10:14 PM No.105777614
>>105777596
imagine using a tranny infested language worse than C++ and Rust and being proud of it. sad!
Replies: >>105777640 >>105777850
Anonymous
7/2/2025, 5:12:09 PM No.105777639
Screenshot 2025-07-02 at 23.11.53
Screenshot 2025-07-02 at 23.11.53
md5: 37e1a706cdf130c69efa80754915f9f2๐Ÿ”
Replies: >>105777850 >>105780166
Anonymous
7/2/2025, 5:12:15 PM No.105777640
stop-teaching-c
stop-teaching-c
md5: b61f2b8b3666b58b8fa5fbbef93d0e34๐Ÿ”
>>105777614
>
..
Anonymous
7/2/2025, 5:17:53 PM No.105777691
file
file
md5: a313110a619b0cf7389a9ee55fd6cc99๐Ÿ”
Anonymous
7/2/2025, 5:35:05 PM No.105777850
>>105777614
Holy cope
>>105777639
The oracle of soi
Anonymous
7/2/2025, 5:40:21 PM No.105777907
3fb9fe14939a2cb64c53872df5d2e22c
3fb9fe14939a2cb64c53872df5d2e22c
md5: d5b2dd5e7ead1a678da94a30ac7416a2๐Ÿ”
>hashmap
i use linked list for everything including key value storage
Replies: >>105777921 >>105778186 >>105778268 >>105778903
Anonymous
7/2/2025, 5:41:43 PM No.105777921
>>105777907
Should have repeated Data Structures and Algorithms.
Anonymous
7/2/2025, 6:04:04 PM No.105778186
>>105777907
The Lisp way.
Anonymous
7/2/2025, 6:10:59 PM No.105778268
>>105777907
this is obscenely retarded
why are you proud of this retarded shit?
Replies: >>105778705
Anonymous
7/2/2025, 6:58:34 PM No.105778705
>>105778268
one data structure for everything
vector, queue, stack, and even map all implemented in linked list in my programs
works for me, performance hadn't been a problem in practice
Anonymous
7/2/2025, 7:17:36 PM No.105778903
>>105777907
Based, probably still faster than Python as well
Anonymous
7/2/2025, 7:31:42 PM No.105779052
>>105775279
this looks like obfuscated js
Anonymous
7/2/2025, 8:07:07 PM No.105779490
>>105763733
based, same.
I suggest that after doing your first few hello worlds, look into SIMD instructions so learning assembly will have some immediate utility too.
Anonymous
7/2/2025, 8:11:38 PM No.105779548
>>105769558
Are there any good DSLs that allow me to specify FSMs while still allowing general purpose code? Something like lex but instead of for characters, it should conveniently work for arbitrary symbols.
I know there's state-chart xml, but afaik there is only one compiler to c++
Replies: >>105780068
Anonymous
7/2/2025, 9:04:23 PM No.105780068
1750705633486587
1750705633486587
md5: bbbc5d4c79f1b4f1f1f271da2051c565๐Ÿ”
>>105779548
a programming language
Replies: >>105780370
Anonymous
7/2/2025, 9:15:56 PM No.105780151
last time I did this, I was so sleep-deprived that I did not realise that my full name was being shown in the code because of Git.
Anonymous
7/2/2025, 9:17:36 PM No.105780166
>>105777639
You can make your code way faster if you don't use the random bullshit and always say 7.
Anonymous
7/2/2025, 9:18:14 PM No.105780170
file
file
md5: 6d34bdb05fa048558fd8e65928f5e9e2๐Ÿ”
Webdev ape life.
Anonymous
7/2/2025, 9:39:33 PM No.105780370
>>105780068
I want a DSL mainly so it can automatically draw me a diagram of the FSM. It's much easier to read than code
Anonymous
7/2/2025, 11:30:08 PM No.105781486
image
image
md5: 42e42330cf6132ed5a393f13daba024e๐Ÿ”
Sure love working on nice modern systems
Anonymous
7/2/2025, 11:36:06 PM No.105781550
file
file
md5: 8f67e09ad276c107b62180ed8f6e775a๐Ÿ”
Good morning sirs.
Anonymous
7/3/2025, 1:12:29 AM No.105782510
Based.
Pro tip; if this is for a game then all movement should be done by manipulating a 2d velocity struct (floats). Then each tick multiply it by a fraction that feels comfy. At 0.1 clamp the velocity to 0.
Replies: >>105783796
Anonymous
7/3/2025, 2:23:02 AM No.105783104
>>105770170
you can force it using
--param case-values-threshold=1
https://godbolt.org/z/5jeqaEsMh
>>105776903
why not use #ifdef then?
Anonymous
7/3/2025, 4:01:15 AM No.105783796
>>105782510
That's not a game, it's a text editor.
Anonymous
7/3/2025, 4:05:03 AM No.105783824
komfy
komfy
md5: ec50f5e7de41e98d436babf96ebaa3cd๐Ÿ”