GitHub - oxura/merlo-lang: Experimental statically typed native language for humans and coding agents. · GitHub
Skip to content

About

Experimental statically typed native language for humans and coding agents.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Merlo

A concise, statically typed native programming language for humans and coding agents.

CI License: MIT OR Apache-2.0 Status: Research Alpha

Merlo is an experimental language and compiler built around static types, ownership, inferred effects, capabilities, and stable semantic representations. The current prerelease is 0.1.0-alpha.2: a bootstrap compiler requiring Python 3.11 or newer with no third-party Python runtime dependencies, a C11 native backend, project tooling, an LSP server, a standard library, and executable source-checkout examples. The wheel contains the compiler and its runtime standard library; documentation, specifications, research, RFCs, editor assets, and examples remain in the source archive. No PyPI availability is claimed. Research and development began privately on 2026-03-19. The first public research alpha was released on 2026-08-14.

User:
    name: Text
    nickname: Text?
    active: Bool

display_name(user) = user.nickname or user.name
active_names(users) = users.where(.active).map(display_name)

The short form is the design target. Today merlo new hello --name hello creates this complete runnable program:

module main

export enum AppError:
    Failed

export main(path: Path) -> Result[Text, AppError]:
    console.write("ok")
    Ok("ok")
$ merlo run hello
ok

The larger JSON CLI example reads a file, parses JSON, matches its root value, and builds typed output. For a small data-processing project, the checked-in capacity-ledger example accepts a path argument:

merlo check examples/capacity-ledger
merlo build examples/capacity-ledger
merlo run examples/capacity-ledger -- examples/capacity-ledger/input.txt
capacity-ledger
entries=4
alpha_minutes=40
beta_minutes=50

The JSON CLI example has the same project shape. Its checked-in input produces:

merlo run examples/json-cli -- examples/json-cli/input.json
json-bytes=33 root=object fields=2

These outputs are fixtures from the examples; they are not performance claims.

What is implemented

  • static inference with no Any escape hatch or truthiness coercion
  • records, payload enums, Option, Result, and strict option fallback
  • whole-function let/var inference and tail results
  • experimental effect, capability, and typed-error inference
  • immutable values, ownership checks, borrowing, moves, and generated drop glue
  • statically specialized generic functions, static interfaces, and restricted capturing closures with owned closure environments
  • modules, projects, lockfiles, packages, and deterministic semantic identities
  • Text, Bytes, Vec, Map, arrays, slices, boxes, and streaming file input
  • HIR, Representation IR, MIR, C11 lowering, and native executable generation
  • CLI commands for project work, deterministic verification reports, typed-hole context and offline synthesis, SemanticWorld queries, structural refactors, and verified evolution with exact rollback evidence
  • an LSP server, editor grammar, FFI boundary, standard library, and twenty runnable example projects

The supported alpha target is Linux x86-64 with a C11-capable Clang or GCC toolchain. Production host I/O is synchronous. Arbitrary closure capture, language-level async, macros, cycle collection, a hosted public registry, and production stability guarantees are outside this release. The production synthesize command is currently limited to deterministic offline typed-hole candidates; LLM generation remains a separate research surface and is never called by build. A staged self-host subset and experimental machine, flow, parallel, registry, and WASM components are present as research surfaces; they are not all production native language routes. See Known limitations for the exact boundary.

Security note: Merlo capabilities constrain checked program behavior, but the current native runtime is not an operating-system security sandbox. Run untrusted binaries inside normal host isolation.

Merlo is designed around structured semantics for coding agents. The productivity advantage has not yet been independently validated. No general native-performance, simplicity, or AI-productivity superiority is claimed.

The public native benchmark is separate source-checkout tooling under tools/benchmarks/merlo. It is not a merlo production command. Its exact claim and reproduction boundary are documented in Public native benchmark v1; it does not claim general native performance, language ranking, Rust performance, or AI productivity.

Compiler

.mlo source
    │
    ├── concise elaboration and type checking
    ▼
structured HIR
    ▼
Representation IR
    ▼
performance MIR
    ▼
C11 source
    ▼
native executable

Merlo is converging on one semantic core shared by compilation and tooling. The current project frontend still contains transitional text-oriented elaboration that is being replaced under RFC 0001.

Install and run

The alpha.1 artifacts remain historical evidence; the source archive is incomplete and the wheel predates later compiler portability repairs. Install the GitHub prerelease wheel (no PyPI availability is claimed):

python -m pip install https://github.com/oxura/merlo-lang/releases/download/v0.1.0-alpha.2/merlo-0.1.0a2-py3-none-any.whl
merlo new hello --name hello
merlo check hello
merlo build hello
merlo run hello

Or install this repository checkout instead:

git clone https://github.com/oxura/merlo-lang.git
cd merlo-lang
python3 -m venv .venv
. .venv/bin/activate
python -m pip install .
merlo new hello --name hello
merlo run hello

The observed generated project output is:

ok

For a full project check:

merlo check hello
merlo fmt hello --check
merlo test hello
merlo build hello

new writes merlo.toml, merlo.lock, and src/main.mlo. The other commands accept either a project directory or a source path. Diagnostics go to stderr; commands with a machine-readable mode return deterministic JSON through --json.

Repository map

Path Contents
src/merlo/ Production compiler, semantic model, native backend, CLI, and LSP
stdlib/ Merlo standard-library modules
examples/ Executable CLI, data, package, network, and FFI projects
tests/ Production language, compiler, runtime, and distribution regressions
tools/benchmarks/merlo/ Explicit benchmark and evidence suites
spec/ Normative alpha contracts
docs/ Installation, language guide, architecture, tooling, and limitations
tools/release/merlo/ Explicit release assembly and validation suite
research/archive/ Frozen historical protocol and Alpha1 evidence
research/ Research questions, methods, results, and limitations
rfcs/ Process for proposed language and runtime changes

Documentation

Historical research remains reproducible from repository sources. It is not part of the supported user workflow and will be removed from the production CLI.

Contributing and license

Merlo is research software, but changes to public behavior still require a focused regression and an executable check of the affected path. See CONTRIBUTING.md, SECURITY.md, and the RFC process.

Merlo is dual-licensed under your choice of Apache License 2.0 or MIT.

About

Experimental statically typed native language for humans and coding agents.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages