#language #lisp

bin+lib lithia

Embeddable and simple lisp dialect

7 stable releases

1.0.6 Jun 29, 2022
1.0.5 Jun 6, 2022
1.0.4 Apr 10, 2022
1.0.1 Apr 9, 2022
1.0.0 Apr 5, 2022

#74 in Programming languages

MIT license



lisp implemented in rust


Name comes from another name for Lithium Oxide


  • quote Returns whatever its given, used for when you don't want to evaluate something
  • exit Exit lisp interpreter, number may be provided for exit code
  • =, set Sets a variable
  • def Define a global
  • defunc Define a global function
  • eval Evaluates the given object and what it returns
  • print Display an object
  • read Reads a line into objects
  • include Reads a file and evaluates it, returning the last object
  • while While first argument isn't nil, evaluates the rest
  • read Prompts for input and converts it to objects
  • func Creates a function
    • Use:
     (func (arg1 arg2)
  • car, first Gets the first element in a dot-pair
  • cdr, next Gets the second element in a dot-pair

Math functions

  • +, add
  • -, sub
  • *, mul
  • /, div
  • %, mod
  • ==, eq
  • !=, ne


This crate provides a LISP implementation for embedding within rust programs

With support for providing rust functions as LISP functions within the environment


This crate is on crates.io and can be used by adding lithia to your dependencies in your project's Cargo.toml.

lithia = "*"

Example: simple REPL

let code = "(while t (print (eval (read))))".to_string()

let mut globals = HashMap::new();
let ret = Lisp::new(&mut globals)


~38K SLoC