6 ms·
Show HN: A Spatial Environment for Python
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 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/de5cae3dfbcb43919981cc1420309756 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!
- ge96 5y agocool UI design
- deleted 5y ago[deleted]
- Alexbades 5y ago
- rsfern 5y 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!
- deleted 5y ago[deleted]
- bmitc 5y 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.
- snthpy 5y agoI've never heard of any of those.
- guyomes 5y agoThe excellent Live Coding in Python plugin [0] also comes to mind. The space tracer [1] in particular is handy for debugging. [0]: http://donkirkby.github.io/live-py-plugin/ http://donkirkby.github.io/live-py-plugin/ [1]: http://donkirkby.github.io/live-py-plugin/starting_space_tracer.html http://donkirkby.github.io/live-py-plugin/starting_space_tra...
- rsfern 5y agoCool, thanks for the references! LabVIEW is the only one I’d heard of I didn’t mean to imply that there’s no prior art (observable also comes to mind), but I’ve just gotten so frustrated lately with how easy it is to make an unsustainable mess in jupyter. Factoring code into modules and auto loading those helps, but it’s still easy to get in trouble with implicit state
- flor1s 5y agoRxPy and "Functional Reactive Programming" (Flow Based Programming) also seem related, albeit they are not visual tools.
- smrtinsert 5y agoNeato. I'm getting TouchDesigner vibes. I like the art browser.
- paulshen 5y agoThanks! Visual programming tools are a big inspiration. For art browser, I assume you're referring to the JavaScript example https://natto.dev/example/f33b7f5924634fb687a90d85ed03f289 https://natto.dev/example/f33b7f5924634fb687a90d85ed03f289
- colevels 5y agonice tools!
- zestyping 5y agoThis is really slick! Wow!
- knubie 5y agoLove 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.
- paulshen 5y agoI 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!
- i_like_apis 5y agoVery cool. What is the front-end built in?
- Helmut10001 5y agoCan 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.?
- uniqueuid 5y agoThis 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).
- paulshen 5y agoThanks! 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 5y agoJust 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.
- drapado 5y agoAmazing! Do you have plans to make it srlf-hosted? I'd love to try it!
- pollier 5y agoNice 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...
- joshgree88888 5y agoIt's pyodide so I imagine everything is happening in the browser...
- mritchie712 5y ago> Python execution happens in your browser as WASM via Pyodide
- beremaki 5y agoI 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 5y agoA 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...
- codethief 5y 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…
- carapace 5y agoHave you checked out "zooming" user interfaces? https://en.wikipedia.org/wiki/Zooming_user_interface https://en.wikipedia.org/wiki/Zooming_user_interface