> ## 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: JSON-based Lisp for executable data

> Lion evaluates valid JSON as programs. Every Lion expression is serializable, storable, and network-transmittable — no separate parser needed.

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.

<CardGroup cols={2}>
  <Card title="Quickstart" icon="rocket" href="/quickstart">
    Run your first Lion expression in under five minutes.
  </Card>

  <Card title="Installation" icon="box" href="/installation">
    Add `@lionlang/core` to your TypeScript or JavaScript project.
  </Card>

  <Card title="Core Concepts" icon="book" href="/concepts/expression-model">
    Understand the expression model, evaluation rules, and special forms.
  </Card>

  <Card title="Standard Library" icon="layer-group" href="/stdlib/overview">
    Explore 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>

  <Card title="API Reference" icon="code" href="/api/run">
    Full TypeScript API docs for `run`, `evaluate`, schemas, and types.
  </Card>
</CardGroup>

## Why Lion?

<Steps>
  <Step title="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.
  </Step>

  <Step title="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.
  </Step>

  <Step title="Safe, typed evaluation">
    Built on [Effect](https://effect.website), Lion's evaluator tracks errors as typed values. `ArgumentMismatchError` and `InvalidFunctionCallError` are first-class — no uncaught exceptions.
  </Step>

  <Step title="Rich standard library">
    Namespaced modules for `number`, `string`, `boolean`, `array`, `object`, `func`, `value`, and `console` cover the common operations without leaving the JSON representation.
  </Step>
</Steps>

## A quick example

```typescript theme={null}
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.

<Note>
  Lion is published as `@lionlang/core` on npm. See [Installation](/installation) for package manager commands and peer dependency requirements.
</Note>
