3 ms·
Yes, read this https://github.com/oriansj/M2-Planet https://github.com/oriansj/M2-Planet and you will know how a cross platform self-hosting C compiler works
by z29LiTp5qUC30n 7y ago
Yes, read this https://github.com/oriansj/M2-Planet https://github.com/oriansj/M2-Planet
and you will know how a cross platform self-hosting C compiler works in 1,982 lines of code
and if you want to know how an assembler works read this: https://github.com/oriansj/mescc-tools/ https://github.com/oriansj/mescc-tools/
only about 562 lines for the linker, 645 for the macro assembler and 204 lines if you want dwarf stubs in your binaries. Oh and it is cross platform too
- markjenkinswpg 7y agoI'm a fan of this. But, note "The PLAtform NEutral Transpiler"..."allows one to compile a subset of the C language". Subset of C not being C.