3 ms·
C++ and Rust contain (incomplete attempts at) emulating the sound chip - the other languages just have an empty stub (I want to get at least one implementation
by Shish2k 4y ago
C++ and Rust contain (incomplete attempts at) emulating the sound chip - the other languages just have an empty stub (I want to get at least one implementation working properly before using it as a reference to write the others - interestingly both of those implementations, despite being written based on the same specs, sound wrong for different reasons…)
Also I wonder how it counts “lines” - if it is literal newline characters, then probably the biggest factor there is that some languages insist on having a newline after each case in a switch statement and some don’t — so in the CPU implementation some languages are like
case 0x42: self.PC = self.A; break;
and others are like
case 0x42:
self.PC = self.A;
break;
(which adds up quite a bit when multiplied by 500 CPU instructions)
If somebody wanted to go to the effort of counting logical statements per language, I’d be interested in seeing what that looks like :)
It’s also probably worth comparing module-by-module — like for all languages, the CPU implementation does pretty much exactly the same thing in exactly the same way; but for command line argument parsing, every language is very different.