I see. Thanks for the explanation. I don't have an example of that type of implementation, but it does suggest how we could take a kernel like I described (compiled Java cells) and create a kernel that has the appearance of mutable global namespace (by chaining a global state) at least for well-known data types that could be relayed and recreated from cell to cell.
-Doug On Sunday, October 22, 2017 at 6:39:42 PM UTC-4, ellisonbg wrote: > > 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] > <javascript:>> 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] <javascript:>. > > To post to this group, send email to [email protected] > <javascript:>. > > 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] <javascript:> and [email protected] <javascript:> > -- 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/8f8c3a3e-b732-4169-9d33-d5e9b577d0bc%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
