Crates.io | std-mumu |
lib.rs | std-mumu |
version | 0.1.1 |
created_at | 2025-08-12 13:04:47.220882+00 |
updated_at | 2025-08-12 13:04:47.220882+00 |
description | Standard input/output tools for MuMu/Lava |
homepage | |
repository | https://gitlab.com/tofo/mumu-std |
max_upload_size | |
id | 1791972 |
size | 42,527 |
Standard Input/Output Plugin for MuMu/Lava
#License: MIT OR Apache-2.0](LICENSE)
mumu-std* provides classic and stream-oriented input/output functions for the MuMu/Lava scripting language.
\nIt delivers essential tools like printing, logging, blocking input, and interactive input streams-all as a plugin loaded at runtime.
std:put(value)
\t- Print without newline (print
)
std:log(value)
- Print with newline (println_
)
std:input(prompt)
- Prompt the user and read a line (blocking)
std:input_iter()
- Stream user input lines as an InkIterator (for use in pipelines or functional flows)
Clone and build this crate as you would any MuMu/Lava plugin:
git clone https://gitlab.com/tofo/mumu-std.git
cd mumu-std
make
sudo make install
This copies libmumustd.so
to /usr/local/lib/
.
In your Lava script or REPL, load the plugin:
load_library("std")
Basic Printing and Input
`lava extend("std")
std:put("Hello, ") std:log("world!") # Outputs: Hello, world!\n
name = std:input("Enter your name: ") std:log("Welcome, " + name)
----
### Stream (Iterator) Input Example
Use `std:input_iter()` to create an iterator over lines from the user (or from piped input):
`lava
extend("std")
inp = std:input_iter()
std:log("Type lines (Ctrl-D to end):")
while (line = inp()) != "_END_"
\t std:log("> " + line)
[Note: The iterator yields one line per call, as a string. Returns "END" (or errors) when no more data. ]
value
to stdout without a newline. std:put("Count: ")
value
to stdout with a newline.std:log("Done!")
prompt
string, waits for a line of user input, and returns it as a string.line = std:input("Next command> ")
while
loops, and partial application.std:put
/std:log` follow Rust/Python/JS idioms.std:input_iter
matches Lava's stream/InkIterator conventions.Dual-licensed under MIT and Apache-2.0 (your choice).
See LICENSE for full details.
>= 0.11.0
put
, log
, input
, input_iter
implemented.This project is part of the Lava ecosystem. Big thanks to everyone in the open source and MuMu/Lava community.