3 ms·
I'm currently trying to make a programming language that translates to C. I've started with a pseudo BNF parser. I started reading the C BNF and I have to admi
by jokoon 4y ago
I'm currently trying to make a programming language that translates to C. I've started with a pseudo BNF parser.
I started reading the C BNF and I have to admit that I was not prepared at all. It's not as easy as it sounds.
I cannot imagine how difficult it must be to maintain a modern C++ compiler.
- lionkor 4y agoYeah, good luck hahaha There is a reason why modern languages use keywords like "func", "def", "fn", "var", "let" to discern between different types of declarations, for example. I dont think many languages are LL(k) (please correct me if im wrong), but C is as far away from that as it gets, for small k.
- Gibbon1 4y agoI've thought it would be nice to add func to the language. Even if it's just sugar it would help. Type inference + allowing functions to return an anonymous struct or a tuple would be super.