# Using installed version (after deno install)
subaru example.gleam
subaru --code 'import gleam/io
pub fn main() { io.println("Hello from WASM!") }'
# Using direct URL execution
deno run --allow-all https://github.com/Comamoca/subaru/raw/main/src/cli.ts example.gleam
# Using local development version
deno task cli example.gleam
deno task cli --code 'import gleam/io
pub fn main() { io.println("Hello from WASM!") }'
# Execute remote script
subaru --url https://example.com/script.gleam- Execute Gleam files directly without compilation
- Run Gleam code from strings, files, or remote URLs
- Dynamic compilation using Gleam's WebAssembly compiler
- Worker-based execution for safe code isolation
- Configurable logging and debug output
- Preloaded Standard Libraries - Automatic access to essential Gleam modules
- Echo Keyword Support - Full support for Gleam v1.11.0's debugging features
# Install globally
deno install --allow-all -n subaru https://github.com/Comamoca/subaru/raw/main/src/cli.ts
# Run from anywhere
subaru --help
subaru example.gleam
subaru --code 'import gleam/io
pub fn main() { io.println("Hello!") }'# Run directly from GitHub without installation
deno run --allow-all https://github.com/Comamoca/subaru/raw/main/src/cli.ts --help
# Execute Gleam code
deno run --allow-all https://github.com/Comamoca/subaru/raw/main/src/cli.ts --code 'import gleam/io
pub fn main() { io.println("Hello from URL!") }'# Clone repository
git clone https://github.com/Comamoca/subaru
cd subaru
# Setup (download Gleam WASM compiler)
deno task setup
# Run CLI
deno task cli --helpgit clone https://github.com/Comamoca/subaru
cd subaru
deno task setup# Using Nix (recommended)
nix develop
# Or with direnv
direnv allow
# Manual setup
deno task setup
# Development commands
deno task dev # Setup and run development environment
deno task test # Run all tests
deno task example # Run usage examples
deno task fmt # Format code
deno task lint # Lint code
deno task check # Type checkAll these libraries are automatically available without imports:
import gleam/io
import gleam/list
import gleam/string
import gleam/int
import gleam/result
pub fn main() {
// List operations
[1, 2, 3, 4, 5]
|> list.map(fn(x) { x * 2 })
|> echo // [2, 4, 6, 8, 10]
|> list.filter(fn(x) { x > 5 })
|> echo // [6, 8, 10]
// String operations
"Hello, Gleam!"
|> string.uppercase()
|> io.println() // HELLO, GLEAM!
// Result operations
let result = case int.parse("42") {
Ok(num) -> "Parsed: " <> int.to_string(num)
Error(_) -> "Parse failed"
}
io.println(result) // Parsed: 42
}- Add more comprehensive error handling
- Implement module caching for better performance
- Add support for custom Gleam compiler versions
- Create VSCode extension for Gleam WASM execution
- Add streaming execution for large outputs
- Implement code completion and syntax highlighting
- Add benchmark suite for performance testing
- Support for additional output formats (JSON, XML, etc.)
MIT License - see LICENSE file for details.
This project is open source and available under the MIT License.
- Deno Standard Library - File system, path utilities, testing
- Gleam WASM Compiler - Dynamic Gleam compilation to JavaScript
- Nix Flakes - Reproducible development environment management
- devenv - Development shell configuration and tooling
- pre-commit hooks - Security scanning (git-secrets, ripsecrets)
- treefmt - Automated code formatting across languages
- Gleam Language - Functional language for building type-safe systems that inspired this project
- Deno - Modern runtime that enabled TypeScript-first development
- WebAssembly - Binary instruction format that makes dynamic compilation possible
- Gleam Team - For creating an amazing functional language with excellent WASM support
- Deno Team - For providing a fantastic development experience with TypeScript
- WebAssembly Community - For enabling dynamic compilation and safe execution in browsers
- Nix Community - For reproducible development environments and excellent tooling
- Open Source Contributors - For all the libraries and tools that made this project possible