Using the compiler API for hot code reloading

2023-11-09 Thread Gael
You can use the system module to capture the standard output and standard error streams when evaluating the script with evalScript. This way, you can check if there are any errors in the standard error output and handle them in your code. Here's an example of how you can modify your code to achi

Using the compiler API for hot code reloading

2020-08-21 Thread sekao
Thank you very much i'll give that a try. I was originally trying to make a change like that by forking the compiler -- i never thought of using `include` that way. Definitely a nicer way of doing it (albeit probably will be broken at some point). Very neat!

Using the compiler API for hot code reloading

2020-08-20 Thread dsrw
This is a hack, but it works for me on 1.2.6. If you `include` rather than `import` `nimeval`, you can access the `ModuleGraph` for the interpreter and register an error hook. This will be called for all sorts of things, but if you validate that `errorCount >= errorMax` you should be able to fil

Using the compiler API for hot code reloading

2020-08-17 Thread sekao
I've recently experimented with using the [compiler API](https://github.com/nim-lang/Nim/blob/devel/tests/compilerapi/tcompilerapi.nim) for hot code reloading. I know there is already an [hcr module](https://nim-lang.org/docs/hotcodereloading.html), but I think using the Nimscript interpreter c