4 ms·
I've heard portability arguments; C is far more portable than LLVM. But I'm guessing more people know C than LLVM IR or 4 assembly languages, so C is an easier
by camgunz 11y ago
I've heard portability arguments; C is far more portable than LLVM. But I'm guessing more people know C than LLVM IR or 4 assembly languages, so C is an easier target.
EDIT: oh, also wildly easy interoperability with existing C/C++ code (so long as the C++ code provides a C interface).
- dom96 11y agoCompiling down to C also makes wrapping C++ libraries much easier. Because when you compile down to C, it's not that much of a stretch to also allow compilation to C++. You can then make wrapping C++ code much easier in the language. Nim is one language that I know of which takes advantage of that. Here is one example of a pretty large wrapper around a C++ library https://github.com/3dicc/Urhonimo https://github.com/3dicc/Urhonimo, and here is the documentation for this feature http://nim-lang.org/docs/manual.html#implementation-specific-pragmas-importcpp-pragma http://nim-lang.org/docs/manual.html#implementation-specific...