ah. tbh, I'm not quite sure what nimscript does, so I probably misunderstood
something. thought it was simply running nim code using included vm (which also
happens to be used when compiling macros etc), and that limitations stem from
the vm being incomplete. The llvm equivalent of that would be to use the jit,
in which case there is no limitation that I know of - it should be possible to
both evaluate compile time stuff and run the result with lli/jit, and the full
language should be available. That's not implemented in nlvm though, it still
uses the internal vm during compile, but I see no reason why it wouldn't work -
maybe that's the next step, replace vm with llvm ;)
nlvm still cannot produce optimized binaries, so can't compare full optimized
bootstrap. Here's a sample though, all from my 8-core laptop:
compile nlvm, nim compiled with -d:release:
time nim c "-l:-lLLVM-3.9"
"--clibdir:/home/arnetheduck/src/llvm-3.9.0.src/rel/lib" "-l:-Xlinker
'-rpath=/home/arnetheduck/src/llvm-3.9.0.src/rel/lib'" nlvm
real 0m11.752s
user 0m31.495s
sys 0m6.248s
compile nlvm, nlvm compiled by nim with -d:release:
time nlvm -o:nlvm.self "-l:-lLLVM-3.9"
"--clibdir:/home/arnetheduck/src/llvm-3.9.0.src/rel/lib" "-l:-Xlinker
'-rpath=/home/arnetheduck/src/llvm-3.9.0.src/rel/lib'" c nlvm
real 0m8.830s
user 0m8.641s
sys 0m0.186s
compile nlvm, nim compiled _without_ -d:release
time nim c "-l:-lLLVM-3.9"
"--clibdir:/home/arnetheduck/src/llvm-3.9.0.src/rel/lib" "-l:-Xlinker
'-rpath=/home/arnetheduck/src/llvm-3.9.0.src/rel/lib'" nlvm
real 0m23.345s
user 0m42.476s
sys 0m5.932s
compile nlvm, nlvm compiled by nim _without_ -d:release
time nlvm -o:nlvm.self "-l:-lLLVM-3.9"
"--clibdir:/home/arnetheduck/src/llvm-3.9.0.src/rel/lib" "-l:-Xlinker
'-rpath=/home/arnetheduck/src/llvm-3.9.0.src/rel/lib'" c nlvm
real 0m22.924s
user 0m22.730s
sys 0m0.191s
compile nlvm, nlvm compiled by nlvm _without_ -d:release - I suspect the
difference here might be that nlvm always runs as --stackTrace:off and
--lineTrace:off (unsupported)
time ./nlvm.self -o:xxx "-l:-lLLVM-3.9"
"--clibdir:/home/arnetheduck/src/llvm-3.9.0.src/rel/lib" "-l:-Xlinker
'-rpath=/home/arnetheduck/src/llvm-3.9.0.src/rel/lib'" c nlvm
real 0m15.053s
user 0m14.879s
sys 0m0.171s
these numbers are all using the release version of llvm 3.9 (if you follow the
README instructions, you'll be using a debug LLVM which is much slower). for
nim, CC=gcc-6.x.