Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Worth mentioning is NimScript, a subset of nim which can be interpreted, and embedded like lua: 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



Yeah 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.


There is really no way to trap it? Maybe fork the NimScript stuff to give the option to try to hang around?


I 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/cd28fe2ef7a204721efa720...

It's calling `quit` which cannot be caught in a try statement.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: