Show HN: Visual flow-based programming for Erlang, inspired by Node-RED
88 comments
·May 16, 2025mystraline
I was an early adopter of NodeRed. Earlier, it worked exceptionally well.
Now? Not so much.
Well, that's not exactly true. Base NodeRed works as well as before. But the libraries of modules to interface with all sorts of websites, APIs, hardware, and other stuff is rotten to the core.
Most plugins/js modules either just don't work, or 'successfully fail'. The easier fail case is where the module can't be installed due to ancient (6mo or older JS, sigh) modules.
I abandoned NR because its basically a hyper-speed bitrot due to terrible library module versioning. And I didn't want to reinvent the wheel on every system I wanted to touch.
Towaway69
I wrote an article about this[1] and you are definitely right: a lot of packages are rotting away a bit however, because NodeRED does a lot to stay backward compatible, older packages still work. The oldest ones I'm actively using are five or more years old, i.e., haven't been touched nor updated - still work.
What I tried to say in the article is the same as you say: base NodeRED, the core works really well and has great features - no questions. And even if packages die, the core will still remain usable and that makes a difference.
Its a bit like saying Linux is a pile of broken bits because the ls command has been updated in ten years: Linux will always work and those commands that are based on the core will continue to work becausae the Linux kernel will largely remain backward compatible. Packages fail when they have external dependencies that change but code that is solely based on the core will continue to work.
01100011
Not surprising. Whenever you have a project like NR or HA you have a ton of barely working glue code written by people who just want to get it working and move on without any sort of commitment to maintenance. It allows these projects to rapidly expand their support but then that support quickly rots unless the core team assumes responsibility for maintenance. I really want to mess with home automation again but this sort of low software quality and resulting instability and maintenance hassles makes it not worth the effort.
wslh
I don't think this is easily to solve, in general. Similar orchestrators (e.g. n8n) have the same issues because there are a lot of components dependencies that change with time and there is no real cohesion between the core and all kind of plugins. Probably a future "contracts/manifests" linking orchestrators with components could help.
pjmlp
I am a big fan of visual programming, and also think visual and digital circuit design tools overlap quite nicely with functional programming languages.
The mess most people complain about in visual languages, also happens on text ones, the biggest difference is that visual ones make it quite clear the code lacks modularity.
Get to package stuff into reusable ICs more often.
All the best for the project.
Towaway69
> visual ones make it quite clear the code lacks modularity.
NodeRED has the concept of subflows to encapsulate reusable code. There are a number of features that NodeRED has that make it more usable for long term projects but it's a steep learning curve.
I've been using Node-RED everyday for the last three years to find the edge, something that cannot be done but there has always been a visual solution. I'm starting to think Node-RED might be turing complete ;)
But I have to admit, I did build a lot of tooling around NodeRED to make that happen - visual flow comparison[1] was something that was missing, introspection of message flow[2] and visual code management[3] - all these things I need to maintain an overview of what I am doing.
[1] https://flows.nodered.org/node/@gregoriusrippenstein/node-re... [2] https://flows.nodered.org/node/@gregoriusrippenstein/node-re... [3] https://flowhub.org/
> All the best for the project.
Thank you!
tlodboy
Visual programming helps automate flows in circuit design and I feel adoption would be higher as well since most circuit designers for some reason prefer GUI
Arch-TK
I saw Node-RED recently, and now this. While I think these are cool (and I would rather Erlang than NodeJS), is there some code based system for these kinds of things?
I know I can just write code, but I mean a DSL or some library specifically oriented around solving exactly these kinds of event driven sequencing/action problems.
Towaway69
Not to my knowledge, the closest thing to a DSL for Node-RED is its flows.json format for storing flow configurations.
It's a very simple array-of-object format with the graph/flow definitions defined by node ids and wires. It is fairly simple to create a minimalist interpretor for that format.
Also NodeRED is a very stable piece of software that has been around for over ten years. Yet I can take a flows.json file from today and have it run on the first releases of Node-RED, i.e., the format is backward compatible yet easily extendable.
> event driven sequencing/action problems.
Flow based programming[1] isn't strictly event driven, it's implemented that way in NodeJS because NodeJS does not have the concept of messages, only events.
Erlang has message passing between independent processes and therefore, IMHO, better suited to FBP.
Arch-TK
Firstly, thanks for the link and information on more of the roots of this kind of programming, I couldn't find this when I looked.
Regarding NodeRED. I don't dispute that it's stable, but my experience actually running any nodejs based software is that it's all heavily designed for running out of a container and a massive PITA to maintain otherwise. I already have enough hassle running zigbee2mqtt on my FreeBSD home server which wouldn't work in a linux jail because I couldn't figure out how to expose the zigbee dongle to it.
Secondly, the reason I wanted to run one of these was not because I wanted to use it to automate my house, but instead because I wanted to understand how it works so I could replicate it in my own weird way.
NortySpock
I suggest one of Benthos' descendants, either Bento or RedPanda Connect.
Configuration driven, with a transformation DSL, and good documentation (I prefer the Bento documentation over RedPanda Connect's documentation). And Benthos explicitly refused to ack a consumed message upstream unless it had been acknowledged downstream, so it wouldn't drop messages on the floor unless you explicitly told it to.
oersted
> Node-RED is a amazing[*] tool for creating flows that describe concurrent processing, it is just a shame the NodeJS is single threaded. So why not use something that is multi-process from the ground up?
That's great! But now that we are doing this, it kind of makes me wish that it was not multi-processing and Erlang, but a more mainstream language with a better library ecosystem and focused on multi-threading instead, Rust comes to mind but there could be a better one.
Is there a visual flow programming language based on Rust that is relatively mature?
Towaway69
> wish that it was not multi-processing and Erlang
Hehe - honestly I chose Erlang because I love the syntax and secondly because it is so niche. Flow based programming is niche, visual FBP is nicher, Node-RED is even nicher and Erlang is niche - it's niche all the way down ;)
Have a look at Elixir which is Erlang with Ruby syntax and also has a large community.
Also the intention is to be using the flow editor and not the lanuage underneath, so the end user won't even know that it's Erlang or NodeJS - I aim t stay compatible with Node-RED so that flows are actually interchangeable.
So to an certain extent it doesn't matter which language is used.
I did chose Erlang also because it is well suited to flow based programming being message based and flow based programming is all about passing immutable objects amongst independent processes .... that's Erlang in a nutshell.
rdtsc
> makes me wish that it was not multi-processing and Erlang, but a more mainstream language with a better library ecosystem and focused on multi-threading instead, Rust comes to mind but there could be a better one.
I am not quite following, why would we drop multi-processing with isolated tiny heaps with a few KBs each and move to multi-threading with a large multi-megabyte stacks per thread and all sharing and writing to the same heap? It seems like a step backward.
> Rust comes to mind but there could be a better one.
I can see the excitement, but at the same time this is becoming a meme. I mean the drive-by comments of "why don't your rewrite it in Rust" on every repo or "show HN" post. It's kind of like nodejs from years past: "why don't your write in nodejs, it's webscale!". The problem is, after a while it starts to have an inverse dose response: it makes people run away from Rust just based on that kind of stuff.
SigmundA
>I am not quite following, why would we drop multi-processing with isolated tiny heaps with a few KBs each and move to multi-threading with a large multi-megabyte stacks per thread and all sharing and writing to the same heap? It seems like a step backward.
Performance typically, hard to work in parallel on large amount of data performantly without multiple thread sharing a heap and you typically don't need large amount of threads because you don't actually have that many real cores to run them on.
Lots of little share nothing process are great conceptually but that does create significant overhead.
bheadmaster
> it kind of makes me wish that it was not multi-processing and Erlang, but a more mainstream language with a better library ecosystem and focused on multi-threading instead, Rust comes to mind but there could be a better one
Go sounds like a good candidate.
notpushkin
Note that this uses (I hope!) Erlang processes, which are not to be confused with OS processes.
macintux
Yep. I researched JVM and .NET thread sizes once, to compare/contrast with Erlang processes, and the difference is ludicrous.
Erlang: ~1k
64-bit .NET thread: 4MB
SigmundA
.Net uses real OS threads and that 4mb is the stack not the heap which must be allocated on thread creation. The heap is shared in the process amongst all the threads whereas Erlang is separate lightweight green thread/processes with dynamic heap and stack per process.
.Net originates in the Windows world where new processes are expensive but threads are much cheaper however they still use native stacks for iterop and hardware protection, stack must be contiguous so it is fixed at thread creation this is typical for all native os threads.
Erlang is a VM and runs on top of of processes and threads but exposes its own process model to the language that does not map 1:1 and therefore does not have a fixed stack size allowing many light weight processes. It pays an indirection penalty in performance for this but allows some nice stuff.
Java started with green threads and abandoned them, both .Net and Java use asynchronous concepts instead to get high concurrency now days cooperatively releasing threads and rentering them. There was talk of trying green threads out in .Net and bringing them back in Java for ergonomics compared to async, these green threads would not have such large fixed stacks and many more could be made similar to Erlang processes.
notpushkin
Whoa!
neonsunset
The unit of comparison with BEAM processes are .NET tasks. The results are much less favorable to Erlang or Elixir in that case
https://gist.github.com/neon-sunset/8fcc31d6853ebcde3b45dc7a...
Towaway69
Yes Erlang processes all the way down!
fnord77
seems like a jvm-based one would also fit that requirement. None that I can find
lxe
> Node-RED is a amazing[*] tool for creating flows that describe concurrent processing, it is just a shame the NodeJS is single threaded.
Being single-threaded doesn't affect concurrency.
nathanappere
It does if you have blocking calls or you cannot yield to the event loop in time consuming code.
ummonk
Are you asserting that single threaded execution of concurrent code is just as performant as multi-process execution?
Towaway69
Concurrency isn’t possible if there is only a single thread is my interpretation.
hotpocket777
That is not true at all. Concurrency is a way of writing programs and is an orthogonal concern to how the program gets executed.
concerndc1tizen
I've been interested in this for years.
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?
Towaway69
I know of Py-Red[1] which is an attempt to do the same but with Python. Using Node-RED as a frontend and something else as a backend, no I haven't heard of anything similar.
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.
regularfry
Speaking of controlling LEDs, there's also https://www.atomvm.net/doc/main/index.html. From a very quick scan it looks like it would need some fiddling (especially around the filesystem) to get it to work, but being able to scale down to smaller devices than a full pi would be very, very interesting.
Towaway69
Wow! That does look interesting:
> 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!
punnerud
One star on Gighub, could still be good though. Any alternatives on Python that is equally used.
HomeAssistant build on Python have an Node-Red extension, would be nice to see a Python version with more seamless integration
Towaway69
One star and it gave me the inspiration to create this ;)
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.
paddy_m
re:version control
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.
Towaway69
> Could you sort the JSON before saving so the output is more stable and diff-able?
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.
WillAdams
Well, there are pages on problems such as;
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
paddy_m
This is related to visual programming, not flow based programming.
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
jayd16
Unreal Blueprint is probably the most popular. Its a custom system over a fairly customized C++ framework.
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.
tzarko
This is neat - maybe move the example section higher up; it looks great and gives a much better idea of what the system looks like visually, which to me is key in node-based envs.
Towaway69
One example would be the website I've created using Erlang-RED[1]
But it's early days so I've yet come up with good examples.
I would really like to get some examples from the Erlang community and implement those, so if anyone has any ideas please contact me!
aantix
I would move your sample images to the top of the README.
Don't bury the lede.
bn-l
Can someone recommend an Erlang course / book?
Towaway69
I keep running into learn you some erlang[1] which seems to be a good online resource. The author of which also wrote the "Erlang in Anger"[2] book.
Then there is the BEAM book[3] which provides an deep dive into Erlang and the BEAM virtual machine.
I'm not the best person to ask since I'm only starting out on Erlang! I much prefer to code visually :)
[1] https://learnyousomeerlang.com [2] https://www.heroku.com/blog/erlang-in-anger/ [3] https://blog.stenmans.org/theBeamBook/
bn-l
Thanks for the suggestions! I looked at "learn you some erlang" and I like the style and humor of it.
randito
You may want to consider Elixir instead. It has an easier syntax and is (don't quote me on this) equivalent in function and purpose with Erlang. Plus you get lots of other goodies like LiveView (notebooks) and a good web stack (Phoenix).
Towaway69
I prefer Erlang because it makes the uniqueness of its paradigm clear. Tail recursion, function matching and, bang, everything is a message!
Elixir makes everything seem like Ruby code and many of those Erlang concepts are hidden away, which is also ok but also takes much away.
My aim with ErlangRED is that both are supported, there is a repository for Elixir code[1] that is included in ErlangRED - so I don't take sides, rather I would like to take advantage of both paradigms.
thinkyfish
I was just thinking of making something like this last night but using FLENG instead of Erlang ;) I'm really glad more people are taking inspiration from Node-RED, I will definitely be playing with this!
Towaway69
FLENG[1] - Wow, "low level concurrent logic programming language descended from Prolog" - sounds like an easy swap out for Erlang since they have the same heritage. ;)
[1] http://www.call-with-current-continuation.org/fleng/fleng.ht...
fnord77
for a visual environment, I was expecting more images to show me what this tool is
Towaway69
There is a live demo[1] if you want to try it out!
For me, the focus is more on the Erlang part than the visual part since that's basically NodeRED.
nisten
the hivemind thinks alike
Hi There,
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.