News for hackers. Stuff that matters.
Re:Show HN: Space Invaders in C by pvg on Friday December 06, 2019 @03:12AM (#21720027)
you'd expect C to do a lot better in the line-count department

You would but it's worth keeping in mind this implementation is constrained by closely following the structure and logic of the original. It's like writing C but being told exactly what state you have to maintain (and where), down to the bit, in advance. It really is a 'hardware simulator' where the spec and input handed to you is the sequence of memory states (and a few other bits) of the original machine.

Re:Show HN: Space Invaders in C by loadzero on Friday December 06, 2019 @03:24AM (#21720066)
Yes, I would say that those constraints are the main factor in not compacting the code further.

The C version also loses a few lines here and there for function prototypes and structured control flow.

Handwritten 8085 can be quite compact in some places due to sharing code fragments. It's a bit like self ROP.