Suzu Environment

A compiler and runtime environment for the Suzu language.

References

Programs

Interpreter

cargo run --bin sz [file_path..]

Simple runtime to build and execute source files.

Source files are built in order, after which the entire program is executed.

If no arguments are provided, the program will build and execute main.suzu.

System Calls: print, hex, expect

Language Test Framework

cargo run --bin tests

Individually executes all files in the tests directory and reports whether an error was encountered.

System Calls: expect

Integration

As a configuration language, Suzu is intended to be integrated into host applications.

For the time being, the library may be included by adding the repository to your Rust project's Cargo.toml.

[dependencies]
suzu = { git = "https://git.tsukiyo.org/Suzu/suzu" }

Running Programs

Programs are built using load(), which may be called multiple times to expand the program.

Once the program has successfully built, its runtime may be initialized using init(), though this is automatically performed on execution.

The program is executed by calling run().

fn program(source:&str) -> Result<(),Cause>
{
    let mut program = Suzu::new();
    program.load(source)?;
    program.run()
}

Inspecting Programs

Once a program has been initialized, its global variables may be accessed.

This may be used to set variables before running or inspect results after execution.

program.init();

if let Some(object) = program.get_as::<Sequence>(&["content"]) {
    object.set_str("hello");
}

program.run()?;

if let Some(object) = program.get(&["scope", "key"]) {
    println!("{}", object.to_string());
}
Description
Configuration language library for Rust applications.
https://suzu.studio
Readme 1.9 MiB
Languages
Rust 100%