Thoughts
I watch this video so often.
=> https://youtu.be/vQEK_Ie0TH8 Feinberg ROASTS MinecrAvenger's 2nd Place Run
cw language; it's a Feinberg clip
This is how I feel when reading bad takes on the internet every day.
Edit 1:53:
Another Zig programmer who is like 'why does my loop take a different number of milliseconds in debug mode. [screenshot of assembly]'
Like I'm sorry I'll fix that for you. I'll fix LLVM to make sure that the assembly is the same with or without optimizations.
Zig has two different features for this. You can `@setRuntimeSafety` or you can use built-in assembly and if that's not enough there is accepted proposal to implement `@optimizeFor` which you can implement in the language because it's open source.
Okay. "I'm surprised by how 'lazy' this assembly is for such a simple loop. 😕" If you can write better assembly. Write the better assembly. Put it in an asm block. That's why they exist in the language.
If you the LLVM backend is missing an optimization, you can reduce the LLVM IR and file an upstream bug. But they can't do that. They don't want to do that. They haven't included which of Zig's three release modes they're building in. They haven't included their target. They haven't included their backend. They haven't included their whole code. I'm pretty sure this screenshot of assembly that they're complaining about being 13 instructions is being compiled in Debug because when I put it into Godbolt I get 3 instructions. I'm crying. My mental is too fragile to deal with normal people like this.
What the hell do you want me to do.
Somebody's like "[just] compare to a hardware timer." and they're like "Yeah that's what I'm going to have to end up doing. I guess" How dumb are you. You need something to run in a predicable amount of time. Option 1: hardware timer. Option 2: complain about Zig programs running in different amounts of time with and without optimizations.
Oh my word my mental health is so bad.