Readit News logoReadit News
paulshen · 5 years ago
Hi all! Developer here before first coffee

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%

angleofrepose · 5 years ago
This is a great project in a space that I've been playing around for a little while, fun to see it here!

I'm interested in hearing what you think are some of the more difficult problems or bugs you've come across during development. Did you hit any stumbling blocks around handling user code or integrating babel or the terminal? Do you have any insights about preventing errors or crashes in how you parse and eval user code? (My typical test of a while(true) loop crashes this system, but you're still in good company; it crashes replit, browser dev tools, observable and just about every other clientside execution tool I've come across. The most popular solution appears to be the loop timeout transformation.)

I think the examples pages do a better than usual job of demonstrating your system, in particular the ubiquity of one liners and your connections between them. Do you have ideas or responses about the classic "mess of wires" critique that graphical coding systems inevitably receive?

This is such a fun domain to think about, thanks for sharing your work!

paulshen · 5 years ago
The eval of natto maps surprisingly well to React's primitives (memoization, effects). This is pseudocode for the main eval https://gist.github.com/paulshen/9889b6067609f9053a0d56d4641...

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

ikurei · 5 years ago
Would you mind sharing other interesting examples of projects in this vein? Thanks!
onli · 5 years ago
The Yahoo Pipes inspiration is obvious I think - which is a good thing. How do you judge the changes between your service and it? As far as I can see, you picked the code heavy approach, while Pipes was more "here is a block that does X". Natto feels to me more like programming, with Pipes being more about composing fixed functions to manipulate data. Conscious choice? Worth the complexity? Do I judge that wrong?
paulshen · 5 years ago
Yes, very intentional! I'm taking a JavaScript-first approach. I know JavaScript, you probably know JavaScript, and the browser runs JavaScript. It's not the perfect language but here we are. It has lot of nice qualities!

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.

ChrisArchitect · 5 years ago
regarding the name, I got hung up on the description as a 'canvas' -- seems like leaves open to misinterpretation about what this is, opens confusion with html 'drawing' canvas etc. Suggest maybe utilizing something more about 'visual interface', visual programming playground etc

Was a big fan of Pipes back in the day, so good job / neat work otherwise!

fwip · 5 years ago
This is super cool :)

It seems a little tough to visualize "flow" at first glance - some optional animations might be handy? e.g: when data comes in, animate a little bubble moving along the path, or little conveyor-belt style animations. An undo/redo feature (or more complex version control) would also be appreciated, I deleted a node and couldn't find a clear way to restore it.

paulshen · 5 years ago
I've wondered what a factorio coding interface would look like.. would love to see it.

Agree about undo/redo! on the todo list.

toastercat · 5 years ago
Great work! Question -- I love the grid/layout system you have. I'm wondering if there is an open-source library that helped you enable this? I'd like to use something similar for a personal tool. :) Thank you.
paulshen · 5 years ago
Thanks! I'm using plain React. I have a React onMouseDown React listener that attaches mousemove/mouseup listeners on the window. I round the numbers to the grid.

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!

tluyben2 · 5 years ago
Very nicely done! Keep up the good work. Any chance you are making it open source? Fine if you are not , but at least consider doing that if (!) you ever get fed up with it (wish everyone would do that if legally possible).
bkyan · 5 years ago
I love how clean the interface feels! Are you using a 3rd party tool for the foldable JSON editor, or did you build it yourself?
paulshen · 5 years ago
thanks! It's something I built myself. A React component that branches on value type and recurses on collections (arrays and objects).
jp555 · 5 years ago
I'm a very visual thinker, and this is very cool!

Thank you very much for making it!

monkmartinez · 5 years ago
This is so cool! I am very excited to give it a proper go!
shepardrtc · 5 years ago
Very cool site! You should be proud!
Trufa · 5 years ago
This site's negativity/nit picking is sometimes incredible.

This is an incredibly cool product that is by their own words "very alpha" and people jump to "OMG i know what hijacking is so I'll point it out" for attention. It's kind of a tired trope. This is obviously not an intentional hacking of users but rather a quite harmless bug in the implementation of an undo/permalinking feature.

Great job to the devs and I hope I can find a utility for this product in the future, it's kind of a javascriptable excel concept, really cool.

mrtksn · 5 years ago
That’s probably a meme at this point, another post on the front page has the exact same complaint : https://news.ycombinator.com/item?id=26791997

Deleted Comment

