Hacker News new | past | comments | ask | show | jobs | submit login

c4 is very cool, but it's not a compiler in the usual sense of the term. It compiles to a kind of bytecode which it then interprets (like Python, for example), but it doesn't generate assembly or machine code (like GCC or JIT compilers, for example).

But there's a more realistic compiler inside swieros: https://github.com/rswier/swieros/blob/master/root/bin/c.c that emits actual "binaries" for the emulated toy CPU. It's hard to tell what exactly is going on though, as this is not "very readable and simple code".




It's just a small step to generate machine code, this fork [1] can generate an executable, or run it JIT style, both on x86 (there's also the 'arm' branch)

[1] https://gitlab.com/pclouds/c4




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: