3 ms·
I have used tools like lexer or parser generators which generate C code. Debugging is a painful due to the indirection. Writing a LLVM backend is not harder th
by qznc 9y ago
I have used tools like lexer or parser generators which generate C code. Debugging is a painful due to the indirection.
Writing a LLVM backend is not harder than generating C code in the long run. The only advantage of the C code option is portability, so if you target some crazy microcontrollers C is fine.
- dom96 9y agoThere is more than just that advantage. By compiling to C you can easily take advantage of C++/Objective C features and allow easy wrapping of libraries written in those languages. FWIW I never had any issues debugging Nim (a language that compiles to C or C++ or Obj C)
- the_why_of_y 9y agoFor Vala, generating C is more appropriate than LLVM, because its whole point is to integrate with the GObject object system, and that is defined by C headers that contain lots of C preprocessor macro definitions.