3 ms·
Compiling 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
by dom96 11y ago
Compiling 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...