This artifact is an appendix, provided as a Git repository alongside a thesis. The intended reader is an examiner or reviewer who needs enough detail to reproduce the work, verify its claims, and assess its completeness independently of the thesis body.
| Want to find ... | File |
|---|---|
| Lexer: Converts text into tokens | src/lexer.rs |
| Parser: Produces an AST | src/parser.rs |
| Interpreter: Evaluates the AST | src/interpreter.rs |
| A collection of tests. Can be used as reference. | src/test/*.rs |
| CLI executable | src/bin/cli.rs |
The crate exposes four interfaces:
REPL for interactive evaluation
cargo run --release -- replrun command that executes a script file
cargo run --release -- run scripts/syntax_overview.mwinterpret command that executes a string
cargo run --release -- interpret "1 + 1"library API
use masterwork::Masterwork;
if let Some(result) = Masterwork::run("1 + 1") {
println!("Program returned: {:?}", result);
}Five example scripts demonstrative of the language:
| Example | File |
|---|---|
| structs, constructors, methods, mutable state | scripts/game.mw |
| PRNG and iterative estimation | scripts/monte_carlo_pi_estimation.mw |
| a primitive JSON parser | scripts/json.mw |
| HTML templating | scripts/static_site_generator.mw |
| a syntax reference | scripts/syntax_overview.mw |
All code is original, external dependencies are limited to published crates listed in Cargo.toml, and no copyrighted material was used without permission. LLM was used for refactoring.