wccrawford · 5 years ago
Warning people that they won't be able to get back to this site is not an overreaction.
arethuza · 5 years ago
It looks like an innocent bug and to get back to HN takes me two clicks rather than one, not really something I can get too excited about, particularly when it showing something new.
mcintyre1994 · 5 years ago
FWIW: In every desktop browser I've used and in Safari on iOS, long pressing the back button for a few seconds will bring up a list of recent history and allow you to get back when the button is hijacked by a page.
vanderZwan · 5 years ago
> they won't be able to get back to this site

I hate it when sites break the back button, but that's really not the same thing

FpUser · 5 years ago
Not to condone but I never rely on back button when using references in context of some longer material I am currently reading. I always right click and open in new window. So to me the problem mostly mute.
The_rationalist · 5 years ago
Not ideal but long clicking on the back button show history.
nkmnz · 5 years ago
I‘m sorry my comment raised these feelings. People share their projects on HN bc they want feedback. I think it’s a rude thing to hijack the back button and a lot of people seem to share that sentiment. Rude behavior can be unintentional and even well intended, but the perception to others is just not great. I would consider this valuable feedback - it’s better to get it here and fix the bug/misbehavior than keeping it even longer.
mrtksn · 5 years ago
Very cool. A few years back I was trying to build something similar, my intention was to create a canvas for visually programming cryptocurrency bots. I thought that it would be cool to be able to follow the data transformation visually, so I focused on rate limiting on the code execution and expressive animations on changes to the data so that a human can visually follow the data flow and transformations(when I switch to bullet mode, a delay is introduced between each data transformation and a visual feedback indicates what changed).

My prototype was not as neat and at some point I got convinced that it's actually easer to reason over algorithms when written in code and this visual style of programming works well as long as you deal with algorithms on very high level with no implementation detail considerations. When implementation details need to be part of the work, i.e. you need to think about how to fetch and transform a JSON file and match it with a CSV data it's actually easier to learn how to code and build your logic procedurally. Maybe people are not good at visually following large number of active objects and I think it's not only me because I'm sure that people get exponentially more confused with the addition of a new button or number to the scene.

When you don't have a simple enforced structure like "instructions execute from top to bottom" the visual freedom becomes yet another thing that you need to think. I find that the most visual processing tools that are helpful are spreadsheets, they have a good and simple structure to follow for storing and representing data and powerful features enabling calculations on that data. Google Docs also has data fetching functionality(not sure about Excel), making it a very interesting data processing software.

xcambar · 5 years ago
This is incredibly useful, a lot of my peers will certainly love it for quick prototyping data manipulation and exploration. I know I will.

This is a very clever/usable implementation of flow-based programming (FBP), which is dear to many people's heart in HN and out.

FBP matches very easily the mental model of data flow and calls for quick mouse- or touch-based manipulation. Coming up with a usable UX for such paradigm is not trivial though, and your project seems on a good track.

I can only encourage you to take the (harsh) criticism in this comments' section with the necessary distance, and keep working on the project, because it's very good! Well done!

dvaun · 5 years ago
Flow-based programming is also what came to mind when I explored the site.

For interested readers there is a decent article[0] and previous discussion[1] a few months back which discusses this topic.

[0]: https://jpaulm.github.io/fbp/index.html

[1]: https://news.ycombinator.com/item?id=25848542

danpeddle · 5 years ago
Very neat, and seconding impression of reminding of observable, but much more freeform. Here's a dumb little demo of appending some divs to a dom element, with random heights.

https://natto.dev/@dazld/7168773775bd401481366b7d62d14e8c

It's quite fun to think about the restrictions of this - getting an animation loop going, for example.

purplecats · 5 years ago
I'm surprised no one's mentioned Node.red yet, something this reminds me on and could see evolving as a competitor to.
mbar84 · 5 years ago
Request: Zoom with Ctrl+Scroll.

I imagine this might be quite useful to understand data-flow, but I worry that it would be tedious to manage the connections via positions during development.

It would be cool to have an auto-format/auto-layout: - data flowing left to right - draw pipes like yahoo pipes used to - minimize crossing pipes.

When in the programming loop, could the connections be established automatically via references? Name each output and then reference it somewhere else, which implicitly establishes the connection. Then click "auto-layout" (or just hit save) and as Steve would say "BOOM".

b1llyhoyle · 5 years ago
this is awesome, great job. by the way, i'm the creator of the API you're using for the nba example :)