Skip to content

danko1122q/vel-shell

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

vel

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.

Features

  • 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

Requirements

  • C11-compatible compiler (GCC or Clang recommended)
  • POSIX-compatible system (Linux, macOS, BSDs)
  • GNU Make
  • libm (standard on all Unix systems)
  • Optional: libreadline for interactive history and line editing

Building

make

With readline support:

make READLINE=1

Installation

sudo make install

Installs the vel binary to /usr/local/bin. Override the prefix:

sudo make install PREFIX=/usr

Usage

Start the interactive REPL:

vel

Run a script file:

vel script.vel

Run from stdin (pipe):

echo "write hello" | vel

Use as a shebang interpreter:

#!/usr/bin/env vel
write "hello from vel"

Quick Example

set name "world"
write "hello $name"

func greet {who} {
    write "greetings, $who"
}
greet "user"

for i {1 2 3} {
    write $i
}

Project Structure

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

Documentation

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

License

See LICENSE file.

About

embeddable scripting language in C11, POSIX job control, and built-in shell utilities.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors