luallaby

Crates.ioluallaby
lib.rsluallaby
version0.1.0
sourcesrc
created_at2021-08-16 20:07:53.748901
updated_at2024-02-15 17:47:56.422437
description**Work in progress** A pure-Rust Lua interpreter/compiler
homepagehttps://gitlab.com/dragonblade/luallaby
repositoryhttps://gitlab.com/dragonblade/luallaby
max_upload_size
id438162
size1,131,645
Dennis Eijkel (dragonblade)

documentation

https://docs.rs/luallaby

README

luallaby

Crates.io docs.rs Crates.io

This project is a work in progress. Please do not use this (yet) if you need a reasonably fast Lua interpreter.

A Lua compiler and interpreter fully written in Rust. This project aims to provide a fully compliant Lua implementation including interoperability between Lua and Rust.

Things to do and implement

A list of features to be implemented, in somewhat particular order:

  • Full language syntax support
  • Proper error handling with trace+context (not panicking on every problem)
  • Rust-Lua interoperability
  • Standard libraries
    • Basic library
    • Coroutine library
    • Package library
    • String manipulation
    • Basic UTF-8 support
    • Table manipulation
    • Mathematical functions
    • Input and output
    • Operating system facilities
    • Debug facilities
  • Garbage collector
  • Passing the Lua test suite
  • Benchmarks vs other compilers
    • Reasonable performance
  • REPL

Testing

This crate has its own test suite that mainly contains basic unit tests or sanity checks to verify if all parts of the language and standard library are in at least a semi-working condition. These sanity checks can be run with:

cargo test

A copy of the Lua test suite has also been included in this repository. These tests can be run by running them as regular Lua files cargo run -- <file>.lua, the test is considered passed if the output ends with "OK" and the interpreter has returned without error.

The Lua test suite has also been included in the cargo test suite, but has been marked as ignored. To include the Lua test suite with the sanity checks run:

cargo test -- --include-ignored

Usage

TODO:

License

luallaby is distributed under the terms of the MIT license.

See the LICENSE file for more information.

Commit count: 147

cargo fmt