Hacker News new | past | comments | ask | show | jobs | submit login

(Neptyne cofounder here)

That's probably something we should dig more into in the docs, yeah. Neptyne works like a ipython/Jupyter notebook in that everything is in scope all the time. So you can write your code in an imperative way (e.g. `B10 = some_value`) within a function, or you can do use a functional style.

We handle spreadsheet-style reactivity by building the dependency graph out of any cell addresses mentioned in the cell itself. So if you have `=my_func(A1)` in one cell, it will re-run when A1 changes. But if my_func reads from, say, B1, it will not automatically re-run when B1 changes.




> But if my_func reads from, say, B1, it will not automatically re-run when B1 changes.

Is that a conscious design decision, or a technical limitation? I would definitely have expected it to automatically rerun by default.


It's a conscious decision. The spreadsheet recalculates itself, the python code doesn't. Recalculations in the spreadsheet are determined by the graph (cell Q3 depends on cell D4 because it mentions it in it's formula like "=D4 * 3") If Q3 calls a python function ("=my_function()") and in that function D4 is mentioned we don't add it to the graph. It is already hard enough as is to see the dependency graph in a spreadsheet - adding implicit relations to it would make this almost impossible.


In Observable, a cell can define a function or return a value. When the value of a free variable within a function definition changes the function is redefined rather than the function being rerun. So there is a clear difference between points at which the function's bound variables come into play (function invocation) and the points when changes to the free variables have an effect (function definition). It's far from unmanageable in that "reactive notebook" setting. Maybe spreadsheets are the problem...

FWIW: https://www.nature.com/articles/d41586-021-01174-w




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: