Erlang-RED: Bringing True Concurrency to Node-RED with Erlang Backend

BigGo Editorial Team
Erlang-RED: Bringing True Concurrency to Node-RED with Erlang Backend

In the world of visual programming and flow-based development, a new project is gaining attention for its innovative approach to solving concurrency limitations. Erlang-RED, developed by community member Towaway69, aims to replace Node-RED's JavaScript backend with Erlang, a language specifically designed for concurrency and message passing.

Combining Visual Programming with Erlang's Concurrency Model

Erlang-RED leverages Node-RED's intuitive visual interface while replacing its backend with Erlang's powerful concurrency capabilities. The project addresses one of Node-RED's fundamental limitations: JavaScript's single-threaded nature. By implementing an Erlang backend that's compatible with existing Node-RED flows, developers can potentially gain true concurrency without sacrificing the simplicity of visual programming.

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.

This approach could be particularly valuable for applications requiring high concurrency, such as IoT systems, data pipelines, or distributed applications. The developer has implemented a substantial number of Node-RED's core nodes, including http in/out, MQTT, file operations, and flow control nodes like switch, join, and split.

A screenshot of the Node-RED interface for exporting nodes, highlighting the visual programming environment that Erlang-RED builds upon
A screenshot of the Node-RED interface for exporting nodes, highlighting the visual programming environment that Erlang-RED builds upon

Challenges in Visual Programming Adoption

The community discussion highlighted several challenges facing visual programming approaches like Erlang-RED. One significant issue is the lack of tooling for visual version control and comparison. Unlike text-based code where tools like Git can show precise changes, visual flows are typically stored as JSON with coordinates that make meaningful comparisons difficult.

As one commenter noted, this creates barriers for collaborative development in visual environments. When coordinates of nodes change (which has no impact on logic), these appear as code changes in version control systems. This mixes semantic changes with purely visual ones, making code review and collaboration more challenging than with traditional text-based programming.

Despite these challenges, the developer points to Node-RED's maturity in addressing large program maintenance through features like link nodes and subflows, which enable code reuse and better organization of complex applications.

The Intersection of Open Source and Licensing Philosophy

An interesting side discussion emerged around the project's unconventional DON'T DO EVIL license. This license, inspired by Douglas Crockford's JSONlint license, sparked debate about the practicality and implications of adding philosophical statements to software licenses.

Some commenters pointed out that non-standard licenses can prevent corporate adoption and limit contributions, as they often trigger legal reviews in enterprise environments. Others appreciated the developer's stance on ensuring their work isn't exploited without compensation.

The license discussion reveals the tension between open source ideals and commercial realities, particularly for independent developers who want to share their work while maintaining some control over how it's used commercially.

Future Directions and Similar Projects

The community showed interest in similar approaches for other languages, with mentions of Py-RED for Python and questions about other visual programming environments. The developer also noted plans to improve documentation with more real-world examples and potentially create video explanations of the project.

For those interested in exploring Erlang-RED, the project offers a comprehensive test suite and visual unit testing capabilities built directly into the Node-RED interface. This allows developers to ensure compatibility with the original Node-RED functionality while extending capabilities through Erlang's concurrency model.

As visual programming continues to evolve, projects like Erlang-RED demonstrate how combining the strengths of different paradigms can potentially overcome limitations in existing tools, opening new possibilities for developers working on concurrent systems.

Reference: Erlang-RED - A Node-RED backend coded in Erlang