Vel is a lightweight, embeddable scripting language interpreter written in C. It is designed as a shell-like command language with a clean syntax, built-in POSIX job control, a template engine, and a clean C embedding API.
- Command/word syntax: every statement is a command invocation
- First-class functions with lexical scoping
- Reference-counted string values with copy-on-write semantics
- Built-in POSIX job control: background jobs, pipelines, signal handling
- Embedded template engine with
<?vel ... ?>tags - Auto-execution of external programs found on
PATH - Shebang (
#!/usr/bin/env vel) support - Expression evaluator with integer overflow detection and power operator (
**) - Readline support (optional, compile-time flag)
- Clean public C API for embedding in other applications
- Cross-platform: Linux, macOS, and partial Windows support
- C11-compatible compiler (GCC or Clang recommended)
- POSIX-compatible system (Linux, macOS, BSDs)
- GNU Make
libm(standard on all Unix systems)- Optional:
libreadlinefor interactive history and line editing
makeWith readline support:
make READLINE=1sudo make installInstalls the vel binary to /usr/local/bin. Override the prefix:
sudo make install PREFIX=/usrStart the interactive REPL:
velRun a script file:
vel script.velRun from stdin (pipe):
echo "write hello" | velUse as a shebang interpreter:
#!/usr/bin/env vel
write "hello from vel"
set name "world"
write "hello $name"
func greet {who} {
write "greetings, $who"
}
greet "user"
for i {1 2 3} {
write $i
}
vel/
├── include/ # Header files (vel.h, vel_priv.h, vel_jobs.h)
├── src/ # C source files
├── docs/ # Documentation
├── tests/ # Test scripts
├── Makefile
├── LICENSE
└── README.md
Detailed documentation is provided in the docs/ directory:
| File | Description |
|---|---|
| docs/LANGUAGE.md | Language syntax, data types, and built-in commands |
| docs/EMBEDDING.md | C API reference for embedding vel in other programs |
| docs/INTERNALS.md | Architecture and internal implementation details |
| docs/JOBCONTROL.md | POSIX job control and signal handling reference |
| docs/TEMPLATE.md | Embedded template engine reference |
See LICENSE file.