hlang
A FBP-Inspired language for building universal applications.
Hlang aims to make programming easier, faster and more comfortable. It avoids coding, repetition and frustration.
Activity from the interpreter
- Type in the Text node.
What an hlang program is
A Readable sends, a Transform maps, a Writable receives, and every port between them is a live stream.
One program, two backends
planGraph checks a graph and plans it once. The interpreter runs that plan; the compiler prints the same plan as a module.
First it is data: an IGraph.
IGraph
text · R · text-sourcetransform · T · uppercaseprint · W · print2 connections
Then planGraph checks and plans it.
ExecutionPlan
roots: texttext.out → transform.intransform.out → print.in
The interpreter runs it in process.
interpret()
in · Ports are live streamsout · PORTS ARE LIVE STREAMS
Or the compiler prints it as a module.
compile()
import {Flow} from "@hlang-org/runtime";import {Subject} from "rxjs";import Node0 from "./nodes/text-source.js";import Node1 from "./nodes/uppercase.js";import Node2 from "./nodes/print.js";export function run(options = {}) {
Lumen, the editor for hlang graphs
This is the editor itself, running in your browser. Drag a node, change a parameter in the inspector or connect a port, and the running total follows.
It runs while you edit
Run interprets the graph in your browser and the edges light as values pass. Change a parameter or a connection and the flow restarts.
Every edit can be undone
Adding, moving, wiring and deleting are commands in editor-core, so undo and redo cover all of them.
Wrong links are refused
An output connects only to an input, and a link that breaks the R, T, W rules cannot be drawn. Feedback loops between transforms stay legal.
Search to add a node
Double-click the canvas, or drag a port into empty space to see only the nodes that can connect there.
Drop a node on a wire
A transform dropped on a connection is spliced into it, with both links rewired in one undoable step.
The output is an IGraph
The editor reads and writes the same JSON the interpreter runs and the compiler prints.
Lumen is three packages, released as 0.x while the API settles: a headless core, React bindings and a design system. Read the Lumen docs
Built on hlang
Anything that produces an IGraph can run it with the interpreter or ship it with the compiler, so each product builds its own surface on the same engine.

Freshippo Rex · CHINASHOP 2020
Retail store operations
At CHINASHOP 2020, the 22nd China Retail Expo, Rex, the commercial platform of Freshippo, presented a solution for store operations with hlang as its logic engine. Store logic was built, demonstrated and debugged as flows.

AI agents and workflows
AStack
A composable TypeScript framework for AI agents, workflows and RAG. Models, tools and agents share one component interface and connect through ports into pipelines. AStack has its own implementation; hlang provides its computational model.

Image and video creation · in development
Prism
A node-based tool for image and video creators, built on Lumen. Its image sources, intent nodes and render preview are hlang nodes, and what a creator builds is an IGraph.
Seven packages
Every package is published under @hlang-org, and with identical builds and versions under @hlang-tech. Use one scope in a project.
Language
Start with the runtime and the interpreter.
npm install @hlang-org/runtime @hlang-org/interpreterThe Lumen packages are 0.x: they are in active development and can change in any minor release.