2 ms·
Well there's major drawback here: > nlvm does not: - understand C - as a consequence, header, emit and similar pragmas will not work - neither will the fa
by gavinray 5y ago
Well there's major drawback here:
> nlvm does not:
- understand C - as a consequence, header, emit and similar pragmas will not work - neither will the fancy importcpp/C++ features
- support all nim compiler flags and features - do file bugs for anything useful that's missing
One of the unique and best things about Nim (IMO) beyond being multi-target, is that you can do things like say "emit this exact C/C++ string", or "import this type from an existing header".
With this LLVM backend, that doesn't work, and it doesn't support JS (which probably isn't a big deal to most people).
That means you can't do stuff like this:
type
VectorIterator {.importcpp: "std::vector<'0>::iterator".} [T] = object
# std::vector<int>::iterator x;
var x: VectorIterator[cint]
https://nim-lang.org/docs/manual.html#implementation-specific-pragmas-emit-pragma https://nim-lang.org/docs/manual.html#implementation-specifi...
https://nim-lang.org/docs/manual.html#foreign-function-interface-importc-pragma https://nim-lang.org/docs/manual.html#foreign-function-inter...
https://nim-lang.org/docs/manual.html#implementation-specific-pragmas-importcpp-pragma https://nim-lang.org/docs/manual.html#implementation-specifi...