[a / b / c / d / e / f / g / gif / h / hr / k / m / o / p / s / t / u / v / vg / vm / vmg / vr / vrpg / vst / w / wg] [i / ic] [r9k / s4s / vip] [cm / hm / lgbt / y] [3 / aco / adv / an / bant / biz / cgl / ck / co / diy / fa / fit / gd / hc / his / int / jp / lit / mlp / mu / n / news / out / po / pol / pw / qst / sci / soc / sp / tg / toy / trv / tv / vp / vt / wsg / wsr / x / xs] [Settings] [Search] [Mobile] [Home]
Board
Settings Mobile Home
/g/ - Technology


Thread archived.
You cannot reply anymore.


[Advertise on 4chan]


Autism edition

Old thread: >> 109227374

What are you working on, /g/?
>>
>>109255006
Imagine ending the last thread with autism.
>>
>>109255588
Old thread: >>109227374
>>
Autism can lead to wonderful things but it can also cause you to hurt yourself just like me.
>>
I'm finalizing my projects and uploading them to code(((berg))) and then I'm going to make a very simple game in SDL3.

I want to start with the simplest graphical game I can think off, maybe like a mini game you would see in Mario Party or an old flash game.
>>
I just noticed that my project that I published 4 months ago is not really reproducible and it has errors at some weird places.
Damn, I kinda don't want to fight through it, but i know that it'll give the good feels if i can make it.
>>
>>109255588
Somebody was asking about random partitions last thread....
>Combinatorial Algorithms For Computers and Calculators
Good morning sirs
>>
>>109256528
He was asking about random partitions "of an integer"
>>
>>109256557
https://en.wikipedia.org/wiki/Integer_partition
>>
>>109256746
>expecting people to know what this is and not just linking it to begin with
>>
For me personally KDE Partition Manager just works. It's a good tool
>>
can't spell partition without party
>>
>>109257656
or titties
>>
File: 1355021011308.jpg (126 KB, 654x800)
126 KB JPG
>>109255588
public static void main(String[] args) {
learn2Code();
}

public static void learn2Code() {
char[] string = { 73, 102, 32, 121, 111, 117, 32, 100, 111, 110, 39, 116, 32, 114, 101, 112, 108, 121, 32, 116,
111, 32, 116, 104, 105, 115, 32, 112, 111, 115, 116, 32, 121, 111, 117, 114, 32, 109, 111, 116, 104,
101, 114, 32, 119, 105, 108, 108, 32, 100, 105, 101, 32, 105, 110, 32, 104, 101, 114, 32, 115, 108, 101,
101, 112, 32, 116, 111, 110, 105, 103, 104, 116, 33 };
System.out.println(string);
}
>>
Can't spell Haskell without FUN.
>>
>>109258616
trve
>>
>>109255588
>Autism edition
Yes!

>What are you working on, /g/?
I finished a little project, the project have 300 lines of code. I had the idea in a class about business rules for programming. The code it's simple, the code receive some information about a person, and the system will say if he or she have passed to get money or not.
>>
>>109255921
>flash game
Will be more good than Mario party in my view, will you post it in newgrounds?
>>
>>109255588
Snailcat trans thread
You lost, codetrans. You are not needed anymore
>>
>>109258912
I'm just looking for the simplest possible graphical game. I will only upload it to codeberg I'm using C and not into web shit.
I have use emscripten before and I'm not a fan.
>>
Any practical tips for someone with procrastination and having adhd so whenever I program I get bored really fast if I can't find a solution to my problem and the next day I try to avoid the work like crazy.
>>
Getting so frustrated with AI being useless that I am resorting to emotional abuse in my prompts. I swear to god it's faster to program by hand even fro trivial tasks.
>>
>>109260161
You're using it wrong
>>109253829
>>
>>109260198
No and I'm tired of hearing this cope month after month. Even if you're joking, I'm tired of it and you're not funny, you're annoying people just for attention. Shut up, please.
>>
File: 1751716624902.png (72 KB, 1093x358)
72 KB PNG
>>109260161
>>109260213
WE'VE GOT A LIVE ONE
AI psychosis.
>>
>>109260243
>I'm trying to have fun and make jokes can you please laugh
The answer is no. You're aggravating, not fun. A clown but not funny.
>>
>be me, self taught developer, no cs degree
>learn shit as I need to use it
>second technical interview
>interviewer asks me "what's virtual memory"
>I have no idea
>rest of the interview goes well
>get rejected
turns out this was a big enough of a red flag. if only he asked me what swap was instead....
>>
>>109260252
>A clown but not funny.
Juggalo?
>>
>>109260294
Should have said memory that's virtual.
>>
>>109260323
I'm sorry for getting frustrated.
>>
File: 1775673892536667.png (24 KB, 526x342)
24 KB PNG
https://leetcode.com/problems/
>finished in 2 minutes
I'M GETTING GOOD
>>
>>109260839
https://leetcode.com/problems/sequential-digits/
>>
File: 1783910400464370.png (267 KB, 1791x1320)
267 KB PNG
I'm finishing my tool chain.
>>
Spent a long time coming up with a clever and flexible solution to my problem only to realize afterwards that I can refactor the entire thing to be simpler and not even need that solution in the first place.
Which is like good yeah, but I also wasted that time and code so it makes me mad too.
>>
>>109260294
At least you know now, right?
>>
File: 1783917666648744.png (143 KB, 900x1218)
143 KB PNG
Factorio schizo were you at, you have not shit on my in days.
>>
>>109260839
>>109260846
Easier than most easy problems.
>>
File: calm.png (2.21 MB, 1366x900)
2.21 MB PNG
>>109260161
>>109260213
I feels the feels your feeling.
I tried so often and really wanted to give it a chance. It felt good for a few moments. Until you realized this shit produced utter garbage.
And then people constantly hype this garbage. It's frustrating.
>>
Wow, I love being back to fpga design. I forgot how long place and route takes for actual designs that do require some space.
Now I can tell myself i am productive even tho i am coding for 5 minutes and then waiting for 10-15 again. Based
>>
>>109262286
ok only took me a day to get the project up and running again.
Now lets improve it and make it based
>>
Ok finally getting back into trying to get sound working on PS2.
I managed to get data out of the SPU2 memory on hardware. Of course, PCSX2 would DMA the data out without being properly configured.
>>
File: PSP pedestal.jpg (64 KB, 666x700)
64 KB JPG
It's finally time to deal with the consequences of my own actions (redesigning away all this technical debt I ignored in the beginning).

>>109263095
PS2 and the PSP are such cool systems.
It's been years and I still marvel at what developers were able to do with megahertz of MIPS and megabytes of RAM. Incredible stuff.
>>
Let there be sound.
So there is a kind of DMA direction flag you need to set in the SPU2 core as well as in the DMA controller which was getting in my way.
There's supposed to be a way you can just write half words into a FIFO to get data into SPU2 memory, but I can't seem to get it to work.
It sucks as well because the SPU2 memory is not mapped, so to see what is in it you have to DMA the data out, and it is attached to the IOP DMA controller, so to get it into main memory I have to DMA it into IOP RAM, then copy it out of IOP RAM into main memory so I can dump it.
>>
> /dpt/ ded for hours
> cringelords on /vcg/ spaming like hell
We lost the snailwar. What do? Go to reddit?
>>
>>109261969
>not static char*
>inband signalling with NULL
>imagine creating a process for every single fucking command
>no one in /dpt/ notices
I need a shower, and then I need a drink.
>>
>>109253450
so i just tried eta and i don't see the benefit over haskell
>>
>>109266044
It's a worse Haskell forked from an older GHC but it compiles to the JVM which is the only upside
>>
>>109266061
i guess having the java ecosystem is the primary benefit but java interoperability looks horrific

https://eta-lang.org/docs/user-guides/eta-user-guide/java-interop/java-interop-basics
>>
>>109266084
that's basically just the JNI
>>
File: file.png (68 KB, 1018x488)
68 KB PNG
ambassador from /vcg/ here
we'd like to swap names for the generals
i think it's time
>>
>>109266133
>>109266084
It gets even worse. Not only do you need FFI declarations for every method you use, but also an additional param to represent `this`.
foreign import java unsafe set :: Int -> Java Counter ()

For static methods with no receivers, you need this monstrosity
foreign import java unsafe "@static @field eta.example.Counter.COUNTER_MAX"
cOUNTER_MAX :: Java a Int

And for field access...
foreign import java unsafe "@field publicCounter" getPublicCounter
:: Java Counter Int

Could not imagine trying to import Java unless it were a single method. Certainly wouldn't attempt to use an Apache library from Eta.
>>
>>109266322
that's how the JNI works
>>
>>109266322
also i don't know if they did but if you can parse java you could have a template haskell macro for automatically binding that
>>
>>109266271
Jesus Christ, the cope.
>>
>>109266322
To be fair, FFI in basically every language is kind of messy.
>>
>>109261969
You know that alias is a thing in shells right?
>>
>>109266271
Eat shit and die.
>>
>>109264945
>not static char*
ok
>inband signalling with NULL
what is that? Execvp requires null terminated arrays.
>imagine creating a process for every single fucking command
How do I do this differently? I thought the whole point of fork and execvp was to avoid that.
>>
>>109266463
They're both on the JVM though so there's no JNI but yes calling Java from C is messy as well but usually the number of interacting components are small. If you're trying to use a Java numerical library or something, FFIs are gonna be a nightmare. I expect if eta got popular there would be a generator built
>>
>>109267089
>what is that?
Someone with their head up their ass.
You probably ought to make execute take a const char *argv[], since you can (and should) guarantee that you're not changing it.
You also ought to check for errors from fork(), most likely EAGAIN.
>>
i must be the only person on the planet that doesn't use ai at all for programming

