BEFORE YOU START
Commands and examples
The surreal module build command is used to build a WASM binary from the Rust source code. A binary must have the .surli file extension.
The surreal module info command can then be used to see the information about a compiled WASM binary.
Individual functions can be run on the command line with the surreal module run command, including functions that require arguments to be passed in. Here are a number of examples.
The surreal module sig command can be used to see the the signature for a function.
surreal module init
Scaffold a new Surrealism module project (Rust crate, surrealism.toml, and starter src/lib.rs):
For scripts or CI, use non-interactive mode:
surreal module build --debug
Using --debug skips the usual optimisation pass for a faster build time in exchange for lower performance. Recommended when iterating and testing before producing a final build.
Command help
To see the help information and usage instructions, in a terminal run the surreal module --help command without any further arguments. This output lists subcommands, global options, and shared logging flags for the module command.
The output of the above command:
Further reading
Surrealism extensions overview — end-to-end workflow
Creating custom modules — attributes,
surrealism.toml, and attached filesystems