3 ms·
> Writing a compiler is not too difficult. Wait till you're faced with the endless .h files with their inevitable use of nutburger undocumented C extensions.
by WalterBright 3y ago
> Writing a compiler is not too difficult.
Wait till you're faced with the endless .h files with their inevitable use of nutburger undocumented C extensions.
- habibur 3y agoDon't write a compiler for C. Write compilers that convert your sources to C. You create the header files.
- Apocryphon 3y agoWorks for Swift!
- WalterBright 3y agoD's ImportC compiler can convert C code to D!
- FeepingCreature 3y agoHere's a secret trick to parsing C headers: whenever you hit an error, discard the line and restart parsing. If you have a fallback explicit FFI, most ~mystery extensions~ can be done without.