Our server costs ~$56 per month to run. Please consider donating or becoming a Patron to help keep the site running. Help us gain new members by following us on Twitter and liking our page on Facebook!
Current time: June 9, 2024, 2:12 pm

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Complicated AST manipulation looks ugly in C++. How to refactor it?
#16
RE: Complicated AST manipulation looks ugly in C++. How to refactor it?
(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?
Reply



Messages In This Thread
RE: Complicated AST manipulation looks ugly in C++. How to refactor it? - by Jackalope - January 27, 2022 at 9:24 pm



Users browsing this thread: 1 Guest(s)