@lionlang/core, running your first Lion expression, and extending the environment with custom JavaScript values. You will have a working Lion program in under five minutes.
Lion requires two peer dependencies:
effect for typed asynchronous evaluation, and typescript with strict mode enabled. Both must be installed in your project before using @lionlang/core.Import run and stdlib
run is the top-level entry point for evaluating Lion expressions. stdlib is the default environment containing all built-in modules.run function accepts any JSON-compatible value as an expression and a plain object as the environment. It returns an Effect that resolves to the evaluation result.Evaluate your first expression
Pass a Lion expression and the standard library environment to The expression
run, then execute the Effect with Effect.runPromise.["number/add", 1, 2] is a plain JSON array. The first element, "number/add", resolves to a function in stdlib. The remaining elements are the arguments. The result is 3.Add a custom environment
Spread Because strings resolve at evaluation time, you can store Lion programs as JSON and supply different environments at runtime — changing behavior without modifying the program.
stdlib into your own object to add custom bindings. Any string in a Lion expression resolves against the environment — including your own values, objects, and functions.Next steps
Expression model
Learn how arrays, strings, objects, and primitives evaluate in detail.
Special forms
Explore
define, lambda, cond, match, begin, and quote.Standard library
Browse all built-in modules and their available functions.
Custom environment
Learn patterns for injecting JavaScript APIs into the Lion environment.