Hacker News new | ask | show | jobs
by VWWHFSfQ 988 days ago
Are hackers optimizing? Or are they writing the same code they always did but now code-generation targeting these platforms is optimizing?
5 comments

They are optimizing, probably. Thanks to the internet, knowledge sharing is substantially simplified compared to the 1990s, and it's massively easier to find people to collaborate with. Hard to understate how difficult it was to find useful info back in the day.

Additionally, anybody that grew up coding on the Amiga has had 30, 35 years to think about it since! - and they are probably still young enough (or, more accurately, probably not yet properly old enough...) that time has, for now, added more to their abilities than it has taken away.

And: modern PCs are ridiculously fast! A table or routine that would have taken your Amiga days to produce, even assuming you'd have considered the idea feasible in the first place ("b-but - you'd need a temporary 512 MByte table for that!!") can be generated in 5 minutes with some python code on your 10 year old laptop.

Tooling and code generation improvements no doubt help a lot, but IMO those improvements must be coupled with creative manual optimizations in order to get something like this out of a platform that was tailored for rectangular 2D bitmaps.
It's extremely impressive in any case.
This was almost definitely written in asm, no code generation involved.
Optimization and hardware tricks
There isn't much the compiler can optimize on such a simple CPU as the m68k when the source is simple C or hand-optimized assembler code to begin with.
Contemporary compilers definitely do a lot of CPU-agnostic optimizations that ye olde compilers weren't capable of. The only new CPU features that fundamentally change this are vector instructions, and compilers still suck at autovectorization.
Contemporary compilers are "optimized" to optimize for superscalar, fully pipelined, out of order cpus with plenty of ram and caches. Literally nothing in common with a 68k. Also modern compilers wouldn't even know how to produce code for the amiga coprocessors.

This engine very likely is written in hand optimized, clock-exact, asm.