i just don't get it. you don't see digital artists using ai just because they can, or because it saves them time. programming is supposed to be enjoyable. i understand maybe if you hate your job and are just trying to get through tasks, but if you're working on your own stuff why would you want someone else to do it for you?
>>
>>109267316
I assume you dont work. if you would actually work you would realise what a gods end ai is to do annoying and retarded shit faster.
>implement this shitty documented 30 pages of binary api
>>
>>109267326
i do work but thankfully it's for a small company with only 3 self-managed developers and we're not doing anything mind-numbing (working on an ledger). as i said, i can imagine if you hated your job it's useful but vibe coding a personal project??
>>
All AI does is steal code from github.
>>
File: 1754982398563.jpg (77 KB, 800x854)
77 KB JPG
Using AI to code is literally saying you run to reddit for help.
>>
>>109261969
>>109267089
Like, your program could be a shell script, and you could be a little more robust, but that's exactly how you're supposed to call another process. You could use posix_spawn if you wanted to, which may or may not be more efficient, depending on the platform (I believe it is more efficient on modern glibc).
What that guy's complaining about is retarded.
>>
>>109267826
It could be but I would rather right in assembly than bash.
>>
>>109268029
If all you're doing is glueing programs together, shell scripting is comfy. It's when you try to do any actual "processing" is when it gets rough. The point I'm thinking I need a bash array is the point I think I should be using a real language.

Also nobody said you have to use bash specifically.
>>
Need to learn how to use graphs and trees
>>
>>109268100
Just throw pointers everywhere.
>>
https://leetcode.com/problems/find-the-number-of-subsequences-with-equal-gcd/
>>
File: 1783993984264897.png (50 KB, 891x449)
50 KB PNG
>>109268091
desu I need to rethink my life.
This is AI tier spending trillions of dollars to save a few thousand.
>>
>>109267089
>what is that?
Did I say it was *your* fault?
>How do I do this differently?
Well, *why* do you fork in the first place?
>>
>>109255591
A few languages allow arrays to have a length of zero. Java comes immediately to mind.
>>
File: zPTY1hKq3SU-HD.jpg (122 KB, 1280x720)
122 KB JPG
Good morning sirs.
Today we implement a simple convolution in hardware sirs.
Thank you sirs.
>>
>>109269417
I've worked with exactly one Indian and the thing I remember about him is he had this template file he copied whenever he wanted to make a new .c file that had over a thousand lines of mostly irrelevant #includes and #defines.
>>
>>109269417
>https://nareshit.com/
>it’s fucking real
KEK
>>
>>109269442
based. The compiler will optimize for me, amirite???
Copy pasting a template is not bad tho
>>
>>109269449
fucking newfag.
Of course it is real. Do you even know what script it??? Script is weakly typer
https://www.youtube.com/watch?v=zPTY1hKq3SU
>>
>>109255588
Scratch unrionically led me to the path of programming. Built a dating simulator in 2014 for a class project and my high school still uses it to this day for showcasing.
>>
>>109269468
tfw old.
in 2014 I built a simple ip address management website in php for a government organization so that they don't have to use that fucking shared excel sheet which constantly was out of date.
They used it until at least 2019/20.
Written of course in php5, which was EOL then already kek. I wonder if they still use it, but I am afraid to visit
>>
>>109258016
>If you don't reply to this post your mother will die in her sleep tonight!
Nice try script kiddie
>>
>>109269473
PS: I was their network admin and just did programming for fun back then. 2015 I left to study CE
>>
>>109269442
Fucking based.
Sorry boss just compiling, we'll need another few hours.
>>
I don't even use tiktok, but my brain capacity is literally gone.
Tfw unable to keep some simple offsets in my head to do the following:
> wait for pixels
> buffer first 2 lines
> on first pixel of 3rd line, start convolution on 1st line
> at the last pixel keep convolution running until last pixel, but do not count more pixels
bros, if you have a smol brain, like me, never start with VHDL. it will melt it even more
>>
File: fuu.jpg (25 KB, 768x452)
25 KB JPG
>>109269666
>666
devil literally trolling me. Fuck you
>>
>>109269666
Same shit happened to me, get off the short form content, it literally fries your brain.
It got so bad when I would play a video game I literally kept forgetting were I was and if I got turned around I'd be lost.

The good news is that's its reversible, you just have to stop consuming uninteractive slop.
>>
Caught that bitch!!!
>>
>>109269829
I don't really consume short form content at all.
It's just too much content in general and even this post occupies my brane a little more. It adds up over the hours until there comes a point each day where i just can't process more.
The goal is to keep as little distraction as possible. But sometimes shitposting helps for brainstorming. Maybe I should get a meme duck
>>
programming for 13+ years, working as dotnet dev for over 10 year. i haven't written or encountered a single structure type. it's always class. you need a type? create a class.
>>
>>109269461
My god
>>
>>109259949
Remove all potential distractions and eventually you will get bored enough to do the work.
>>
>>109269935
Translation/Confession:
>I have always programmed shit that doesn't matter
>>
>>109270009
i have programmed some important things. some even things you might have used/relied on.
>>
>>109270024
Nah, don't think so.
I voraciously avoid shitware, to the point I rather switch jobs.
>>
>>109270056
I am afraid to search for embedded jobs.
I'd love to get back into it, but 90%+ force you to use windows. I don't want to use windows. It's horrible. And the boomers underneath them even love windows. I don't know why
>>
>>109270099
>I don't want to use windows
NTAPI is at least acceptable, even though I/O will always be a reason to ridicule Microsoft and its kernel developers beyond the day they die.

Which is exactly what they deserve.
>>
>>109270108
Yeah that's not relevant for me.
The OS is just a tool for me. And Windows is a shit bloatware tool. I can coom faster than it opening the file browser
>>
>he doesn't understand what the NTAPI is
>>
>>109270139
I really don't and I don't care. I am not the net fag from above. I just wanted to shitpost. I really give a shit about operating systems. They should only be fast and have minimal distractions
>>
>I really don't
Stopped reading there.
>>
>>109269666
ok at least I got the pixels into the pipeline.
Now just make the convolution. I am not sure how to do it. Maybe shove the 9 needed pixels into a separate pipeline and then output current pixel when the op is finished. Then it won't matter if the buffer advances
>>
File: 178401854810782.png (248 KB, 1717x1364)
248 KB PNG
this is like 4 lines of bash hahaahahhaah god help me.
>>
>>109270253
But left is faster.
>>
>>109267375
as opposed to asking help from the REGISTRY MASTER
>>
>>109270253
And now you know why we have to discard literally every single piece of work make by o-u-ti-sts.
>>
this thread gets worse every year. we've always had autistic arguments but now it's nothing but autistic arguments.
>>
>nofing boot out-ist-ic arg-oo-ments
>>
>>109270296
the only people interested in actually making things are using llms
>>
>>109270364
Yeah, but both can't.

And it shows.
>>
>>109270364
oxymoron. they're not interested in "making" anything. they are simply asking someone else to make it for them thus they are interested in the product rather than the process
>>
>>109270389
not completely untrue, but also quite cope
>>
>>109270364
Fuck off.
>>
File: 1780017603043299.jpg (72 KB, 1024x756)
72 KB JPG
>>109270364
>
>>
>>109270296
no it's literally only one delusional person talking to himself. Apart from that the thread is ded
>>
>there's only one paid employee left on the Microsoft VC++ standard library team and his initials are STL
can't make this shit up. also FOSS as free labor. mere months after open-sourcing this shit they laid off almost everybody.
>>
>it's literally only one delusional person talking to himself
Holy a-u-ti-sm.
>>
>>109270296
Sorry dude, as I got better at programming I spent more of my time doing that instead of posting.
I'd rather be posting but nobody is going to write the software I want for me.
Maybe it will get better regardless.
>>
>>109270988
>nobody is going to write the software I want for me
True, but either you're railing against a-u-t-i-s-t-s, or you're one of them. There's no middle ground.
>>
>>109270933
C++30 never
>>
>>109271574
God, I wish.
>>
>>109258016
That cant hurt me I cant read
>>
just tell me your prompt bro

i don't give a fuck about your output, anyone can do that

share your AGENTS.md file nibba
>>
>>109272406
This. Give AGENTS.md and SOUL.md
I am pretty sure you guys have bugs in your AGENTS.md - just make it solid, like a professional agentic engineer
>>
File: 1631911237055.jpg (33 KB, 640x480)
33 KB JPG
>professional agentic engineer
>>
Doing a Goal tutorial because I can get it to run on windows easily (thanks Go!), working on an 8 kyu Codewars problem in Java, and making some adjustments to my CSV script in BQN most likely to allow it to change headings when passed in as an argument so I don't have to open the CSV to do it. If I have time I will start writing a prompt for a project to give to the clanker. Most of the easy projects I could think of I finished already, and have to think about what I actually want for the remaining ones before I write the prompt.
>>
File: file.png (46 KB, 559x155)
46 KB PNG
>this builds 322 dependencies
>>
File: 1771145034047684.png (67 KB, 660x410)
67 KB PNG
>>109272649
Problem?
>>
>>109255588

