Settings

Theme

Show HN: A Spatial Environment for Python

python.natto.dev

169 points by paulshen 4 years ago · 33 comments (32 loaded) · 1 min read

Reader

Hi all! A little background: I've been working on natto.dev, a spatial environment for JavaScript. I'm really excited about new interfaces for code (leveraging metaphors we're good at, spatial reasoning, making state visible, design tools, etc). With all the buzz around PyScript, I discovered Pyodide and got it working inside natto. This Python version is a stripped down version of https://natto.dev (eg interactive outputs, multiplayer) so please check that out if this interests you.

I'm excited to share this spatial environment for Python. Imagine Jupyter cells arranged on a 2D canvas.

Some key differences from traditional Python notebooks:

- By default, cells rerun whenever its code changes or an input reruns, like a spreadsheet!

- Dependencies are explicit. There is no parsing or global scope.

- Duplicate panes by option-dragging. This is a core interaction in design tools for exploring ideas.

- State panes add interactive elements. Check out this scikit demo https://python.natto.dev/example/de5cae3dfbcb43919981cc14203...

- Python execution happens in your browser as WASM via Pyodide (implementation detail, not design choice). This is currently a demo, not meant to replace your production ML notebooks.

I would love to hear your feedback on any of this and your thoughts on new programming interfaces!

rsfern 4 years ago

> By default, cells rerun whenever its code changes or an input reruns, like a spreadsheet!

This is transformational — I’ve been using Pluto.jl a lot lately for prototyping library code and doing data analysis. Now when I work in python I find myself really missing that reactivity. The closest thing I’ve found is streamlit, which is cool but not quite as liberating IMO

Can’t wait to try it!

  • bmitc 4 years ago

    >> By default, cells rerun whenever its code changes or an input reruns, like a spreadsheet!

    > This is transformational

    Just a note, but this has been around for forever in tools and languages like TouchDesigner, vvvv, Max, Pure Data, LabVIEW, with various permutations on the idea.

Helmut10001 4 years ago

Can you give a brief background what "spatial" means in this context? I do not see a map, or projections. Is it pure spatial-"math" (e.g. geometries) etc.?

  • chaz6 4 years ago

    That is what I thought too, but here it means a node-graph, nothing to do with GIS.

  • paulshenOP 4 years ago

    Sorry! I meant "spacial interface" referring to how panes are laid out on a 2D canvas.

pollier 4 years ago

Nice tool ! IMO a self hosted option is mandatory for product adoption as python is often used to process data, which might be confidential enough to prevent the use of SaaS tooling from a not "Well Known" service provider...

codethief 4 years ago

> - Dependencies are explicit. There is no parsing or global scope.

I can't express how happy it makes me to read this! So many "modern" tools these days come with global state and force you to do lots of implicit dependency juggling. This makes it hard to test things, to read code, to re-use code… It's as if we have to keep re-learning the same lessons again, and again, and again…

knubie 4 years ago

Love the concept and design language! I had been thinking about making something like this for clojure for some time, but never got around to it. In my head I was thinking you would be able to drag in functions from libraries / other namespaces into the canvas. I'm gonna have to play around with this.

  • paulshenOP 4 years ago

    I love that phrase "drag in X". It's closer to how we interact with objects in the real world. Coding should feel more like that!

beremaki 4 years ago

I love it, I am not sure yet what I am going to do with it but I definitely want to use it. I really love this kind of software and the execution focuses on the right spots.

This looks like the result of a lot of work, keep on !

timinou 4 years ago

A tangent: how hard would it be to integrate Elm into this? I think as a language it has a lot of teaching potential combined with natto.

One library that could be useful is elm-ta-interop maybe...

uniqueuid 4 years ago

This is awesome, and I'd use it immediately if I could install it on a machine of mine.

One interesting thing to pursue may be memoization for block output (perhaps with limited slots or TTL).

  • paulshenOP 4 years ago

    Thanks! I'm curious why you want to install it. All the Python runs in your browser and never leaves it. Do you want to use it offline? Or is it a matter of trust? (I understand!)

    • Martinussen 4 years ago

      Just speaking for myself, but if I can't fully self-host or run a service offline, the odds that it will be gone/I'll have to find a replacement after a (buyout|bus accident|burnout) really get in the way of embracing tools.

carapace 4 years ago

Have you checked out "zooming" user interfaces?

https://en.wikipedia.org/wiki/Zooming_user_interface

drapado 4 years ago

Amazing! Do you have plans to make it srlf-hosted? I'd love to try it!

smrtinsert 4 years ago

Neato. I'm getting TouchDesigner vibes. I like the art browser.

zestyping 4 years ago

This is really slick! Wow!

i_like_apis 4 years ago

Very cool.

What is the front-end built in?

ge96 4 years ago

cool UI design

colevels 4 years ago

nice tools!

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection