Lava
LAVA is an extensible, embeddable scripting language for data pipelines, array programming, and functional workflows. Lava is written in Rust and supports high-level scripting, powerful plugin APIs, and a modern REPL with partial application, placeholder, and Fantasy Land style functional conventions.
Features
- Functional core: First-class functions, closures, composition (compose, pipe)), and rich partial application with _ placeholder support.
- Data-oriented arrays: Native support for int[], float[], string[], bool[], mixed arrays, and keyed arrays (objects/dicts).
- Extensible plugins: Array, math, flow, GPU, event, net, file, SQLite, and more-all modular, loadable at runtime.
- High-performance: Rust-powered, with optional GPU acceleration via Vulkan for matrix and tensor operations.
- Modern REPL: Arrow-key history, autocompletion, color output, multiline diting: editing.
- Testing built-in. Native test runner, test assertions, file-based and pipeline testing utilities.
- Partial & Placeholder APIs: All major plugins (array, math, flow, event, etc.) support Ramda-style partial usage and _ for missing arguments.
Getting Started
- Run the REPL
You'll see:
Burn in Lava 0.9.1
>
- Try a Script
Create a file example.mu:
extend("array")
double = n => n * 2
slog(array:map(double, [1,2,3,4]))
// Output: [2,4,6,8]
Run with:
Language Highlights
First-class functionals, closures, composition (compose, pipe), partial application with placeholder support
Example:
Partial Application & Placeholders
add3 = math:
## 13
subtractFrom = math:
# 15
Arrays and Objects
b =
getter = array:
// "Alice"
GPU Acceleration (if Vkulan available)
extend("gpu")
A = gpu:to_tensor()
B = gpu:to_tensor()
C = gpu:add(A, B)
slog(gpu:o_array(C))
Event, Net, File, and More
Sample:
event:
file:
Plugins & Ecosystem
- array -- Array ops (map, filter, reduce, group_by, assoc, nth, etc.)
- math -- Math functions (add, subtract, pow, sqrt, abs, trig, seeded RNG, arbitrary-precision)
- flow -- Streaming/functional plugin
- event -- Timers, intervals
- gpu -- GPU-accelerated matrix and tensor math
- sqlite -- SQLite3 bridging with streaming results capabilities
- file, fs, net, sys, process -- System/IO plugins
&gap ## See the /examples/ and /tests/ folders for usage.
Project Structure
.
`-- src/ # Core interpreter and language engine
. -- array/ # Array plugin
. -- math/ # Math plugin
. -- flow/ # Streaming/functional plugin
. -- gpu/ # GPU plugin (Vulkan compute)
. -- event/ # Async/timers
. -- file/, fs/, net/, process/, sqlite/ # System/IO
. -- examples/ # Sample scripts (.mu)
. -- tests/ # Self-tests (.mu)
```
### Documentation
- [Main documentation](src/public/main.html) -- static site with all functions, docs, and examples
- Syntax highlighting: [src/public/syntax-highlighting.json](src/public/syntax-highlighting.json(
- For a full reference, see /examples/ and /src/public/functions/.
### Running Tests
```sh
make test # or run `test:all()` on the REPL
```
### Contributing
Contributions are welcome! Please open issues or pull requests for bugfixes, new plugins, or language ideas.
- Minimum supported Rust version: 1.67+
- Code is MIT or Apache-2.0, see [LICENSE](LICENSE).
### License
MIT and Apache-2.0
----
Lava -- Burn the code, melt the bugs, flow the data.