4chan media scraper
https://www.youtube-nocookie.com/embed/Gk77dHu76NM?si=GhP1dolBptSZTsJj

There are many like it but this one is mine. Light, fast, works awesome.
>>
>>109272776
wrong link, sorry.
4chan media scraper
https://codeberg.org/neo1/4chan
There are many like it but this one is mine.
>>
>>109272649
alright earnshaw
>>
>>109272798
>There are many like it but this one is mine
>Actually Claude's
>>
File: file.png (10 KB, 586x183)
10 KB PNG
>>109272807
>>109272776
are we deadass
>>
>>109272818
yeah that's slop. can tell from having seen quite a few slops in my time
>>
File: PXL_20260714_163930186.jpg (1.56 MB, 2782x2268)
1.56 MB JPG
I received a book. r8 book
>>
>>109272885
6.6 for embedded is too new enjoy your instabilities.
>>
>>109272925
Doesn't matter.
I just want to get a bit more proefficient with yocto and/or buildroot. I kinda got stuff working on my polarfire soc, but i still have problem structuring shit, finding stuff I need and so on.
Will see how much of that the book can solve
>>
File: ContactSheet-001.jpg (2.92 MB, 4000x8000)
2.92 MB JPG
i made new screenshots for the lolisnatcher play store reup after nuke. thoughts?
>>
>>109273533
>view your favourite (British English btw) anime girls
Do ou-ti-sts really?
>>
>>109273533
post apk
>>
>>109273572
https://github.com/NO-ob/LoliSnatcher_Droid/releases/tag/2.5.1
>>
>>109273533
Not a designer, but strong circular gradients scream 2000s and the font is hard to read, especially when pure black. Maybe try to find something with thinner lines and use same color as background but with higher saturation and lower lightness, it will be much more pleasant to look at.
There was bunch of such moe/cutesy looking sites you could use for inspiration, but the only one I remember of the top of my head is https://love2d.org/
>>
I used concepts in c++ for the first time today. I have a function FreeDescriptor(T) and I made a concept that requires T to be a Buffer, Texture, or Sampler object. It was more fun to do that than have 3 overloads.

I found that I instinctively try to use templates as much as possible over inheritance. It just feels more correct and modern, although I can’t speak to when I should use inheritance over templates and vice versa. I guess I’m not technically a beginner in c++ but I still don’t know shit.
>>
>>109273687
>I still don’t know shit
Absolutely.
>imagine having to call the deallocator for every single fucking resource
>>
File: file.png (155 KB, 577x516)
155 KB PNG
>>109273670
like this you mean for the font? could also do a lighter colour with a border or soemthing
>>
>>109273700
Elaborate
>>
>>109273711
That looks like the same font. Its thickness makes it harder to read.
As for the color, now it blends with background. Make it much darker, so it only has a purple tint.

