Hi Doug! Most Jupyter kernels that I know of have a persistent namespace that is mutable - each new block of code is executed in that namespace and can mutate its state. In python this is something like exec(code, global_ns, local_ns).
I am looking for any examples where there is persistent state in the kernel, but that state isn't mutable. The simplest model is a single immutable namespace that is passed to each new block of code, similar to the redux pattern: run_code(old_state, code) -> new_state But other patterns of immutable state are possible such as reactive data flows. I am looking for any examples of immutable but persistent kernel state. On Sun, Oct 22, 2017 at 3:28 PM, Doug Blank <[email protected]> wrote: > On Sunday, October 22, 2017 at 3:23:03 PM UTC-4, ellisonbg wrote: >> >> Hi all, >> >> Does anyone know of any Jupyter kernels that have an immutable >> namespace that flows between blocks of code? I am looking at how pure >> functional languages implement persistent state in Jupyter kernels. > > > I'm not sure what you mean about "an immutable namespace that flows between > blocks of code", but our Calysto Processing kernel has each cell as its own > "sketch". Each cell is preprocessed by Processing, compiled by Java (to give > good error messages), and then rendered by Javascript. Here is an example > notebook: > > https://jupyter.brynmawr.edu/services/public/dblank/CS110%20Intro%20to%20Computing/2017-Fall/Notebooks/05-Movement.ipynb > > There is no persistent state between cells, but if I were to try to tackle > that, I'd probably do something like beakerX's "auto translate" and use JSON > as an intermediary form. > > -Doug > >> >> >> Cheers, >> >> Brian >> >> -- >> Brian E. Granger >> Associate Professor of Physics and Data Science >> Cal Poly State University, San Luis Obispo >> @ellisonbg on Twitter and GitHub >> [email protected] and [email protected] > > -- > You received this message because you are subscribed to the Google Groups > "Project Jupyter" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/jupyter/b2640b34-4791-4652-ad41-f09e7ccaaab5%40googlegroups.com. > For more options, visit https://groups.google.com/d/optout. -- Brian E. Granger Associate Professor of Physics and Data Science Cal Poly State University, San Luis Obispo @ellisonbg on Twitter and GitHub [email protected] and [email protected] -- You received this message because you are subscribed to the Google Groups "Project Jupyter" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/jupyter/CAH4pYpSWsWrru1go-OXCekt%2BgzssTHoefmcvns3%2BOakSv1JSkw%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
