5 ms·
Compiling to C is actually an advantage. It seems to me that for most people the aversion to it is mostly a feeling, with very little objective reason for it. H
by dom96 9y ago
Compiling to C is actually an advantage. It seems to me that for most people the aversion to it is mostly a feeling, with very little objective reason for it. Have you tried a language that compiles to C? If not then don't knock it before you try it.
If you have experiences that prove why its a disadvantage then please do share.
- qznc 9y agoI 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.