ZuzuScript Rust Runtime
zuzu-rust is the Rust implementation of ZuzuScript, a scripting language for
automation, command-line tools, text processing, data wrangling, integrations,
and small web applications.
This runtime can run .zzs scripts, load ZuzuScript modules, start an
interactive REPL, serve ZuzuScript web applications, and print a stable JSON AST
for tooling.
Installation
Debian Package
Pre-built Debian packages are available from:
https://zuzulang.org/downloads/
This is the simplest installation route on supported Linux systems. The package
installs the Rust runtime, the shared standard library, packaged helper scripts,
manual pages, and a zuzu command wrapper.
Cargo Installation
From a checkout of this repository:
The extra post-install.sh step installs the shared standard library and
creates the zuzu wrapper in the same layout used by the packaged install.
For custom installation locations, see INSTALL.md.
Quick Start
Create hello.zzs:
say "Hello, world!";
Run it:
If you are using the runtime binary directly:
You can also run inline code:
Start the REPL:
Main Commands
zuzuruns ZuzuScript using the installed wrapper.zuzu-rustruns scripts directly with the Rust runtime.zuzu-rust-serverserves ZuzuScript web applications.zuzu-rust-parse-fileschecks that.zzsand.zzmfiles parse.zuzu-rust-run-testsruns ZuzuScript TAP tests.
Run any command with --help for its options.
Useful Runtime Options
Common options:
-I/path/to/libadds a module include directory.-Mmodulepreloads a module with wildcard import.-e 'code'evaluates inline code.--replstarts the interactive shell.--dump-astprints the parsed AST as stable JSON.--dump-zuzuprints parsed code back as ZuzuScript source.--deny=CAPdenies a runtime capability.--denymodule=MODULEdenies a specific module.-vprints the version.-Vprints verbose version details.
Standard Library
The Rust runtime uses the shared ZuzuScript standard library from the stdlib
submodule. A normal package install configures this automatically.
If imports fail after a Cargo install, make sure you have run:
Useful environment variables:
ZUZULIBadds module search paths.ZUZU_STDLIBoverrides the installed standard-library module path.
Examples And Documentation
The user guide starts at:
Example scripts are in:
Run an example from this repository with:
Serve the Rust web example:
Then open:
http://127.0.0.1:3000/
Checking A Local Build
For a quick parser check:
For the Rust test suite:
For shared ZuzuScript standard-library tests:
Project Status
zuzu-rust is released as version 0.2.x and is under active development. The
--dump-ast JSON format is treated as a stable, machine-readable interface for
tooling.
Licence
zuzu-rust is copyright Toby Inkster.
It is free software; you may redistribute it and/or modify it under the terms of either the Artistic License 1.0 or the GNU General Public License version 2 or later.