RE: Complicated AST manipulation looks ugly in C++. How to refactor it?
January 27, 2022 at 9:24 pm
(January 27, 2022 at 5:29 pm)HappySkeptic Wrote:(January 27, 2022 at 2:16 pm)Jehanne Wrote: Isn't that the whole point of a compiler, to translate computer code into machine code? I would ditch the C++ and just use C, modeling your new language on an existing one. C#, after all, "borrowed" heavily from Java.
Anyone writing complex code in C is crazy or a masochist. C++ at least has the standard template library (even if it is a pain to learn).
Using C++ allows Flat to potentially compile his compiler into any platform, including webassembly. Yes, that can be done with other languages, but it isn't easy with garbage-collected languages.
I've written hundreds of thousands of lines of complex code in C.
Am I crazy, or did I just not have better tools?