Skip to main content
Lion is a JSON-based Lisp where every program is valid JSON. Arrays are function calls, strings resolve environment bindings, objects evaluate their values, and primitives evaluate to themselves. The result is a homoiconic language that unifies data interchange and computation in a single format.

Quickstart

Run your first Lion expression in under five minutes.

Installation

Add @lionlang/core to your TypeScript or JavaScript project.

Core Concepts

Understand the expression model, evaluation rules, and special forms.

Standard Library

Explore all built-in modules: number, string, array, object, and more.

Host Interop

Call JavaScript methods, construct classes, and bind functions from Lion.

API Reference

Full TypeScript API docs for run, evaluate, schemas, and types.

Why Lion?

1

Every program is valid JSON

Lion expressions serialize to JSON out of the box. Store programs in databases, send them over HTTP, or generate them from other systems — no custom serialization required.
2

Embed computation anywhere

Inject Lion into any JavaScript environment by passing a plain object as the environment. Mix native JS functions, class instances, and values with Lion’s evaluation model.
3

Safe, typed evaluation

Built on Effect, Lion’s evaluator tracks errors as typed values. ArgumentMismatchError and InvalidFunctionCallError are first-class — no uncaught exceptions.
4

Rich standard library

Namespaced modules for number, string, boolean, array, object, func, value, and console cover the common operations without leaving the JSON representation.

A quick example

import { Effect } from "effect";
import { run } from "@lionlang/core/evaluation/evaluate";
import { stdlib } from "@lionlang/core/modules";

const result = await Effect.runPromise(
  run(["number/add", 1, 2], stdlib)
);
// => 3
The expression ["number/add", 1, 2] is plain JSON — an array whose first element names a function and the remaining elements are arguments. Pass it to run with an environment and get back a typed Effect.
Lion is published as @lionlang/core on npm. See Installation for package manager commands and peer dependency requirements.