Strada Documentation
Everything you need to master Strada programming.
Getting Started
REPL & Scripting
Interactive shell for experimentation and quick scripts without compilation.
Interpreter
Tree-walking interpreter for scripts and embedded eval — no C compiler needed.
Language Guide
Types & Variables
Understand Strada's type system: int, num, str, array, hash, and sigils.
Control Flow
Conditionals (if/unless), loops (while/until/for/foreach), statement modifiers, redo, map/grep/sort, and exception handling.
Regular Expressions
Pattern matching, substitution, captures, and text processing with regex.
Advanced
Memory Management
Automatic reference counting, object destruction, and performance optimization.
Debugging
Inspect variables with dumper, trace call stacks, and profile function performance.
Async/Await
Thread pool concurrency with async functions, futures, all(), race(), timeouts, and cancellation.
C Interoperability
Embed C code with __C__ blocks, create shared libraries, and interface with C APIs.
Libraries Guide
Create and use reusable libraries with import_lib (dynamic) and import_object (static).
Perl Integration
Embed Perl in Strada programs or call Strada from Perl. Access CPAN modules.
Reference
Built-in Functions
Complete reference for all built-in functions organized by category.
Compilation
Strada compiles to C, which is then compiled to native executables:
# One-step compilation (recommended)
./strada program.strada # Creates ./program executable
./strada -r program.strada # Compile and run
./strada -c program.strada # Keep generated .c file
./strada -g program.strada # Include debug symbols
./strada --shared lib.strada # Create shared library (.so)
# Two-step compilation (manual)
./stradac input.strada output.c
gcc -o output output.c runtime/strada_runtime.c -Iruntime -ldl -lm
./output
Project Structure
| Directory | Description |
|---|---|
compiler/ |
Self-hosting compiler source (Lexer, Parser, AST, CodeGen) |
runtime/ |
C runtime library (StradaValue, reference counting, built-ins) |
bootstrap/ |
Bootstrap compiler in C (used only to build self-hosting compiler) |
interpreter/ |
Tree-walking interpreter driver (REPL and file execution) |
examples/ |
Example programs demonstrating language features |
cannoli/ |
Web framework source and examples |
lib/ |
Standard library modules (ssl, etc.) |
t/ |
Test suite (124 tests) |
Testing
# Run all tests
make test-suite
# Verbose output
make test-suite V=1
# TAP format for CI/CD
make test-suite TAP=1
# Run specific tests
./t/run_tests.sh string # Tests matching "string"
./t/run_tests.sh -v oop # Verbose OOP tests