dump state/ share a session
It would be great if you could dump state to share or just save a session
I recognize the problem that state vs notebook might get out of sync. It matters how much this matters but there are ways to mitigate them.
2 Replies
not all state is serializable. but you can use
query_params
to control some of it. and then itll update your URL and you can share that URLI think query params are a good idea for Marimo ui.state, but not for variables and what not
Many things can be pickle-able
"state-dumped" cells could be ro (like the static export).
Observable has kinda gone into this hybrid mode with their data loaders routing. The difference being "state" is manually exported to a file for the reactive part: https://observablehq.com/framework/loaders#routing
Practical case: I was building out a pipeline to train my Jax model.
Had to restart my computer, the next time I opened the notebook, it started running the pipeline again
Since Marimo is reactive, it should have guarantees if the code is deterministic, and getting back to my notebook could have been as easy as loading a file, and behind the scenes making sure the cell contents match what they were at export
Primary sources of indeterminism that would make a loaded state inconsistent are internet, file content, time and "random"- but marimo doesn't have these state guarantees as is.
Aside: Nix partially solves this by requiring every disk file read or web request has a prehashed expectation so that state is guaranteed - but that's a little much