Comment by Arch-TK

Comment by Arch-TK 2 days ago

5 replies

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 2 days ago

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.

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

  • Arch-TK 2 days ago

    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 2 days ago

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.

a-ungurianu 2 days ago

Wouldn’t all the ReativeX libraries (e.g. RxJS) count?

Is there any specific features you’d be looking for?