I've just been reading a paper on transpiling (a systemish subset of) C into Bourne shell executables, and was amazed by how fast it ran. Compiling the compiler took around a minute depending on which implementation of sh was used.
Agreed, it's frustrating. Ffs, the Apollo Guidance Computer had the rough equivalent of 36k of ROM and 2k of RAM - https://news.mit.edu/2019/behind-scenes-apollo-mission-0718. I think there's very little incentive to optimize when you've got GBs of RAM and TBs of storage.
I noticed this especially in game development practice. Where 20 years ago optimizations were really important. Now the attitude is more like "why bother?". I hate that.
So, I have to rant a minute here. Humans doing a bunch of fallible work to achieve better mechanical sympathy is a terrible waste of time. Our compilers should be doing this work for us, and our languages should support the needs of such compilers.
Sure, but the amount of resources spent pursuing these goals by industry is negligible, while the potential payoffs are huge. Classic tragedy of the commons.
We should be writing code in strongly-normalizing high-level languages and have supercompilers that can convert from the normalized form to the optimal implementation. But no, people want to mash things around with strings in JavaScript.
I've thought about this a lot actually. The problem is, once you have a normalized form, you need to lift it back up into some higher-level form to perform most optimizations. This is hard, in general case.
While I agree. That is the absolute maximum of hand made optimization. That goes even too far for me. Unless working on very limited embedded systems. But that's another story.
In my position, I'm an IT dept. of 1, and 50%+ of my job is coding and maintaining our internal system. I'm constantly looking for ways I can optimize. I get excited when I can shave multiple seconds off a workflow or consolidate DB round trips in my code.
Granted, I have luxuries many don't have, but I also develop with an eye toward the "hit by a bus" scenario and I want my code to be as readable, maintainable, and optimized as it can be, assuming the usual tradeoff of only 24 hours in a day 😅
On a related note, if you're into hardware from that era and beyond, Ken Shirriff's blog has hardware teardowns of some of the Apollo gear - https://www.righto.com/2022/04/the-digital-ranging-system-that.html?m=1 and a WHOLE LOT more. He really does some amazing articles and is worth checking out even if you're not a hardware geek 😉
Comments
this is why we need to bring back BXJ
Reference: https://dl.acm.org/doi/10.1145/3687997.3695639
- Poorly Made C
- Well Made JS
- Poorly Made JS
C is just an example but like, yeah you can make fast JS code, but it won’t be as fast as other langs, even when written poorly. There is a ceiling.
Not to say never use JS, just be aware of its limits :P
https://stackoverflow.com/a/10836199
"Where is the one person, the nerd with the exotic programming language and the only one who knows how our system works?"
Hit by a bus.
AHHHHHHHHHHHHHHHHHHHHHHHH