34 kLOC instead of 7, and no fancy VM/kernel stuff, but it does full C99.
34 kLOC instead of 7, and no fancy VM/kernel stuff, but it does full C99.
https://github.com/rswier/c4/blob/master/c4.c
c4 is what you might call a microscopic C compiler; it's surprising how much it does for the code it has.
Sadly, the Opengroup and Linux man pages say that
> Memory access within the mapping but beyond the current end of the underlying objects may result in SIGBUS signals being sent to the process.
I might do a write-up if I do. I did code a problem or two afterward. Reusing principles from high-assurance systems and security helped. Keep design, language, & implementation simple. Straightforward control flow with no looping between layers. Safe language. Straight-forward toolchain. I ended up doing those problems in a subset of FreeBASIC since I was up and running so fast w/ no fighting with IDE's, etc. Solutions came out correct in first implementation due to design principles & refactoring specs on paper. Coding phase simply didn't have much room for added error.