Re:A minimal C compiler in x86 assembly
by mypalmike on Tuesday May 03, 2022 @01:19AM
(#31244930)
That an inexperienced C programmer wrote what appears to be 5000 lines of assembly in 24 hours implementing a fully working C compiler seems... a rather extraordinary claim. The file size of around 130K would indicate typing non-stop for 24 hours at something like 100 characters per minute.
[ Parent
| on HN ]
> typing non-stop for 24 hours at something like 100 characters per minute
Not only that. It would be typing at that speed without testing anything. In assembly. Haha. In reality what would happen is that you would type 24 hours (not in one day, I assume) and then spend the next days finding the places where you wrote R5 instead of R4.
And, of course, without losing any time on refactoring already written code (changing order of parameters, finding a better name for a function, etc.)
Inexperienced C programmer probably doesn't mean inexperienced ASM programmer in this particular case.
People normally touch-type between 300 and 800 characters per minute (50–130 wpm), so even if all of that was typed by hand we're only talking about five hours or so of typing, but you've forgotten about copy and paste.
Maybe GitHub Copilot is that good already.
I think they are talking about the later stages of boot strapping 'stage2' where they are writing a more functional, but still small, C compiler in a C subset that can be compiled by this one