litto 0.1.0

Building blocks for DSL scripting language interpreters that interact with native Rust code.
Documentation
  • Coverage
  • 100%
    68 out of 68 items documented0 out of 44 items with examples
  • Size
  • Source code size: 58.77 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 7.2 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 22s Average build duration of successful builds.
  • all releases: 22s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Repository
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • quark-zju

litto

Documentation crates.io build

Lightweight building blocks for implementing interpreters in Rust. Ideally for DSL use-cases.

Exmaple Languages

  • tinylang: A tiny language with S-exp syntax. It basically only implements lambda without even primitive types like bools, ints, or lists. Note those types can be built using lambda.
  • minilang: Extends tinylang with a richer standard library and types. Run cd examples/minilang-repl; cargo run to try it in an REPL.

Goals

  • Simple. The code should be simple to reason about.
  • Powerful. Use simple concepts to express powerful features. For example, lambda can be easily implemented and it is pretty powerful.
  • Easy-to-use.
    • Sharing data and functions between Rust and the DSL is easy and safe.
    • The DSL can easily opt-in a garbage colletor to make memory management easier.
  • Flexible. Things like syntax, AST internal representation, standard library functions, types, how to resolve a name, what is a function, and how to call a function, are all customizable.
  • Rust. This library is written in Rust and solves Rust problems. Not intened to be used in other languages via FFI.

Non-goals

  • Performance. Performance is a best-effort within the simplicity constraint. Practically, performance-critical code should be in native Rust.
  • Features. Feature-complete is not a goal, especially when it conflicts with simplicity.
    • Stackless. The Rust language natively uses the native stack when calling a function. Therefore a stackless is not simple in Rust. This means things like co-routine and call/cc are not out-of-box.
    • Multi-Thread. Right now it's not a goal because the gc library does not support it.