wheineman/nrpl

Persist computed values

andreaferretti opened this issue · 2 comments

This is a big one. I think that the approach of developing a REPL by recompiling everything from scratch is fine for small testing purposes, but the real issue with this is of course avoiding to repeat expensive computations or I/O.

I would think that this is in general impossible, short of having an actual interpreter, but this link seems to imply that this is doable by tweaking the C codegen. Note that this requires to invoke the Nim compiler as a library instead of calling it as a separate process.

I know this is a big task, much more so than the other issues I have opened, but I think it ought to be mentioned anyway ;-)

First off, thank you for taking the time to evaluate and comment on nrpl. It was my first Nim program. I am aware that it isn't a real REPL in that state is not preserved between execution, hence the "Rudimentary" description. I was looking for something I could use to evaluate simple Nim expressions and modules so that I could quickly experiment with language and get up to speed with it's primary paradigms without worrying about editing and compilation. I think it succeeds at that goal. For instance, someone can use nrpl to walk through most of "NIm by example" like I did. My next goal is to use it to implement a backend to Jupyter (or iPython) similar to the IJulia backend. After that I'll come back to the main problem of making it a fully functional REPL and your link will be extremely useful. Many thanks.

It would be great to have support for Jupyter! In fact it was one of the reasons I got interested in nrpl. Nice to know that it is in your plans! :-)