Merlin Programming Language

Merlin

A simple programming language for real web applications.

Stack-based. RPN. Templates. Modules. Pipelines. A small set of concepts designed to compose naturally.


Real sites running Merlin

Merlin is not only demonstrated with isolated examples. Complete applications are running with it today.

🍽️

Merlin Dinner

A complete restaurant SITE-MODEL with menus, categories, photos, events and administration.

Open Restaurant Site →
📈

Finance

A complete financial SITE-MODEL with simulations, retirement planning and financial tools written using Merlin.

Open Finance Site →

Start with a complete site.

Choose a SITE-MODEL, give your site a name and start from a complete working application. Access the source and change anything you want.

Open PlayMerlin

Simple by design

Merlin is built from a small set of concepts that work together instead of dozens of unrelated features.

Three core values

Numbers, Strings and Dictionaries, together with their vectors.

Typed stacks

Operators consume and produce values through typed stacks instead of conventional parameters and return values.

RPN

Reverse Polish Notation makes expressions and pipelines naturally composable.

Recursive evaluation

The same evaluator is reused through modules, pipelines, filters, templates and expressions.

Templates are programs

Merlin code executes directly inside templates without requiring a separate template language.

Written in Rust

The current Merlin runtime is implemented in Rust.

A small language that composes.

The same stack-based model is used through calculations, modules, pipelines and templates.

// aggregate many results
(@TOTAL, @MEDIA, @NUM_PEDIDOS) = @PEDIDOS.VALOR | SUM | AVG | LEN

// transform and return a vector
$TITULOS[] = PRODUTOS.TITULO | UPPER | SORT | RETURN($TITULO)

Explore the source

Merlin is available on GitHub with examples, runtime source and language documentation.

Merlin on GitHub