A fast, type-safe, compiled (currently interpreted), and fun-to-write programming language.
- Fast
- Low-level (with managed abstractions where needed)
- Mix of functional and OOP paradigms
- Flexible (write scripts, huge monolith projects)
- Compiled/Interpreted language (supports both modes)
- Ability to generate static binaries
The Stratos C++ Interpreter is the primary implementation, featuring a handwritten recursive descent parser and AST-walking interpreter. It supports a growing Standard Library including File I/O, JSON, HTTP, SQLite/PostgreSQL/MySQL/Redis database support, regex, crypto, and more.
The Stratos Package Manager is integrated, allowing project creation (stratos new), building (stratos build), dependency management (stratos deps), and code formatting (stratos fmt).
Tooling includes a VS Code extension, IntelliJ plugin, Chrome-style DevTools (debugger, profiler, network monitor, memory inspector), an interactive web tutorial, and a documentation site.
package main;
import "std/strings";
import "std/math";
struct Point {
x: float;
y: float;
}
fn distance(a: Point, b: Point) float {
val dx = a.x - b.x;
val dy = a.y - b.y;
return math.sqrt(dx * dx + dy * dy);
}
fn main() {
val p1 = Point { x: 0.0, y: 0.0 };
val p2 = Point { x: 3.0, y: 4.0 };
println("Distance: ${distance(p1, p2)}");
val names = ["Alice", "Bob", "Charlie"];
for name in names {
println("Hello, ${strings.toUpper(name)}!");
}
}
- C++20 compiler (GCC 10+, Clang 12+)
- CMake 3.20+
- System libraries:
libssl-dev libpq-dev libmysqlclient-dev libhiredis-dev
git clone https://github.com/Arthur-Kamau/stratos.git
cd stratos/src
bash build.shThis produces src/build/stratos (the compiler/interpreter binary) and src/build/libstratos_runtime.a (static runtime library).
mkdir -p ~/bin
ln -sf "$(pwd)/src/build/stratos" ~/bin/stratos
export PATH="$HOME/bin:$PATH" # Add to ~/.bashrc to make permanentstratos new hello-world
cd hello-world
stratos run .stratos run ./examples/hello-world/
stratos run ./examples/oop-classes/
stratos run ./examples/async-demo/| Command | Description |
|---|---|
stratos run <file|dir> |
Run a Stratos program |
stratos build <dir> |
Build a project |
stratos new <name> |
Create a new project |
stratos check <file|dir> |
Syntax/semantic validation (no codegen) |
stratos fmt <file|dir> [-w] |
Format code (-w writes in-place) |
stratos test |
Run tests |
stratos doc <file> |
Generate documentation |
stratos compile <dir> |
Compile to binary |
stratos deps |
Manage dependencies |
stratos/
├── src/ # C++ interpreter/compiler source
│ ├── include/stratos/ # Header files
│ ├── src/ # Implementation (lexer, parser, runtime, etc.)
│ ├── build.sh # Linux build script
│ └── CMakeLists.txt # CMake configuration
├── std/ # Standard library (23 modules)
├── examples/ # 70+ example projects
├── external/ # External packages (cli-args, colors, linq, valid)
├── docs/ # Documentation site
├── stratos-tutorial/ # Interactive tutorial (SvelteKit + Monaco)
├── devtools/ # Chrome-style DevTools UI
├── tooling/ # IDE extensions (VS Code, IntelliJ)
├── tests/ # Test infrastructure
└── scripts/ # Install and test scripts
| Module | Description |
|---|---|
std/math |
Trigonometry, logarithms, statistics, random |
std/strings |
Case conversion, searching, splitting, replacing |
std/io |
File I/O, reading, writing |
std/fs |
File system operations, directories |
std/log |
Structured logging (debug, info, warn, error) |
std/time |
Time, duration, formatting |
std/collections |
List, Map, Set, Queue, Stack |
std/async |
Promises, async/await |
std/concurrent |
Goroutines, channels, mutex, waitgroup |
std/net |
TCP/UDP, HTTP server/client |
std/db |
SQLite, PostgreSQL, MySQL, Redis |
std/encoding |
JSON, base64, CSV, XML, YAML |
std/crypto |
Hashing, encryption |
std/regex |
Regular expressions |
std/os |
Environment, process, exec |
std/terminal |
Colors, cursor control, input |
std/testing |
Unit testing framework |
std/ffi |
Foreign function interface (C/C++) |
std/websocket |
WebSocket client/server |
std/template |
Template engine |
std/convert |
Type conversions |
std/zip |
Archive compression |
std/greeting |
Greeting utilities |
Solo Project with AI Assistance: Stratos is a solo project developed with heavy use of AI assistance (Claude Code/Gemini) throughout the language design, compiler implementation, standard library, and tooling. While this has enabled rapid development and exploration of language features, please be aware:
- This is an experimental project under active development
- The codebase may contain bugs, incomplete features, or unconventional design patterns
- Use at your own risk - not recommended for production use
- Testing coverage is limited and evolving
- Breaking changes may occur frequently as the language design evolves
If you encounter issues or have suggestions, please open an issue on GitHub. Contributions and feedback are welcome!
For syntax highlighting and language support in VS Code:
- Navigate to
tooling/vscode - Follow the instructions in
tooling/vscode/README.md
We welcome contributions! Please read CONTRIBUTING.md for:
- Development setup and building from source
- Making the
stratosbinary globally available during development - Running tests and using git hooks
- Code style guidelines and PR submission process
All code should follow the Stratos Style Guide. Use stratos fmt . -w to format your code before submitting PRs.
Stratos is distributed under the terms of the Apache License (Version 2.0) and MIT license depending on the submodule. See license folder for details.
Check the GitHub projects dashboard.
Design notes are available in docs/design/.