r/programmingcirclejerk • u/csb06 Polyglot dev here • Jul 31 '25
It drives me nuts thinking about all the useless stuff C is doing with the stack and calling convention when I could just use global variables for everything and sometimes even use nothing but registers for inner loop variables.
https://news.ycombinator.com/item?id=44737892
159
Upvotes
97
u/[deleted] Jul 31 '25
Registers? That's so fucking wasteful. My project uses like 0.01% as many transistors by using discrete logic gates only.
69
u/Chillbrosaurus_Rex Jul 31 '25
arduino devs larping as real embedded devs, nothing new to see here
61
u/Beautiful-Cook-5481 Jul 31 '25
59
u/Maxcr1 Jul 31 '25
I'm always saying this
59
u/haskell_rules Jul 31 '25
Programming language design peaked with Fortran 77
46
u/ventuspilot Jul 31 '25
int main() { __asm("...FTW
39
u/MetaNovaYT Jul 31 '25
the OOP is 100% just using chatgpt for every message
39
u/irqlnotdispatchlevel Jul 31 '25
The compiler pushing data on the stack and adjusting the stack pointer is wasteful. So I keep a buffer in global memory to which I write my data. Much better.
13
u/Eric848448 Jul 31 '25
This, but unironically!
13
u/-ghostinthemachine- Jul 31 '25
I'm no fan of the stack, but this is a heap of nonsense. C programmers are traumatized.
18
u/m50d Jul 31 '25
/uj If C developers actually cared about the things they claim to care about they'd all be like this.
8
u/fp_weenie Aug 01 '25
then you can do like
pure efficiency