3 ms·
I've written assembly in a production environment. I love it and wish I could do more. But the context where I'm doing it is very different from the context wh
by wat10000 1y ago
I've written assembly in a production environment. I love it and wish I could do more.
But the context where I'm doing it is very different from the context where you had to write a division routine from scratch! We never use assembly where a higher-level language would be good enough. It's only used for things that can't be written in C at all, either because it needs an instruction that the C compiler won't emit, or it involves some special calling convention that C can't express.
However, I read assembly in production all the time. Literally every day on the job. It's absolutely essential for crashes that won't reproduce locally, issues caused by compiler bugs, or extremely sensitive performance work. Now, lots of programmers very rarely have to deal with those sorts of things, but when it comes up, they'll be asking for help from the ones who know this stuff.
- xxpor 1y ago+1 on reading. I hardly consider myself an expert ARM ASM programmer (or even an amateur...), but a baseline level of how to read it even if you have to look up a bunch of instructions every time can be super useful for performance work, especially if you have the abstract computer engineering know how to back it up. For example, it turns out that gcc 7.3 (for arm64) doesn't optimize foo() ? bar() : baz(); the same as if (foo()) { bar(); } else { baz(); } ! The former was compiled into a branchless set of instructions, while the latter had a branch!
- charleslmunger 1y agoYou can use __builtin_expect_with_probability with 0.5 to tell the compiler to be consistent in using a select rather than a branch.
- ferguess_k 1y agoJust curious, what kind of work do you do? Sounds like SRE in FAANG that deals with production systems. I work as a DE and the lowest level thing I have to read is JVM dump from spark. Man I envy you.
- wat10000 1y agoClose, OS development at a FAANG.
- ferguess_k 1y agoWow this is a dream job.