ErieRT is a Lua runtime built in Rust designed for minimal setup and powerful extensibility.
ErieRT features some built-in types and functions to make basic web APIs or CLI apps without reliance on extensions.
ErieRT also features full backwards-compatibility with Lua's standard library, albeit without being able to read Lua's standard library files for bundled applications.
These are the definitions of ErieRT's command-line arguments:
doc [file]: Generates Lua doc from built-in types out to [file].
help: Displays help information.
version: Displays ErieRT version.
run [file]: Runs Lua script file with ErieRT.
new [projname (DEFAULT: erieproj.json)] Creates new ErieRT project.
runproj [projfile]: Runs ErieRT project.
pack [projfile]: Packs ErieRT project into `pack/` folder. Name reflects project name in the project JSON file.
build [projfile]: Packs ErieRT project into `build/` folder and places a copy of the ErieRT binary in `build`. Name reflects project name in the project JSON file.
exec [archivefile]: Runs the contents in the archive.
[default]: Tries to use `exec` with the root name of the archive being the same as the root name of the runtime.To build from scratch, simply use the following command:
git clone https://www.github.com/JaydonXOneGitHub/eriesuite
This will copy ErieRT (eriert), the API crate (eriert-api), and an extension template (erieextension).
To build ErieRT, simply run this command in the eriert folder:
cargo build --release
Additionally, if working on Unix (or more likely just Linux), use the following command to copy ErieRT to the path:
cp target/release/eriert ~/HOME/.local/bin/eriert
ErieRT extensions can be created in languages including, but not limited to:
- C
- C++
- Go
- Rust
- Zig
- Many more
As long as they expose a way to bind to Lua, it can work.
erieextension is a good starting point for making Rust-based extensions.
However, this is an example of how an entry point would look like in C:
// The other two pointers should be ignored by languages other than Rust.
void entry(lua_State* lua, void* _rust_lua, void* _rust_engine_api)
{
// write extension code here
}Extensions are defined in project files like this:
{
"windows_path": "extension/extension.dll",
"macos_path": "extension/libextension.dylib",
"linux_path": "extension/libextension.so",
"entry": "extension_entry"
}I had a project I was working on.
It was initially built in Rust with Lua as a scripting layer.
However, I soon found that Rust would mean changes wouldn't be able to happen fast enough.
I initially switched to Deno for JavaScript, but found it didn't meet my needs for extensibility.
Thus, I decided to create this runtime with Lua, as it was the most frictionless idea at the time.
Over time, I added more features - a bundler, a way to double-click and run an app, and eventually the FFI layer.
