4 ms·
Worth mentioning is NimScript, a subset of nim which can be interpreted, and embedded like lua: https://nim-lang.org/docs/nims.html https://nim-lang.org/docs/ni
by pbsds 6y ago
Worth mentioning is NimScript, a subset of nim which can be interpreted, and embedded like lua: https://nim-lang.org/docs/nims.html https://nim-lang.org/docs/nims.html
If for some reason the nim compiler starts becoming slow, then this could also drastically speed up development
- gw 6y agoYeah it really is a hidden gem. You can use it as a bash replacement, and with the new compiler API you can embed the entire interpreter in your program. My only complaint is that the interpreter aborts the process when the nimscript code has an error, so you can't really use it for hot code reloading right now. I hope they fix that eventually.
- ilaksh 6y agoThere is really no way to trap it? Maybe fork the NimScript stuff to give the option to try to hang around?
- gw 6y agoI did manage to fork it and prevent it from aborting, but i don't want to maintain it forever. I tracked it down to this function: https://github.com/nim-lang/Nim/blob/cd28fe2ef7a204721efa72082c9f65f8d13bcfb3/compiler/msgs.nim#L408-L421 https://github.com/nim-lang/Nim/blob/cd28fe2ef7a204721efa720... It's calling `quit` which cannot be caught in a try statement.