779 karma · joined October 17, 2014
For art browser, I assume you're referring to the JavaScript example https://natto.dev/example/f33b7f5924634fb687a90d85ed03f289
This is a tech demo of what a Python spatial notebook could look like. It's a stripped down version of natto (eg interactive outputs, multiplayer) so please check that out if this interests you!
https://gist.github.com/paulshen/b04db68c754f73e693cd29a481c...
`update` is similar to React's render function except here it's being called on every interaction (eg mousemove tick) and redrawing the entire screen from scratch! The code runs so fast that this is fine from a perf standpoint. Note that egui has a reactive or continuous mode. You can rerender everything from scratch 60fps (continuous mode) and it'd be fine in most cases.
Couple things I built with egui: https://artifacts.bypaulshen.com/rust-gui/code-render/ https://artifacts.bypaulshen.com/rust-gui/tictactoe/
Agree about undo/redo! on the todo list.
I've seen https://reactflow.dev/ but haven't used it myself. The core drag interaction is not much code but feel free to reach out on twitter. happy to share more!
Mousewheel should pan! You can hold down spacebar to pan anywhere (also dragging). Clicking the 100% in the toolbar lets you zoom. Some more shortcuts here https://twitter.com/_paulshen/status/1381744260945379331
Which example isn't working for you? and I plan to add more examples (maybe community?) and interactive tutorial in the future!
The expression is only transformed with Babel if you enable the JSX React transform. Otherwise, it's just straight eval-ed by your browser. It's by no means battle-tested (eg while (true)). I haven't tested circular deps and am leaving that as a surprise for myself in a little bit. One thing that I do is run the canvas in an iframe on a different domain for security reasons.
Parsing is something I'm trying to avoid as much as possible but it's likely I'll add it. Referencing things as inputs[2] doesn't feel stable. May help with implicit deps and avoiding wires (see observablehq.com)
As for mess of wires, I'm still forming my opinion! I want to learn more about nodes-and-wire programming and why it isn't mainstream. The hunch I'm getting is that visual programming feels better to create than consume. The space is great for exploration but looking at someone else's canvas can be chaotic. Maybe there are features that can alleviate this (multiple views, autolayout). Look at this haha https://twitter.com/_paulshen/status/1321872376234082305
I consider natto a much?-code approach in realm of no/low-code. Instead of building abstractions (no-code), what if we built new environments and UI for code? I'm spending most time building UI and trying to keep execution abstractions as minimal as possible.
I'm actively working on natto.dev and it really is in "preview". I'm excited about the future of programming and having a canvas to explore it on. still looking for "crazier" ideas - my favorite current one is dragging a column out of a table. https://twitter.com/_paulshen/status/1366801887341649924
The more I work on it, the more confident I am that there's something there. If you try it, I'd love to hear your feedback!
natto takes inspiration from a whole lot of work. non-exhaustive list: Yahoo Pipes, Excel, design tools (Figma), Observable, darklang, GToolkit, SmallTalk (repl-driven), http://joshuahhh.com/projects/pane/, http://www.lamdu.org/, https://futureofcoding.org/catalog/
As much as I love natto (the food), I'll likely rename it at some point. Pronunciation hit rate has been 0%
I built this as a small open-source Supabase demo and something I'd personally use.
If you're interested, I recommend checking out the tutorial https://natto.dev/tutorial to get a tour of the features. The "coolest" feature right now is the ability to drag a column header out of a table pane.
I get quite excited thinking about the "future of code" and think natto explores some ideas in that direction. I'm actively working on this (have lot of ideas) so stay tuned for updates. thanks!
Iteration 01 https://artifacts.bypaulshen.com/code-explorer/01/?snapshot=... implements exactly what you suggest with showing connections. Closing a pane will recursively close children. Also references are tied to the pane (point 4)
5. yes! I'm going through iterations of exploration but will consider these important points when/if productionizing.