mumu-sys

Crates.iomumu-sys
lib.rsmumu-sys
version0.1.0
created_at2025-06-22 10:48:41.983023+00
updated_at2025-06-22 10:48:41.983023+00
descriptionSystem calls and tools plugin for the Lava language
homepagehttps://lava.nu11.uk
repositoryhttps://gitlab.com/tofo/mumu-sys
max_upload_size
id1721561
size41,085
(rusty-shrimp)

documentation

README

lavasys - System plugin for mumu language

A system and process plugin for the MuMu interpreter/Lava runtime. This crate works with Linux, Mac, and Windows.

Features:

  • sys:command(cmdString, callback): runs a command in a subshell, calls back to lava and passes results to the callback.

  • sys:timestamp_ms()` : returns unix time in milliseconds.

  • sys:timestamp_micro() : returns unix time in microseconds.

  • Includes background task management for commands.

Usage

Load the plugin with extend:

extend("sys")

Dynamic functions:

// Run a command:
sys:command("ls", func (res) { printlin(res) })

// Get milliseconds since UNIX_EPOCH for time: sys:timestamp_ms()
// Get microseconds since UNIX_EPOCH for time: sys:timestamp_micro()

The callback for sys.command receives a keyed array with these keys:

  • "command": String, the command executed in shell

  • "stdout": String, stdout from the command

  • "stderr": String, STDOUT from the command

  • "exit": Int, exit code

  • "success": Bool, true if exit code = 0

Installation

Build the package:

make

Install the library:

make install

Contributing

  • Pull requests welcomed

License

MuMu and Lava are licensed under MIT and Apache License.

Commit count: 0

cargo fmt