Interactive Code Cells
antonz.org
antonz.org
They're reactive cells too, so if you modify an variable or function, subsequent cells will automatically update. Something that Jupyter lacks currently.
[1] - https://plutojl.org/
Our users use marimo to do traditional notebook work faster and with more confidence (computational experiments, data exploration), and also to build pipelines and apps: marimo notebooks can be run as Python scripts and seamlessly converted to apps.
We've designed marimo with devX in mind (pure Python file format, git-friendly, black formatting built-in, GitHub Copilot built-in, modularity coming soon ...).
[1] - https://github.com/marimo-team/marimo
[2] - https://docs.marimo.io/
It could double as REPL and you can reach into any part of the compiler pipeline and write your own transformations.
Does anybody remember the documentation for Backbone? The "annotated source" documentation was side by side the code, it was really helpful.
https://backbonejs.org/docs/backbone.html (This is the annotated source) Imagine if it was "alive"?
I have practically no exposure to Bazel and Buck but these advanced build systems have advanced refresh logic which is feels it is an advanced caching.
These systems and Makefiles essentially do refresh logic/regeneration from changed sources. Maybe it could be like Greenspun's 10th rule, every system eventually builds its own caching system and refresh logic and dirty-rechecking. (See React's virtual DOM)
[1]: https://en.wikipedia.org/wiki/Greenspun%27s_tenth_rule
There's also crossovers with Knuth's literate programming here. And spreadsheets.
As for the documentation purposes it should be the programmers/authors' duty to ensure that the code works out by executing all cells in order once.
Observable does a similar thing, but in the browser, so the cells run JavaScript. I suppose a WASM implementation could provide more languages?
Or it might be better done using a VS Code plugin or something like that. (Thry already exist.) But that means casual readers won’t be able to play with it.
If no state is cached and running a cell automatically reruns all its dependencies from scratch, that's the equivalent of a clean rebuild when using a makefile. It might be too slow to use interactively if you're doing anything heavy. It's how continuous builds work, though.
Another similar project is Runno which runs client-side in the browser [3].
The difference/compliment here is that after you finish writing these cells, i think there's a translation into a backend service for execution at scale.
I'd love someone to pick this up and run with it in collaboration with tools like this!
I'd rather have a flavor of notebooks that work by referencing other notebooks comprising human- and machine-readable specifications that describe those other languages' syntax and semantics and how their execution models work. Look at the way IETF RFCs are crosslinked, for example. With your browser pointed at one of these documents, it traverses all the linked documents and resolves a given cell's results based its working knowledge of the language in that cell. (If you really want to, you can point your server to the same corpus and have it cache some of the processing in order to relieve pressure re compute requirements for the browser, but in principle it should work the same way.)
Rank the employees according to their salaries in each department
My SQL is “good” I think, but to be honest in my day to day I usually don’t deal with aggregation nor windowed queries (my BI colleagues are masters are those, though )[1] - https://livebook.dev
Would this tool work as a general purpose documentation generator for a Postgres extension?
[1] https://michelp.github.io/pgsodium/Public_Key_Cryptography.h...
Losing syntax highlighting on edit is rough. That's when I want it most.
There is also an "external" mode where you can use a full-featured editor with syntax highlighting, etc. For example:
I didn't mind so much losing the highlighting upon entering edit mode, but I did mind losing it forever, i.e. not having it even after leaving edit mode. Perhaps if there was a way to re-apply the syntax highlighting once the editable element loses focus, then losing syntax highlighting temporarily when actively editing wouldn't be as much of a problem?
> The last thing I want as a reader is code examples that fail or behave oddly because they were run out of order. Or because I didn't run some cells. Or because I changed a cell and didn't re-run it.
> Codapi code cells, unlike Jupyter's, have no hidden state. Instead, they execute the whole chain of dependencies as needed to ensure that the reader gets a consistent result.
this is something i'm exploring today with: https://nux.ai/
which has a similar experience (run code within the browser)
> does it memoize dependencies?
Not sure what do you mean by memoization here, but there is no stored state at all (see the original post for the reasoning behind this).
> if i have several cells that all depend on a central one, will the central one only run once?
Sure!
> can you declare a variable in one cell then use it in another?
You can, as long as it's in global scope.