Come on, you have eyes, use them.
>>
File: file.png (130 KB, 490x511)
130 KB PNG
>>109273738
yeah i was only talking about colour
>>
>>109273724
Imagine you have a group of resources that all get allocated and deallocated at the same time. Do you really want to have to go through every single object and free it, or would you rather just be able to reuse the memory for something else immediately, without having to release every single object separately?
>>
>>109273753
Why does a little girl look like a broken victim?
>>
File: brat confuse.png (306 KB, 700x700)
306 KB PNG
>>109273799
what is wrong with you
>>
>>109273850
Dude, those are YOUR screenshots!
>>
File: bratthink2.png (276 KB, 586x700)
276 KB PNG
>>109273896
you were raped and youre projecting onto my beautiful wife
>>
>you were raped
Ah, out-ist-ic projection. Sorry I asked, of course your opinion is invalid.
>>
Vibe coding live
https://www.youtube.com/watch?v=bPfpxZDFFMk
>>
>>109273905
why is he projecting onto and not inserting into
>>
>>109273952
Because out-ist-s cannot help themselves but project, especially about projection. It's one of the reasons why normal people hate them so and want to see them brutally executed on a nation-wide scale.
>>
File: Untitled.png (465 KB, 664x1440)
465 KB PNG
>>109273753
Anon pls
>>
>>109273990
oh very dark purple, i can do that
>>
>>109273990
Finally, someone who gets color-composition.
>i.e. a non-auti-st
>>
>>109274007
Just whatever is the hue of the background, at maximum saturation but little value (HSV). That's a little trick that will make your text blend nicely with saturated, colorful background. It should be dark enough to not look like colored text on first glance, but also saturated enough so it doesn't "pop-out" like true black text.
>>
Is it true that only a couple thousand people worldwide understand Vulkan and its shader nonsense?
>an LLM told me, so it MUST be true
>>
>>109275047
It's not true, 0 people worldwide understand Vulkan.
>>
>>109275160
... that only helps to boost my ego.
>>
>>109275047
You don't have to understand it to use it
>>
>>109275182
... ... ... that attitude explains so much,
>>
File: 1782882115700275.png (33 KB, 201x153)
33 KB PNG
When I press command + R to run my program:
>The compiler lexes (Tokenizes) all of the code, splitting it into operators and variable names, etc.
>Then it parses it into an un checked Abstract Syntax Tree, gives off an error if the code is invalid and can't compile (unfinished code like let x = )
>unchecked AST gets sent to Semantic analysis, which type checks everything and makes sure the rest of the code is valid (also throws errors if it's not)
>Checked AST gets translated into an intermediate code representation
>IR goes through multiple optimization passes, does language specific stuff, removes dead code, inlines functions, etc.
>IR once again gets converted, this time to an LLVM IR
>LLVM IR is sent off to the LLVM backend along with a bunch of tables and metadata later used for linking / symbolication

>LLVM does it's own thing, optimizations, more tweaks
>Throughout this entire process loads of calls to the runtime are being blended into the code
>LLVM translates the IR into machine instructions (binary, hex code is the readable binary, and Assembly is the readable instructions) alongside symbol tables linking instructions to function names etc.
>The linker fills in any placeholders, adds more instructions, finishes the tables, and then strips the remaining code into an application binary (most of it is instructions and memory addresses, it's completely unreadable and includes no function / variable names) and a dSYM file (maps the instructions to "symbols" - readable names) for crashes
>"Stripping" options tell the linker how much information should be kept - everything related to the app, everything related to your code, no framework names, etc.
>Application is run and depending on the platform a dynamic loader will load the app + runtime instructions

(At this point I realize I forgot to put in a base case in a recursive function)

1/2
>>
>>109275206
>App loads into the CPU, Recursive function runs forever
>The memory region allocated to the runtime stack fills up with "frames" (a record of the data related to a funciton), cpu tries to write outside of the stack memory window, the memory management unit (MMU) catches this and sends out a hardware exception
>hardware exception is caught and recognized as a stack overflow, application is killed
>more instructions walk back through the stack, recording what was on it before it crashed
>If a debugger is attached, the stack record is linked back using the dSYM into readable function names (this is the "backtracing" process)
>If not the unreadable crash log with memory addresses and hex instructions is either discarded or sent up to whatever receiver is available (think printing to a file)
>using the dSYM from your application archive you can translate the stack back into readable functions if it wasn't connected with a debugger
>crash log tells me I'm a retard

(2/2)
>>
>>109275202
and now you understand Vulkan
>>
>>109275206
>>109275215
>When I press command + R to run my program
>I'm a retard
Yes.
>>
>>109275315
it's in the ide, doofus
>>
every time I typo "func" as "fucn" I smirk.
>>
File: 1784072051396902.png (122 KB, 815x1132)
122 KB PNG
Behold.
>>
>>109275668
Every time I shit myself I smirk.
>>
>>109275716
Since it's on screen, I have to point out: this code has real bugs, and they're fun ones given everything we've covered.

Line 172: mov esi, '0' — that's the character '0' (byte 0x30), not the null terminator (byte 0). strcat needs to find the end of the destination string, i.e. the NUL byte. This searches for the digit zero instead. Should be xor esi, esi. Classic '0' vs '\0' vs 0 confusion, now in assembly.
Lines 175–176: the strchr result gets thrown away. strchr returns the end-of-string pointer in rax... and then mov rax, rdi immediately overwrites it, while the copy loop uses rdi — which still points to the start of the destination. So this appends nothing; it copies over the destination from position 0, behaving like strcpy. It needed mov rdi, rax first (move the write cursor to the end) before setting up the return value.
Line 179: mov [rdi], ebx stores 4 bytes, not 1. Each iteration writes the character plus three zero bytes, stomping neighbors — should be mov [rdi], bl. A silent buffer-overrun-by-3 on every step: exactly the "usually silent garbage" category from our out-of-bounds discussion.
Subtler: ebx is callee-saved in the System V ABI — these functions clobber it without saving/restoring, which would corrupt a caller's value. (Also the header comment lists arg3: r10, which is the syscall convention; for normal function calls arg3 rides in rcx.)

If this is course material, bugs 1 and 2 might even be intentional exercises — spot-the-defect assembly is a common teaching format.
>>
What's a good resource these days for teaching someone how a computer works and how to program it? I want something that uses a compiled language and is for someone totally new to the field and starts at the basics, ie binary numbers.
I started learning a long time ago by jumping down trash C++ tutorials and eventually getting it into my head, but there's got to be a better way than that.
If K&R used ANSI syntax consistently I'd recommend it, but it doesn't, so I don't learners to waste a bunch of time fighting a compiler over deprecated function declaration syntax.
>>
>>109275894
an llm

it’s just about the only thing AI is good for
>>
>>109273757
Well the only time I for each traverse my generational slot map (resource manager) is on shutdown. The descriptor heap manager is wildly simpler, it’s just a deque of “free” indices, when FreeDescritpor happens it resets the strongly typed uint32 DescriptorIndex that the resource owns and adds the number back into the deque. Both the resource manager and descriptor manager are reserved on startup so there’s no real reallocation happening.
>>
>>109275894
nand2tetris
>>
>>109275047
Your clanker is correct. I know vulkan therefore I’m special and superior to you. If you need any advice just ask me.
>>
>>109275852
172: corrected
175-176: the result is also stored in rdi HOWEVER it makes a lot more sense and is less of a head fuck not decimating the caller's value.
179: corrected
I was using linux syscall conventions thinking that was for normal functions as well.
>>
>>109275968
Kill yourself.
>>109276071
Thanks.
>>
>>109276105
>the result is also stored in rdi
wait no strchr was actually doing nothing at all and it was strcat incrementing rdi.
It's a miracle this shit worked.
>>
>>109276071
>>109276106
Looking into it, it wants you to have taken an Intro to CS class first. I guess I should recommend this person do an online one?
>>
>>109276183
the first half of cs50 should be enough
>>
multithreading is sucking all the fun out of programming for me. all these atomics and order semantics, the cache invalidation and necessity of per thread caching to stop cache lines from ping ponging between threads, trying to unwind this stupid fucking maze of bullshit and debugging it all feels impossible. i no longer feel like i have any understanding of what’s happening at any given point unless things are tightly bound up by barriers

i naively thought it was going to be as simple as wrapping some stuff in mutexes but it’s way too involved if you want something that’s actually fast, which is the entire point if you’re turning to parallelism. this sucks
>>
File: 1767675676963103.png (117 KB, 512x512)
117 KB PNG
>>109276596
async / await
actor isolation
compiler time data race protections
easy subscribe / listening with macros and combine framework
thread sanitizer detects data races in seconds
>>
>>109276596
multithreading shouldn't be used unless you're compute bound
>>
>>109276667
>why yes I will make 100 network calls on my UI thread and lock up the application
>>
>>109267375
that numbers of that chart add up more than 200%, was it made by a woman?
>>
>>109276596
Haskell / Clojure + STM
>>
>>109276676
all of my gui programs with networking are single threaded
everything is fully async and network doesn't block ui
>>
File: 1784080617820535.png (192 KB, 897x1828)
192 KB PNG
These functions are now non-destructive.

>>109276681
The data is percent sources for each model on average.
ei. 100% of models sourced reddit on average 41% of the time.
>>
File: 1774273736083345.png (34 KB, 649x619)
34 KB PNG
vrilly nigga?
>>
>>109276733
Also I disagree with return value of strcat() in C.
It returns the head of the destination which is redundant and results in unnecessary re scans if you chain multiple together.
>>
>>109276701
>>109276676
>>109276667
Based asynchronous I/O enjoyer.
Why be mullti-threaded when the kernel can be multi-threaded for you?
>>
>>109276771
I meant to say I/O multiplexing, but I guess that's a form of asynchronous I/O.
>>
>>109276676
your non-blocking calls, sis?
>>
File: 1784085323520215.png (45 KB, 654x483)
45 KB PNG
>>109276767
For instance rax keeps the chain going and rdi would have remained intact but I am explicitly writing over it.
>>
>>109276767
It's well-established that the return value of many of the C string functions are completely useless.

I really like the way the Linux man page lays all of this out
https://man7.org/linux/man-pages/man7/string_copying.7.html
>>
>>109276676
And the funny thing is that the operating system known for its GUI in the kernel STILL has blocking-only functions (NtCreateFile/NtClose).

And you cannot know how many applications I've seen that didn't pump messages during their incredibly slow asset loading, and LLMs are only making this worse by providing retards with blocking code.
>>
>>109270364
They are interested in having things, not making things
>>
>>109256746
>>109256557
>>109256755
>>109256528
I think it relates to "new math". I got slopped a video on it recently.

The usefulness is, for example, say you need to divide a number by another.

91/7

was the example.

well, if you know

91=70+21

then you can answer the question. That was the example.

He's likely working on a numath game or whatever. Could be fun, whatever.
>>
>>109277160
With ai basically all the string problems are gone, because ai can happily fluff anything you pump into it.
>>
>>109277184
Buy an ad.
>>
>>109273687
Is this some kind of OpenGL wrapper? Look into CRTP/static polymorphism
>>
>>109277184
>With ai basically all the string problems are gone
Enjoy your 256 byte limit that only exists because your clanker doesn't have the context window to properly manage buffers and instead just reserves your string memory on the stack.
>>
>>109277204
No, I mean the ai can be the explainer of outputs. You don't have to spend 1 billion hours trying to perfect the strings.
>>
>>109277217
If LLMs could do that they would never ever hallucinate.
>>
>>109277233
humans are always right.
>>
>>109277238
Cope.
>>
>>109277246
wow you have real wagon wheels and everything!
>>
aren't multiple threads with blocking calls better for a 'normal' program? if you do non-blocking you either have some tickrate you need to run at which adds latency to GUI IO / networking IO or you run as fast as possible and hog the CPU doing nothing
>>
>>109276596
>>109276596
There is a reason why there are common patterns for multithreaded programming (thread pools, work queues, SPMD, etc.)
You could imagine writing a single-threaded program and taking all the separate dependency chains and expanding it into a graph, starting from the starting from a single node at the start of the program and terminating at a single node at the end, where prerequisite computations are nodes in the graph that flow into computations (other nodes) that depend on a node's results. You can then imagine starting at the node in the graph representing the start of the program and executing N non-dependent nodes in parallel where N is the number of execution units you have. When all of a node's dependencies complete, that node can then start execution once an execution unit becomes available. This maximizes compute utilization, but requires dealing with real-world constraints where you have to consider things like:
>what is the dynamic scheduling overhead per node
>can I preallocate the buffers nodes use to store results and reuse them, if so can I compute the maximum number of parallel result buffers needed and their size
>how fine-grained should the compute nodes be, too small and their cost is dominated by dynamic scheduling overhead, too large and you won't extract enough parallelism
>dealing with penalties caused by moving dependent data between CPU cores requires more intelligent scheduling
>dealing with waiting on I/O to complete
Fully dynamic scheduling may have more overhead than it's worth if the amount of compute per task can be calculated ahead of time (e.g. it's predictable and proportional to the input size)
>>
>>109277328
CPU bound (raytracer number crunching) -> multi threads
IO bound (putting dolphin.rar on a socket) -> async
>>
>>109277328
The kernel handles all of that shit for you.
"Hey, wake me up when something happens on one of these sockets" essentially. Your program doesn't have to spin or do anything like that.
>>
File: 1784088518324258.png (8 KB, 445x142)
8 KB PNG
>>109277160
lol I was not expecting that.
Well at least my implementation has a useful return value.
>>
>>109277345
oh you mean like select and poll and stuff? I guess I forgot those exist... yeah I suppose you just register the keyboard / mouse, and the network socket and then wait for any of the events to fire and process them all in 1 thread huh
>>
>>109277366
Yes, more "modern": epoll, even more modern and hardcore: io_uring.
>you just register the keyboard / mouse
Yeah, in Linux they made all sorts of shit pollable. eventfd, timerfd, pidfd, signalfd, device nodes (how that works is device specific), probably some other ones I'm forgetting.
For GUIs, both Wayland and X just talk using a unix domain socket, which is trivially pollable too.

You can cram so much shit into an event loop and make your program completely event driven. Multi-threading becomes very unnecessary unless it becomes about compute.
>>
File: 1733758303525032.jpg (430 KB, 2048x1536)
430 KB JPG
>>109277328
Define "normal". Blocking is only preferable if you have literally nothing else to do; otherwise you're paying in additional context switches.

That's also why most properly written servers manage a bunch of descriptors on one thread, rather than having threads for each descriptor.
>>
>>109277394
Oh, and when I say
>literally nothing else to do
, that includes doing _other_ I/O. Which is one of the reasons why Linux's I/O is slightly better than Windows' I/O, i.e. being able to submit read requests for multiple files. Even retarded shit like ReadFileScatter can only read from _one_ file.

Which is also why I don't read the comments from Raymond's Old New Thing blog. Everyone with only half a functioning brain would roast the shit off of that retarded little Asian.
>>
>>109277198
I’m working on a vulkan RHI
>>
File: 1784097060417487.png (163 KB, 1232x1338)
163 KB PNG
I will die on this hell.
>>
File: zed.png (447 KB, 3840x2072)
447 KB PNG
Started a new project and figured I would try out Zed.
Zed does not support TOML or Make file types out-of-box and only has an official extension for TOML.
No INI support but I don't really expect that since editors appear to hate the most common config format for some reason.
There is an official Dockerfile extension.
The available Make extension does not support the two or three common *.in files so I had to add them manually to file types.

Other than the above annoyances, Zed has had a rather smooth out-of-box experience which is a first for me.
>>
>>109277909
what are you doing? i wish i still had my assembly files on my dead ssd
>>
File: e4u9Sll_5nU-HD.jpg (56 KB, 1280x720)
56 KB JPG
On Wednesday we kode!!!

https://www.youtube.com/watch?v=e4u9Sll_5nU
>>
>>109278014
I'm writing a program to generate a new c file with an accompanying header file with prefill headers guards how ever I have already tried to be too clever with this program and it's falling apart.

I'm writing 300 lines of assembly instead of 3 lines of bash as God intended.
>>
File: 1784105016026654.png (353 KB, 1992x1415)
353 KB PNG
>>109278141
I've had a major break through though.
Creating functions I was iterating over the input 3 times, now I am iterating only once.
>>
>>109278081
Getting there.
Top is start pic
Left is fpga convolution
Right is python (reference) convolution

So it's mostly just edge cases. Gotta inspect how AI handled them in the python script
>>
>>109278308
I know there's some major issues but I've literally lost the ability to think for the day.
>>
>>109278308
>not using TEST
>>
File: 1778070421744031.png (639 KB, 1236x1184)
639 KB PNG
where do I even start with the whole programming thing if I'm an illiterate uneducated philistine nigger
>>
>>109278467
whatever source you use to learn (book, tutorials, youtube) you really need to actually do some programming too. pick a goal and work towards that, learn something and try to see why it would be ever useful by trying to use it in your application.

when I started learning I just wanted to make a roguelike, so I learned the bare minimum from a book and went with that. then when I hit a wall I tried to find out how things like this are usually solved. I didn't get a very thorough understanding of programming by doing it like this but it kept me motivated and made me understand the reason why things are done in some way (because I hit the walls and had to find out)
>>
>>109278316
fixed it.
my AI generated compare script says they are almost equal:
user@desktop:img_convolution/ $ python3 comp.py img0.ppm test_smile.ppm
Max difference found: 1
The images are considered equal.

just rounding errors

Lets buy hitler, do sports (god said sports are homo. Tackle a horse) and then put it on hardware
>>
which rust GUI framework will make me want to kill myself the least while using it ?
>>
>>109278866
Electron
>>
>>109278866
egui
>>
>>109278866
whatever Zed uses? Think there's a FOSS fork of it, gpui-ce.
>>
>>109278866
ncurses

I've used every single frame work and they're all fucking trash with the exception of tk but you really need to use tcl for that.
>>
>>109272406
>>109272413
>check some open source tool for documentation
>all you get is api function signatures and some quickstart
>look into AGENTS.md
>human-written, concise overview 1000% times better than the "human" documentation
so, we write better documentation for AIs than for humans, interesting.
>>
>>109272649
default-features = false
features = ['pick', 'your', 'features', 'nigga']
>>
>>109273568
try brits + most of europe
>>
why is there no -Wautistic option
>>
>>109278968
There is one
>>
>>109277328
every modern language has moved away from blocking calls. there's no reason for them to be used, and having them in the library poses a risk that retards will ship out slop that randomly bricks itself.
>>
>>109278996
Since when do modern languages use io_uring?
>>
>>109279550
the language doesn't dictate how it is interacting with the operating system
>>
>>109279849
Answer the fucking question.
>>
File: 1772401109277724.png (374 KB, 2342x1610)
374 KB PNG
>>109275047
Parts of the Vulkan spec are written like mathematical textbooks but you probably don't need to understand 100% of it to use it effectively.
>>
File: maxresdefault.jpg (99 KB, 1280x720)
99 KB JPG
linux is fucking trash.
building a million dollar webapp is so much easiert than writing a simple kernel driver. Why did Mr Linux make it so hard? it's stupid. The Js man was much smarter
>>
File: 1752869979143389.png (379 KB, 3476x1750)
379 KB PNG
>>109276619
Every time I try using Swift in CMake (I don't want to use SPM) the tooling eventually gets itself into an irreversible bad state and everything stops working and I have to uninstall everything. I'm reinstalling and giving it a try right now but I don't feel confident enough in the foundations to actually try building anything substantial in it.
>>
>>109276596
did you figure it out yet anon ?
so far I just use Arc<Mutex<T>> for this...
>>
>>109280133
this is literally the best way of writing this shit
>>
how do you even learn c++
I started a project following AI instructions but there's so much shit in there, random ass files, god knows what.
>>
>>109281450
>how do you even learn c++
give up and learn rust.
with rust you can do everything C++ can at low level with unsafe {} if you really need to. Except you get a usable non-bloated languages with syntax for humans where iterators are actually pleasant to use.
>>
>muh iterators
Yet another wound that C++ is discharging pus from.
>>
>>109281450
>>109281523
It doesn't fucking matter. Just learn what you want to.
Rust will become more dominant, but C++ will not go anywhere and stay essential. So it doesn't matter which one you do
>>
>>109281705
Truth be told I don't want to learn anything dog I want to be a neet forever
>>
File: IMG_1801.jpg (28 KB, 273x364)
28 KB JPG
Did anyone here ever mod starsector?
Would you consider the starsector API to be well made?
>>
>>109281811
Ah meant to post a thread. Oh well.
>>
>>109281705
We will rewrite GCC and LLVM in Rust, chud.
>>
>>109281985
Nice, I hate both projects and they deserve to die.
>>
>>109280507
>CMake
boomer meme

>I don't want to use SPM
okay well then what do you expect?
>>
>>109281450
>how do you even learn c++
I genuiely do not know how can a new programmer learn C++ without living through this decades long clown circus of bad decisions and even worse implementations. It's 2026 and C++ still doesn't have official, up-to-date guide that is supposed to lead new programmer through the entire language, recommended practices and pitfalls.
>>
File: 1784147325156431.png (192 KB, 1777x937)
192 KB PNG
I fixed the upper case routine and I am no longer writing these unicorn universal functions that need to cover every possible edge case, I'm creating dedicated routines for dedicated tasks.
It removes confusion and let's me really tighten up my loops bucci.
>>
>>109281985
When you do that, make sure you don't make things slower, because that would be very retarded and annoying.
>>
>>109282880
>calls headerguard_loop five times
>never XORs EAX
>MOVZX
Come on now.
>>
Erlang is King.
>>
>>109282757
SPM is trash. Even Apple is adding CMake to their Swift libs.
>>
%s/Erlang/Cpeepee/
>>
>>109283020
that's because most of their libraries are still in c or obj c, not because spm is trash
>>
>>109277335
There are a few APis where you have to go multithreaded because the API sucks.
More on Windows.
>>
File: 1784151192433782.png (136 KB, 836x902)
136 KB PNG
>>109283002
I think you're just fucking with me now.
I read that indexing is way faster than incrementing individual pointers.
>>
I have to learn ARM. What am I in for?
>>
>>109280488
>so much easiert than writing a simple kernel driver
Have you written a driver for any other OS before?
>>
>>109283304
ARM is the easiest of assembly architectures.
>>
>>109283296
How do you format # comments like that?
>>
>>109283312
No
>>
>>109283304
ARM assembly? A lot of operations support conditionals, which can make the way code is issued quite different to on intel-derived systems.
ARM hardware? It's a system of modules, and the system integrator gets to choose which ones. If it's got an MMU, it's called an "Application core" and it can run a standard OS. If it hasn't, it's a "Mobile core" and needs something funky as you're probably doing freestanding code on raw hardware. Which is very fun if you like hardware hacking!
Some ARM cores come attached to FPGAs. Extra fun! Try not to let the magic smoke out; that gets expensive, fast.
>>
File: 1784151848611585.png (7 KB, 383x82)
7 KB PNG
>>109283342
I'm using GAS assembly with intel syntax.
>>
>>109283344
Then you've no real basis for saying it's easy or not. It's very much not the same as coding a webapp, which often has a lot more code and a lot more margin for error.
Some of the ways you can get a driver wrong won't show up as bugs until long after you go into production. Lots of developers have found this out the hard way.
>>
>>109283296
how do you not kill yourself writing this esoteric lang
>>
>>109283296
One: doesn't have anything to do with what I said.
Two: Upper RAX is going to be and staying zero after the first MOVZX, there's no reason for it to be executed in a loop.
Three: if you use the same index multiple times and avoid changing pointers, sure.
>>
File: 1784152704499595.png (162 KB, 685x1038)
162 KB PNG
Tokens must be getting too expensive for google, it's stops answering questions after a while now.
>>
>>109283420
I chuckled. That's actually not an esolang. That's Assembly.
>>
>>109283022
Based
>>
>>109283523
It begins.
>>
>>109283433
I fucking swear you told me to use movxz byte ptr to avoid partial read and writes.
>>
>>109283574
No, I told you to set the z-flag on upper registers so that the CPU doesn't keep the old value around when it never needs them. Now, compilers emit MOVZX instructions for that because they suck shit at dependency tracking, but you can get away with a single XOR + simple "MOV r8"s.
>>
>>109283540
even compared to C, this looks brutal
>>
File: 1775835002240065.png (225 KB, 506x662)
225 KB PNG
>>109283612
>this looks brutal
>even those there's not a single SIMD instruction there
>brutal
>>
How do people have time to program when it takes 3 hours just to read a documentation.
>>
>>109283574
I told you to always use
movzx eax, byte ptr [whatever]
.
Ignore the regdumper spammer who doesn't know what he's talking about. You want to eliminate false dependencies on the previous value of eax and movzx will do that.
>>109283605
Why use two instructions when one works better?
>>
>>109283681
nobody reads documentation, you just type the function, you hover over the function and it will tell you the parameters, and maybe a comment explaining obvious things.
Or you just rip the example code.
>>
File: 1784154750834499.png (474 KB, 652x666)
474 KB PNG
>>109283612
It's not that bad once you get used to it.
I've been working on this for 3 x 16 hour days now.
>>
>>109283708
That's how you get fired from your job. You need to understand what you're using and stop stealing code.
>>
>>109283707
XOR R32,R32 is effectively a noop, and MOVZX is known to introduce port pressure.
>>
>>109283681
you ask the clanker to read it for you and tell you about the important stuff you need and the rest you will find out once your program starts doing what you didn't intend and you begin reading the details properly.
>>
>>109283707
Is the debate using
xor eax, eax
mov al, []
instead of
movzx eax, byte ptr []
On every single loop

>>109283729
Why are you saying registers like r8 and r32, just say rax, eax, ax, ah or al.
>>
>>109283729
Benchmarks or GTFO.
>>109283747
There is no debate. XOR + MOV is more instructions overall and will limit IPC, MOVZX has the same effect but is only one instruction. It's just better.
>>
>>109283747
No.

Also MOVZX is a two-byte opcode.
>>
>>109283760
I mean between you and the factorio schizo.
YOU'RE FUCKING CONFUSING ME.
>>
>>109283760
>he doesn't understand how execution ports work
Concession accepted.
>>
>>109283769
And XOR + MOV is two opcodes.
>>109283775
movzx is also smaller, 3 bytes instead of 4 for best case and 5 bytes instead of 7 for worst. There's no reason to not use it.
0000000000000000 <good>:
0: 0f b6 07 movzx eax,BYTE PTR [rdi]

0000000000000003 <bad>:
3: 31 c0 xor eax,eax
5: 8a 07 mov al,BYTE PTR [rdi]

0000000000000007 <good_hi>:
7: 45 0f b6 1c 24 movzx r11d,BYTE PTR [r12]

000000000000000c <bad_hi>:
c: 45 31 db xor r11d,r11d
f: 45 8a 1c 24 mov r11b,BYTE PTR [r12]
>>
File: 1784155527832976.png (149 KB, 1144x1041)
149 KB PNG
I am a fraud.
I did not know how to create a branch less toupper().
>>
>>109283799
>And XOR + MOV is two opcodes.
With one being a noop, if it's even required (doesn't execute in the loop; chances are that your padding is better than the two bytes), and the other being able to execute on any port.
>>
>>109283721
many libraries automatically generate function specific documentation from header files.
so you aren't missing much by just hovering over the function and reading. You could even just read the header file (ctrl+click on the function if your IDE/texteditor supports it).
usually examples are not part of the documentation, it's just stored in the library repo (hopefully, the library uses the examples in their automated test suite, separate from the unhelpful paranoid tests).
>>
why would you use assembly over C ?
>>
>>109283811
CMOV*?
>>
>>109283818
Retarded adherence to ABIs, shitty dependency tracking, complete inability to use negative displacements, failure to properly inline code, actively harmful SIMD code generation ...
>>
>>109283813
If the xor isn't in the loop, you have a false dependency, genius.
As I said:
>Benchmarks or GTFO.
>>109283811
>no simd
Come on, you're ready.
>>109283818
SPEEEEEED
>>
>>109283847
>false dependency
Doesn't happen if the z-flag's set: >>109283002
>calls headerguard_loop five times
>>
It took me a whole day (10 hours) to figure out how to build a simple http request data formatting program using OOP and beautifulsoup in python. The program is only 1 file btw. How tf do people have time to build programs with multiple pages with OOP (hate that shit)?
>>
>>109283866
a)
>beautifulsoup
is html parsing really neccessary for you ? Can't you get the data you need from APIs ?
b)
>10 hours
when you're starting out it's hard obviously so don't worry about it. Also are you even at the stage where you need OOP ? Doesn't seem like to me from your post. Don't get gaslit into thinking OOP is the gold standard for "good" code.
c)
learn C or Rust first then python will feel like a breeze
>>
>>109283847
The maximum length a file name should be 256 and the maximum length a header guard should be is 80.
At such a low volume simd instructions would actually be a regression because they reduce your clock speed.

