> ## Documentation Index
> Fetch the complete documentation index at: https://docs.lionlang.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Lion: Lisp Object Notation for JavaScript

> Lion is a JSON-based Lisp for TypeScript and JavaScript. Every Lion program is valid JSON — serializable, storable, and embeddable in any JS project.

Lion is a JSON-based Lisp library for TypeScript. Every Lion program is valid JSON, which means expressions are serializable, storable in a database, transmittable over a network, and generatable from other systems — all without a separate parser. The `@lionlang/core` package provides the evaluator, special forms, and standard library you need to embed Lion computation into any JavaScript project.

## How the expression model works

Lion's evaluation rules map directly onto JSON types:

* **Arrays** are executable expressions. The first element is either a special form keyword or a function resolved from the environment; the remaining elements are arguments evaluated left to right.
* **Strings** are environment references. When a binding exists in the current environment, the string evaluates to that value. When no binding exists, the string evaluates to itself.
* **Objects** preserve their keys and evaluate each value recursively, producing a new plain object.
* **Primitives** — numbers, booleans, and `null` — evaluate to themselves.

This means the same JSON structure is both data and code. You can inspect, generate, and transform Lion programs using ordinary JSON tools.

## Key features

**Homoiconic by design.** Because programs are plain JSON, they share the same representation as data. You can quote, inspect, and pass programs as values without leaving the JSON format.

**Typed evaluation with Effect.** The evaluator is built on [Effect](https://effect.website). Errors such as `ArgumentMismatchError` and `InvalidFunctionCallError` are typed values — not thrown exceptions — so error-handling is explicit and composable.

**Rich standard library.** The `stdlib` export namespaces eight built-in modules: `number`, `string`, `boolean`, `array`, `object`, `func`, `value`, and `console`. Every entry follows the `<module>/<name>` convention, for example `number/add` or `array/map`.

**Seamless host interop.** Extend the environment with any JavaScript value: plain objects, class instances, functions, or third-party APIs. Lion resolves strings against whatever you put in the environment, making it straightforward to drive JavaScript libraries from Lion programs.

**Special forms for control flow.** `define`, `lambda`, `cond`, `match`, `begin`, `quote`, and `eval` give Lion expressive control flow while remaining representable as JSON arrays.

## Where to go next

<CardGroup cols={2}>
  <Card title="Quickstart" icon="rocket" href="/quickstart">
    Install `@lionlang/core` and evaluate your first expression in under five minutes.
  </Card>

  <Card title="Expression model" icon="sitemap" href="/concepts/expression-model">
    Deep dive into how arrays, strings, objects, and primitives evaluate.
  </Card>

  <Card title="Standard library" icon="layer-group" href="/stdlib/overview">
    Browse all built-in modules: number, string, array, object, and more.
  </Card>

  <Card title="Host interop" icon="plug" href="/guides/host-interop">
    Call JavaScript methods, construct classes, and bind functions from Lion.
  </Card>
</CardGroup>
