All languages

Lion language

A homoiconic Lisp whose every program is valid JSON, evaluated on Effect, with a Datalog-style logic database and runtime schemas in the same syntax.

Overview

Lion is a homoiconic Lisp whose programs are plain JSON: an array is an expression, an object a record, and a string a name, so one format serves code and data. It evaluates on Effect, and a Datalog-style logic layer, runtime schemas, and a graph editor share that same syntax.

Code

42
true
["number/add", 1, 2]
["number/multiply", ["number/add", 1, 2], 4]
"lion"
["quote", "lion"]
The literals evaluate in place and number/add returns 3, while a name like "lion" is a lookup first and text only when nothing is bound; array/map returns [2, 4, 6]; add10 returns 42 because the inner lambda is a closure that kept n; and the logic layer is not a separate file format — query derives paths from two rules over the same JSON a value would be written in.

Distinctive traits

  • Code is data: an array is a special form or a call, so quote stores a program and eval runs it later.
  • define binds a lambda like any value, and array/map takes a function as an ordinary argument.
  • Tail-position calls keep nothing of their caller, so a self-recursive lambda loops in constant memory.
  • A Datalog-style layer — relations, recursive rules, aggregates, why explanations — reuses the JSON syntax.
  • match dispatches on a value's shape — predicate, record, or literal — so branching needs no type tag.
  • Schemas are runtime values, and a relation can declare {"schema": …} to reject rows that do not fit.

Status

MIT-licensed and pre-1.0: @lionlang/core 0.14.1 shipped in November 2026, seven months after 0.1.0, and recent releases still record breaking changes. The repository also ships the CLI, a graph editor, and the docs' browser evaluator.

Sources & references