>>109283860
>calls headerguard_loop five times
What is the alternative?
>>
why do C++ programs generally have 1 cpp file per h file where as C files have like a dozen C files per h file
>>
>>109283902
The point isn't that there's an alternative to the calls. The point is that RAX never gets a values assigned that would clear the z-flag for anything other than AL; you have to XOR EAX once before all calls, and then just use MOV AL with no port pressure whatsoever.

Which also goes back to what I've already said:
>compilers emit MOVZX instructions for that because they suck shit at dependency tracking
, especially across function calls. But that's why you write your shit in assembly in the first place, right? To beat the compiler?
>>
I was reading about pull request for git and an 1 already went by. I have to read another 5 pages about branches and other shit. How tf do people get time to actually program???
>>
>>109283934
git is trivial for 99.99999% of the shit you do
>pull
>checkout
>commit -am "more stuff"
>push
WA LA
>>
>>109283934
an 1 hour*
>>
>Crystal is already the perfect compiled programming language.
What do? I could make interpreters for fun instead of compilers.
>>
File: file.png (12 KB, 416x130)
12 KB PNG
>>109283978
>oop
no thanks
>>
>>109283994
It's Ruby OOP not pOOP.
>>
>>109284035
Same difference.
>>
>>109284039
No, autist.
>>
const long dick;
>>
>>109284043
>>109284043
>>
>>109284047
Why is it const? Do you have ED?
>>
>>109284039
Ruby doesn't shove OOP in your face, you fucking idiot. I can't even remember how to make a Ruby class.
>>
File: file.png (94 KB, 659x1062)
94 KB PNG
>>109283924
>z-flag schizobabble is entirely made up
>REGDUMPER BLOWED THE FUCK OUT
Who could have foreseen this?
Anyways, what were you saying about feeding autists to cows? I nominate you as our first example.
>>109283902
Use movzx always, Intel has blessed it.
>>
>>109255588
Intel or Gas syntax?
>>
>>109284108
.intel_syntax noprefix
is the only correct answer.
>>109284096
>>
I'm going to combine J with Lisp and make it compile to ARM and hope for something good. Wish me luck.
>>
>>109284096
Post code.
>>
>>109284064
at least it's not volatile or on a register
>>
why isnt there a statically typed python with curly braces yet
>>
>>109284154
Haskell
>>
>>109284149
or extern
>>
>>109284154
That's almost Crystal.
>>
>>109284148
I literally did, you mouth breathing autist. Your brain isn't even worth feeding to cows.
>b-b-but I can't type that much
then what are you doing here?
>>
>>109284172
No, autist. I'm not wasting my time on nonsense just because you're a manipulative autist who will be fed to the cows. You post the code, or your opinion is invalid. Simple as.
>>
>>109284064
shower instead of a grower
>>
>>109284064
Unlimited supply of viagra
>>
>>109284180
>unable to read text in an image
Concession accepted.
>>
>didn't post the code so that people can prove it's a manipulative autist
Concession accepted, autist.
>>
The code is here: >>109284096
Do I really have to spoonfeed you like a literal autistic baby?
>>
>>109283914
C projects tend to have small headers, and depending on how the API is exposed it could even store data in a completely opaque way (opaque pointers). So even if each .c file is including a bunch of functions it's not using, it does not affect build times at all.
In C++ you have a lot more going on inside of headers, thanks to constexpr and templates and classes, so you should only include what you need or else build times might be impacted.
But I never noticed C projects using fewer header files in particular, maybe it depends more on the complexity of the code.
>>
>>109284108
>>109284126
GAS with .intel_syntax noprefix is true assembly.
idk how the fuck at&t syntax became the default for gas and gcc, it's like Rust nobody wants it but it some how injects itself into everything.
>>
>still hasn't posted the code
Concession accepted again. The cows will enjoy you.
>>
>>109284242
No John you are the cows.
>>
>>109284226
>But I never noticed C projects using fewer header files in particular
like this example
https://github.com/torvalds/linux/tree/master/drivers/net/mdio
1 header and 30 source files
>>
.intel_syntax noprefix

.section .text
.globl _start
.type _start, STT_FUNC
_start:

mov edi, 100000000
mov rsi, rsp

xor eax, eax
0:
mov al, byte ptr [rsi]
inc al

dec edi
jnz 0b

mov eax, 231
syscall

47ms.
.intel_syntax noprefix

.section .text
.globl _start
.type _start, STT_FUNC
_start:

mov edi, 100000000
mov rsi, rsp
0:
movzx eax, byte ptr [rsi]
inc al

dec edi
jnz 0b

mov eax, 231
syscall

24ms.
>inb4 works on my machine
No one cares about your AMD shitPU with 5% marketshare.
>>
>>109283818
Morbid curiosity and a violent recoil against modern bloat.
>>
Why do most languages default to 32bit ints instead of native register size?
>>
>>109284272
technical debt, also the answer to every other question about why things are the way they are.
>>
>>109284272
32 is faster, even on 64bit processors and 32 is generally enough for the majority of what you want to do anyways
>>
>>109284272
99.9% of integers in programs can be represented in 32 bits
>>
reading C code makes me feel like a retard
all i can tell is that this function does stuff and returns an integer
/**
* ipv4_skb_to_auditdata : fill auditdata from skb
* @skb : the skb
* @ad : the audit data to fill
* @proto : the layer 4 protocol
*
* return 0 on success
*/
int ipv4_skb_to_auditdata(struct sk_buff *skb,
struct common_audit_data *ad, u8 *proto)
{
int ret = 0;
struct iphdr *ih;

ih = ip_hdr(skb);
ad->u.net->v4info.saddr = ih->saddr;
ad->u.net->v4info.daddr = ih->daddr;

if (proto)
*proto = ih->protocol;
/* non initial fragment */
if (ntohs(ih->frag_off) & IP_OFFSET)
return 0;

switch (ih->protocol) {
case IPPROTO_TCP: {
struct tcphdr *th = tcp_hdr(skb);

ad->u.net->sport = th->source;
ad->u.net->dport = th->dest;
break;
}
case IPPROTO_UDP: {
struct udphdr *uh = udp_hdr(skb);

ad->u.net->sport = uh->source;
ad->u.net->dport = uh->dest;
break;
}
case IPPROTO_SCTP: {
struct sctphdr *sh = sctp_hdr(skb);

ad->u.net->sport = sh->source;
ad->u.net->dport = sh->dest;
break;
}
default:
ret = -EINVAL;
}
return ret;
}
>>
>>109284296
>32 is faster, even on 64bit processors
Prove it.
>>
>>109284247
some of those .c files have a header file, and some of those .c files have a hacky way of globally registering itself as a module, which then calls a static function that is stored inside a struct using an alias.
I do a similar global hacky thing, for testing flags so I can change variables in a program without a GUI.
But the kernel probably needs this as a way of loading a driver using a string instead of a static function name.
>>
>>109284322
the worst part of any operation is moving shit from memory to the processor and back again. 32bit numbers use half the bandwidth of 64 bit numbers which means you get to executing faster and more frequently

