Welcome to Loom, a modern, concurrent, and shell-aware programming language designed for building powerful developer tools, command-line utilities, and rapid prototyping. Loom blends the expressiveness of Python, the concurrency of Go, and the shell scripting capabilities of Bash into a single, cohesive language.
- Task-Based Concurrency: Native support for lightweight tasks and structured concurrency.
- Shell Integration: First-class citizen. Execute shell commands, pipe output, and handle exit codes seamlessly with interpolation.
- Frame-Based Objects: A flexible object system using "Frames" (structs) and "Act" blocks (methods).
- Safe Execution: Strong type checking (compiled via
weave) and robust error handling (Result<T>,Option<T>). - Interpret or Compile: Use
loom runfor rapid iteration orloom weaveto compile to a standalone binary for performance and distribution.
If you wish to quickly install via cURL, you can do so:
curl -s https://virex.lol/loom/install.sh | bashLoom is built in Rust. To install, make sure you have Rust and Cargo installed, then clone this repository and build:
git clone https://github.com/virex/loom-programming-language.git
cd loom-programming-language
./build_and_install.shThe binary will be located at target/release/loom-lang, and $HOME/.local/bin if using the installer.
Running a script:
Not in path:
cargo run -- program.lmInstalled:
loom program.lmCompiling to a binary:
Not in path:
cargo run -- weave program.lm -o binary
./binaryInstalled:
loom weave program.lm -o binary
./binary// A simple Loom shell focused program
act main() {
print("testing basic shell...")
let res = $ "echo hello world"
print("stdout: " + res.stdout)
print("status: " + res.status)
print("testing interpolation...")
let name = "loom"
let cmd = "echo hello {name}"
let res2 = $ cmd
print("stdout: " + res2.stdout)
print("testing stderr and error status...")
let res3 = $ "ls non_existent_file_12345"
print("status: " + res3.status)
print("stderr: " + res3.stderr)
print("testing complex expression...")
let res4 = $ ("echo " + "joined " + "string")
print("stdout: " + res4.stdout)
}
main()
- Tutorial: Build a System Monitor: A step-by-step guide to building a real CLI tool.
- Language Guide: Syntax, Types, Control Flow, Frames, and Functions.
- Shell Scripting: Using the
$operator, interpolation, andShellOutput. - Concurrency: Tasks,
spawn, andawait.
Loom is designed for speed where it matters most—in shell operations and string handling. The weave compiler provides a significant performance boost for computational tasks.
| Test | Interpreted | Weaved (Native) | Improvement | Notes |
|---|---|---|---|---|
| Fibonacci (35) | ~61,051ms | ~1,209ms | ~50.5x 🚀 | Deep recursion overhead reduction |
| String Stress | ~627ms | ~305ms | ~2.0x | 100,000 sequential concatenations |
| Shell Stress | ~3,449ms | ~3,392ms | Negligible | Bottlenecked by OS process spawning |
| Sieve (1M) | ~5,807ms | ~840ms | ~6.9x | Array access and memory optimization |
Benchmarks conducted on a modern Linux environment. Weaved results are compiled to a standalone Rust binary.
MIT License. See LICENSE for details.