7 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 4y agocool UI design
- deleted 4y ago[deleted]
- Alexbades 4y ago
- rsfern 4y 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 4y ago[deleted]
- bmitc 4y 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 4y agoI've never heard of any of those.
- guyomes 4y 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 4y 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 4y agoRxPy and "Functional Reactive Programming" (Flow Based Programming) also seem related, albeit they are not visual tools.
- smrtinsert 4y agoNeato. I'm getting TouchDesigner vibes. I like the art browser.
- paulshen 4y 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 4y agonice tools!
- zestyping 4y agoThis is really slick! Wow!
- knubie 4y 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 4y 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 4y agoVery cool. What is the front-end built in?
- Helmut10001 4y 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 4y 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 4y 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 4y 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 4y agoAmazing! Do you have plans to make it srlf-hosted? I'd love to try it!
- pollier 4y 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 4y agoIt's pyodide so I imagine everything is happening in the browser...
- mritchie712 4y ago> Python execution happens in your browser as WASM via Pyodide
- beremaki 4y 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 4y 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 4y 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 4y agoHave you checked out "zooming" user interfaces? https://en.wikipedia.org/wiki/Zooming_user_interface https://en.wikipedia.org/wiki/Zooming_user_interface