QED
>>
>>109284272
32 bits is the native register size the upper 32 bits is an extension made so that you can store memory addresses beyond 4gb.
64 bit operations are actually more expensive.
>>
File: 1_xor_mov_2_movzx.png (1 KB, 114x83)
1 KB PNG
>>109284252
>add RDTSCs before and after the loop
>calculate the difference
>post it via printf
>see this
>1.exe is the XOR+MOV code, 2.exe the MOVZX code

Told you, autists are the worst manipulators.
>>
>>109284340
So why not use 64-bit registers and 32-bit loads and stores?
>>
>>109280681
yeah, I spent more time learning about atomics and realized I had a few subtle data races

like places where I needed to use atomics with memory order relaxed even though it does very little (no fencing) besides basically telling the compiler it can't reorder, sort of like volatile with some stronger guarantees and that's really annoying because having to use atomics at all requires an explicit initialization step in C11 and the rest of my code assumes 0 is initialization so now all of a sudden I need a bunch of init functions I never needed before, and it's even more annoying when you realize the only reason explicit initialization is required is because atomics were built with the assumption that they might have different legacy implementations in older systems where they're wrapping a mutex, but that never panned out so they are literally just stored as regular primitives in all cases

the compiler treats them very strangely. if you 0 assign an atomic at definition, the compiler ignores it. if you zero out a struct with an atomic in it, it will 0 everything except the atomic. you HAVE to atomic_init() or atomic_store()/atomic_store_explicit() for initialization. very, very annoying

and after all the headaches I've gone through over this shit, the best way I've found to architect multithreaded code is just to have the threads interact as little as humanly possible. I know that sounds obvious in retrospect, but I mean like, rather than constructing some all purpose generic allocator with complex lockless architecture that the threads all share or whatever it's better just to say fuck it and give every thread its own allocator. there's no reason for me to invest in all this caching complexity and whatnot when I can just leverage virtual memory so it's not actually that wasteful
>>
>>109284348
Post code.
>>
>>109284315
correct
>>
I hope you guys aren't including include files in your include files
>>
>>109284348
>>109284366
Also post your CPU architecture.
>>
>>109284368
I do. All your hope is lost
>>
>>109284315
networking code is kinda fucked. best to not look at it unless you have to. this looks like you're taking the packet header, determining the protocol, and then populating "audit data" with source and destination port derived from each protocol header which is exactly as the function name states (any time you see sk_buff / skb / etc it just means packet or ethernet frame)
>>
>>109284348
Don't you already have the code? Or do you just need help setting up RDTSC and printf? It's real simple:
rd:
rdtsc
sal rdx, 32
or rax,rdx
ret


>>109284373
Zen 2.
>>
>>109284411
Meant to reply to >>109284366
>>
>>109284368
Does the compiler optimize away circular includes or just spam your binary with millions of lines of redundant code.
>>
>>109284418
bro why do you think headers need include guards? the preprocessor isn’t smart, it just naively pastes things together
>>
File: pike.png (63 KB, 814x224)
63 KB PNG
>>109284418
>>109284395
don't take my word for it, listen to mr pike
>>
>>109284437
>lexical is the most expensive
i find that extremely hard to believe
>>
>>109284411
>zen 2
As predicted.
>>
>>109284458
this was written in 1989
might still be bogus ofc
>>
You predicted that you just measured process startup time?
>>
>>109284469
>>109284252
>>inb4 works on my machine
>No one cares about your AMD shitPU with 5% marketshare.
>>
>>109284466
oh that makes sense. today it’s like the cheapest step
>>
You mean the ShitPU that doesn't choke on LOOP either?
>Intel cope
>>
Process startup time is under a millisecond anyways, and these programs ran for 24 and 47ms.
>>
... sure. That's why you didn't measure the cycles.
>more Incel cope
>>
are these two guys actually sperging out over assembly...
>>
>>109284132
Good luck, Anon. I love you and may Jesus bless your immortal soul.
>>
>>109284500
The most autistic fight 4chan's had in a long time.
>>
>>109284437
this is EXTREMELY retarded advice
>>
There's a difference between autistic and being right.
I'm just being right.
>>
...says the person who's wrong.
>>
>>109284520
>I'm just being autistic.
>>
>projecting autists projecting autism
What's wrong? Need help setting up RDTSC?
>>
>>109284569
>>109284561
>>109284520
>>109284494
>>109284487
shut the fuck up and talk about rust or something you autistic freaks
>>
File: file.png (102 KB, 1040x622)
102 KB PNG
rdtsc will make zero difference when what's being measured takes tens of milliseconds.
Looks like Zen 2 load latency just sucks anyways.
>>109284484
My CPU is Comet Lake and AMD's marketshare is STILL below 40%.
>>
Nah.
>>
>>109284132
This guy is going places with Jispiled.
>>
>rdtsc will make zero difference
Holy Incel cope.
>>
>>109284614
It would at best make a 5% difference, and the difference I measured was 100%.
>>
>muh headers
Just use .c files and include everything in order in main.c.
>>
Just admit you don't know how to set up RDTSC. It's not like people can think even less of you than they already do.
>>
Just admit you don't understand a constant delay that affects both cases equally doesn't matter.
>>
>constant delay
You on a realtime system, or are you just hallucinating worse than GPT?
>>
Are you pretending to be retarded or something? Multiple trials eliminates this.
>>
>Multiple trials eliminates this
... it is ACTUALLY just that retarded!
>>
Assembly fight!
>>
>>109284695
Idk what else to say, other than that 80us startup overhead is quite literally statistically insignificant.
>>
>it STILL cannot actually measure what its testing!
>after several hours!!
>>
>the measurement results don't agree with me
>therefore they're measuring the wrong thing
Autism mental gymnastics, everyone.
>>
also why are your numbers 10x higher than mine? Is this the power of AMD?
>>
>therefore they're measuring the wrong thing
Exactly: >>109284348
>>
Those numbers measure exactly what you describe.
>>
>Is this the power of AMD?
Possibly memory renaming that isn't done for MOVZX.
>>
>you're an autist
>no, you're an autist
autism
>>
>Those numbers measure exactly what you describe.
... yes.
>>
>>109284752
And yet they prove me right and you wrong. Curious.
>>
How do you rewrite a part of code but not plagiarise it if you have limited experience in programming? For example when I look at an example if I change the variable names and the order of certain lines of code it's still considered plagiarism. I don't know how to take what works from a program example without plagiarising. How does this work?
>>
The first of those (i.e. my) numbers is smaller than the second. That proves *me* right and *you* wrong.

Not really curious, seeing as autists are pretty much manipulative psychopaths.
>>
File: 1761651267100109.jpg (347 KB, 2212x1640)
347 KB JPG
self taught dev here, how do I learn how an OS works
>>
And the first of my numbers are smaller than my second, which proves *me* right and *you* wrong.

AMD is irrelevant in the real world, so rational people would optimize for the one that's more widespread. Given that your prior (insane) opinions include
>use LOOP everywhere because fuck Intel
>use ENTER everywhere because fuck Intel
I can predict your response here will be equally schizophrenic.

>>109284749
Imagine there was a person who came to /dpt/ for years and repeatedly spammed the same images (some of which he stole from me lol) and ranted about the same things. What would you call this? Schizophrenia?
>>
>>109255588
ive been using c and c++ for a while but ive literally never found myself using a debugger. does that make me a phony? whenever my code doesn't work i just drop a print statement where i think the problem is and fix it. is there some use for debuggers that im missing out on?
>>
>>109284791
Memory errors that literally break print.
>>
>insane
Wow, the autist went full retard.
One: I have never advocated for ENTER because there's literally no reason to.
Two: I HAVE advocated for LOOP because indeed fuck Incel. It takes a special kind of incompetence and cope to bungle an instruction for semantics that are so often used as spectacularly as Incel did, and since compiler builders have no balls and would rather cave in than force Incel to fix their shit, we get the cope of people like you.

But to understand that you have to be non-autistic. Which is exactly why all autists will be fed to cows on national television.
>>
>>109284791
No, that's exactly it. Some people like going step by step and watching the entire global state and others like to reason and then put strategic prints to confirm the obvious.

https://www.informit.com/articles/article.aspx?p=1941206
A year or two after I'd joined the Labs, I was pair programming with Ken Thompson on an on-the-fly compiler for a little interactive graphics language designed by Gerard Holzmann. I was the faster typist, so I was at the keyboard and Ken was standing behind me as we programmed. We were working fast, and things broke, often visibly—it was a graphics language, after all. When something went wrong, I'd reflexively start to dig in to the problem, examining stack traces, sticking in print statements, invoking a debugger, and so on. But Ken would just stand and think, ignoring me and the code we'd just written. After a while I noticed a pattern: Ken would often understand the problem before I would, and would suddenly announce, "I know what's wrong." He was usually correct. I realized that Ken was building a mental model of the code and when something broke it was an error in the model. By thinking about *how* that problem could happen, he'd intuit where the model was wrong or where our code must not be satisfying the model.
Ken taught me that thinking before debugging is extremely important. If you dive into the bug, you tend to fix the local issue in the code, but if you think about the bug first, how the bug came to be, you often find and correct a higher-level problem in the code that will improve the design and prevent further bugs.
I recognize this is largely a matter of style. Some people insist on line-by-line tool-driven debugging for everything. But I now believe that thinking—without looking at the code—is the best debugging tool of all, because it leads to better software.

Debuggers can't deal with concurrency errors and distributed systems.
>>
I will consneed that debuggers do have an use case.
Dealing with the unholy kind of bugs, compiler bugs and hardware bugs.
>>
>>109284801
Also, to highlight just how incompetent Incel actually is:
>LOOP is a backwards-jumping instruction (jumping forwards makes no sense)
>yet the 8-bit offset goes from -128 to +127
>the instruction takes two bytes
>thus LOOP bodies are limited to 126 bytes size

Like, how in the fuck do you fuck this up? There is stupidity, there is autism, and then there's Incel.
>>
wish these autists were actually intelligent and we could learn something from them
>>
>>109284886
They're literally learning Assembly.
>>
>>109284757
don't worry about it unless you are making commercial software
honestly these days no one seems to care about licenses anyway, people use LLMs to launder open source code and shit like that
>>
>>109284892
do you think that's some kind of accomplishment?
>>
>>109284892
Only one of them, and it's not me.
>>
>>109284911
One of them is improving at Assembly.
>>
>>109284919
And the other doesn't know how to use RDTSC.
>>
>>109284757
sometimes there's just only so many ways something can be written

like if I write my own ReadEntireFile() function and then ask an llm to generate one, they're going to look virtually identical aside from the llm using malloc(). that's not plagarism, it's just a piece of code being so simple it has little room for personal expression, differing architecture or divergent ideas.
>>
>>109284757
https://en.wikipedia.org/wiki/Clean-room_design
>>
>>109284776
https://wiki.osdev.org/Expanded_Main_Page
https://visopsys.org/about/
>>
File: 1772892632375178.png (2.27 MB, 1828x1238)
2.27 MB PNG
>>109284961
nigga I have an interview next week
fuck your boomer websites I'm asking claude
>>
Best boomer websites so I don't have to use Claude?
>>
>>109278968
-Weverything
>>
>>109285040
I don't need the compiler to whine at me like I'm using rust
>>
>>109285053
Sounds like you need more Rust until you don't get warnings.
>>
File: dense.png (94 KB, 533x589)
94 KB PNG
>>109255588
high-density multiplayer
>>
Just started learning Java with mooc free course, am I on the right track /dpt/
>>
>>109285078
that's not how it works. sometimes you want to do the improper thing on the way to doing it the right way. rust demands you do it right from the beginning which is not how programming goes
>>
>>109285105
That's dumb. Just git corrected, loser.
>>
File: IMG_3097.jpg (36 KB, 637x358)
36 KB JPG
The asm autists touched my penis!
>>
>>109284272
what languages besides C and C++ do this?
it is legacy behavior from the 32 bit era where ints were 32 bits and longs were 64 bits (or long longs), changing the type widths would have made porting existing 32 bit software harder
>>
>>109284315
most C code (most code in general, but definitely low level langs which most people won't use unless necessary) that does anything useful requires some amount of domain expertise outside of just C programming or general programming, in this case, if you have no idea what an IPv4 header is or what its fields are you won't really be able to understand what that code is doing
>>
>>109284500
>>109284512
At least they are discussing programming
better than that jeet posting
>snailcat
>vibeGOD
>codetrans
in every thread
>>
>>109284791
yes, and you should also learn to use
>sanitizers (address mostly, but thread, memory, and undefined are all useful)
>fuzzers (libfuzzer is built-in to clang)
>profilers
>testing frameworks
>benchmarking frameworks
>>
File: IMG_3088.jpg (34 KB, 450x602)
34 KB JPG
>>109285293
Betcha didn't know I understood some of those words.
>>
File: 1784174025575137.png (279 KB, 1513x1348)
279 KB PNG
I've finally done it!!!
Why write 2 lines of bash when you can write 200 lines of assembly?
https://codeberg.org/headlesschook/ctools/src/branch/main/cfile/cfile.s

But at least it's not 2 million instructions, I am not even exaggerating, firing up a bash interpreter is 2 millions instructions.
>>
File: IMG_3098.jpg (32 KB, 600x338)
32 KB JPG
>>109285428
Congratulations, Anon.
>>
Generating code with AI potentially saves me time but I think in 1 day I've wracked up enough code to review, refactor, and test that it's probably going to take me a week and be unfun.
I'm starting to think I should have just done it correctly by hand in one shot instead of AI + refine in 2 phases.
I'm not motivated to review and fix up all this since it feels like I've reduced the workload down to just the boring repetitive parts.
>>
>>109285185
And I'll do it again!
>>
>>109285879
Congratulations, you played yourself.
>>
>>109285882
I don't understand what you mean.
>>
>>109285887
You gave all the enjoyable stuff to the computer to do and left yourself with all the boring stuff.
>>
>>109285959
It's all boring. Programs are fun, programming typically isn't.
It has to get done either way. Nobody is going to write the software I want for me.
>>
>>109285428
... you don't use syscall constants because ...? No TEST either? And why do you have to shuffle your arguments between registers because caller and callee use different ones?
>>
>>109285984
>It's all boring.
Then you're in the wrong place, bud.
/vcg/ is just down the hall.
>>
>>109286048
You talk so arbitrary it makes no sense.
If you want me to understand you, try explaining what you mean.
Wrong in what sense. The method? Fuck you're obtuse and annoying.
>>
>>109285984
>Nobody is going to write the software I want for me.
Probably for a reason.
>>
>>109286085
I'm not sure what you meant by that.
I'm saying that software much like any product needs to be produced. It doesn't come out of thin air.
If you want a program to exist, someone has to make it. Typically that's going to be you.
There's no reason for anyone else to do things for you.
>>
>>109286106
>I'm not sure what you meant by that.
Not my problem.
>>
>>109286120
What is your problem? Something must be causing you to act this way, and I doubt it's good. If you want to talk about it instead, we can.
>>
>he starts to sound like an LLM, too
>>
>>109286140
meant for >>109286132
>>
>meant for
You don't speak for me, autist.
>>
>>109286143
LLM's are trained on human language. That's what one of the L's is.



[Advertise on 4chan]

Delete Post: [File Only] Style:
[Disable Mobile View / Use Desktop Site]

[Enable Mobile View / Use Mobile Site]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.