Are there other similar projects that you're familiar with? Perhaps targeting other languages?
What are the major problems with this approach to programming? Are large programs hard to work with?
Erlang-RED has been my project for the last couple of months and I would love to get some feedback from the HN community.
The idea is to take advantage of Erlangs message passing and low overhead processes to have true concurrency in Node-RED flows. Plus also to bring low-code visual flow-based programming to Erlang.
Are there other similar projects that you're familiar with? Perhaps targeting other languages?
What are the major problems with this approach to programming? Are large programs hard to work with?
Main problems with visual flow based programming is the tooling: there aren't any good tools for doing visual comparison nor visual version control. Things like GitHub aren't able to render flow code as seen in the editor.
For Node-RED that means that the Json that defines a flow can be compared but that soon becomes meaningless because semantic changes get mixed with visual changes, i.e., that the x,y coordinates of a node have changed - is meaningless for the logic of the code.
This means that code sharing and collaborative development is difficult purely visually but only because tooling is missing. Compared to textual programming before things like SourceForge or Git and we had the same issues as we do with visual coding now.
Node-RED has a bunch of features to make large programs maintainable. Things like link nodes that allow jumping between flows also allow code reuse. There also subflows which encapsulate repeated code and can be referenced from anywhere.
That's also why I chose Node-RED for this because it seems to be the most mature and best maintained low-code visual flow-based programming tool. There are others such as n8n (which seems to be the other biggie) but they lack the generalness of Node-RED. I can create web sites with Node-RED while and the same time controlling my LEDs via Raspberry installation. Node-RED is extremely flexible.
Visual scripting can be highly productive. The major issue is these visual scripts usually do not map cleanly back to text so you're throwing away decades of tooling. They usually don't merge well either.
I modified a python hosted lisp interpreter to read JSON flavored lisp - JLISP. It's much easier to get a web frontend to output JSON then lisp. Then I made a simple Low Code UI built around this language. The editor has operations (invocations of lisp functions) organized left to right like a timeline in CAD software, then you can click on an individual operation to edit the arguments.
Here is a video walking through the system https://youtu.be/3Tf3lnuZcj8
Live edittable notebook (slow to load, runs python in WASM) https://marimo.io/p/@paddy-mullen/jlisp-in-buckaroo
I'll make a statically exported Jupyter notebook shortly
How stable are node and edge IDs and their ordering? Could you sort the JSON before saving so the output is more stable and diff-able?
Another thought is, how would you code up a flow like this in your preferred language if you were just writing code in that language (you didn't care about the visual editting). Call most of the same functions, but do it directly. Ok, think about that, then write a transformation from the NODE language to output source in your preferred language.
I have some sense that coding this type of control flow logic doesn't work well with text line based diffs because of the complexity of the problem, less the syntax.
HomeAssistant build on Python have an Node-Red extension, would be nice to see a Python version with more seamless integration
The people who use Node-RED aren't the same that can develop those kinds of solutions. Those that can port Node-RED to Python don't need to use a low-code visual environment.
It isn't like Emacs users: Emacs user can also extend Emacs and probably even fix a bug in the lisp code of Emacs. Node-RED users use Node-RED becausae they don't want to program nor learn to program nor understand how Node-RED works.
Hence my attempt to take the whole concept and bring to a collection of developers who might appreciate visual FBP but who could also code extensions to the editor.
My goal is to bring visual FBP to a broader audience, be that developers or non-developers, be that Erlang coders or NodeJS coders, no matter - the ideas of FBP are important to understand, especially in our data-driven digital world.
> With AtomVM, you can write your IoT applications in a functional programming language, using a modern actor-based concurrency model, making them vastly easier to write and understand!
> It also supports WiFi networking on devices that support it, such as the Espressif ESP32. All of this on a device that can cost as little as $2!
If ErlangRED made it to a $2 chip, I'd be very happy!
Jsons are definitely diff-able but it's the difference between a change that changes the logic of the flow or a change that is purely visual and has no affect on the logic of the flow that is hard to distinguish by just diffing the JSONs.
Remember the Json contains location of nodes and labels of nodes as well as logic of nodes - if a label of a node changes it doesn't affect the flow logic or how it works.
So if the value of an 'x' changed, that means the node moved along the x-axis. Did the value of 'func' (function value for a function node) change, then that is a logically change. Now what change is important if you only looking at the JSON. So you need to remember that 'x' and 'y' are visual, 'func', 'tmpl', 'rules' are logical. And what is important for each node isn't the same across all possible nodes ...
> this type of control flow logic doesn't work well with text line
Exactly that's why places like GitHub would need a lot work to support visual coding in proper way. Diffs would have to become like image comparisons that line-by-line diffs.
And that is partly why visual coding has taken off - the tooling isn't available.
https://scriptsofanotherdimension.tumblr.com/
https://blueprintsfromhell.tumblr.com/
and the biggest problem is that a strong bound is screen/display size --- any code chunk which won't fit on a single screen becomes hard to follow (which direction does one scroll next?) and if one does the obvious of declaring modules, then one runs into the wall of text which one was presumably trying to escape from --- just each word is wrapped up in pretty boxes and decorated with lines.
My take on this has always been that we don't have an answer for the question:
>What does an algorithm look like?
That said, I work in this style when I can, often using:
https://www.blockscad3d.com/editor/
to rough out a design, or:
https://github.com/derkork/openscad-graph-editor
for more complex projects --- though that latter usually with a special-purpose library I've been working on: https://github.com/WillAdams/gcodepreview
This recent talk, https://www.elixirconf.eu/keynotes/the-atomvm-and-new-horizo..., probably showcases the process to some extent so it's a good idea to keep an eye on their YouTube channel for a recording.
I created a visual comparison that combines both visual and semantic textual changes for NodeRED[1]. For me that is the only solution: visually comparing visual code.
[1] https://flows.nodered.org/node/@gregoriusrippenstein/node-re...