I built a Node-RED run-time engine prototype in Rust

Hello people,

As a project to practice learning Rust, I’ve created (or maybe you could say "borrowed heavily from") an open-source run-time engine prototype that’s compatible with Node-RED in Rust. It can directly run flows.json workflow files generated by Node-RED.

If you’re interested, feel free to check out the GitHub repo:
oldrev/edgelink: EdgeLink: A Node-RED compatible run-time engine in Rust (github.com)

4 Likes

Hi & welcome to this forum!
In general, this looks like a nice project.
Unfortunately, most of the files you reference in your README are unaccessible, e.g. CONFIG.md.

Hi, I'm sorry for the inconvenience. This project is still in its very early stages of development. The documentation is mostly placeholders at the moment. Right now, there's not much to configure. You can just use the command line argument -h to see the available options.

How does this work exactly ? I mean in terms of the nodes that are being used within flows, is there some kind JS/JIT compiler at work ? And once the flow is running, do you have access to the editor using the same 'engine' or does it only execute the flows as is ?

This program is designed to execute flows.json files that have been designed and exported/deployed using Node-RED, without any editor or other HTML/Web-related functionalities. The purpose of its development is to deploy tested Node-RED flows to devices with limited memory for execution.

In other words, I need to use Rust to reimplement all the nodes used in the flows.json.

Only the "function" node will use the lightweight QuickJS JS interpreter to run their code; all other functionalities are implemented in native Rust code.

Love to see this go somewhere, I've been thinking about doing the same (using Python) but always stopped because the JS/NodeJS dependencies always meant it would be of limited use, i.e. function nodes would always be a pain or extra installed nodes.

Your approach of defining the "base" nodes (i.e. switch, change, inject - i assume) is probably the right way to start.

I ended up going in the other direction and implementing a browser-only Node-RED that implements some of the base nodes to run in the browser --> GitHub - gorenje/cdn.flowhub.org: Deadred: A crash-test dummy Node-RED instance - in-browser with limited flow execution. --> turns out it wasn't that much effort (probably getting started was the hardest bit!) and makes for good way to demonstrate Node-RED without a server.

Good luck with your effort :+1:

3 Likes

Thank you for your support. Your project seems to be very well-developed and almost complete.