๐งช 120/120 tests passing โ
Externum v3.0 "Sentient"
A fully functional programming language that fuses Python's readability, binary performance, and Bash's system control into one paradigm. Compiles to three targets at once: Python, Bash, and binary.
What It Can Doโ
| Area | Support |
|---|---|
| Data types | lists, dicts, tuples, sets, f-strings, 0b/0x literals |
| Control flow | if/elif/else, while, for ... in, break/continue, try/except/finally, with, assert |
| Functions | default params, *args/**kwargs, lambdas, closures, generators (yield) |
| OOP | classes, inheritance, methods, self |
| Modules | import, own .ext modules, standard library |
| Expressions | full operator precedence, bitwise ops, ternary, comprehensions |
| Shell | inline bash `cmd` and %% ... %% blocks |
| Tooling | REPL, 3 compile targets, argv, browser playground |
Quick Startโ
git clone https://github.com/BartoszOsiej/externum.git
cd Externum
pip install -e . # Python 3.10+
externum --version # Externum 3.0.0
# Run a program
externum run examples/pokedex.ext
# Interactive shell
externum repl
Exampleโ
# fibonacci.ext
fn fibonacci(n: int) -> int {
if n <= 1 {
return n
}
return fibonacci(n - 1) + fibonacci(n - 2)
}
for i in range(20) {
print(f"fib({i}) = {fibonacci(i)}")
}
Three Compile Targetsโ
| Target | Use Case |
|---|---|
| Python | Full-featured execution with Python's ecosystem |
| Bash | System scripts, cron jobs, shell automation |
| Binary | Standalone executable, no runtime dependencies |
# Compile to all three
externum compile examples/fibonacci.ext
# Output:
# examples/fibonacci.py
# examples/fibonacci.sh
# examples/fibonacci.bin
Architectureโ
โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ
โ .ext source โโโโโโบโ Parser โโโโโโบโ AST โ
โ (Externum) โ โ (recursive โ โ โ
โ โ โ descent) โ โ โ
โโโโโโโโโโโโโโโโ โโโโโ โโโโโโโโโโโ โโโโโโโโฌโโโโโโโโ
โ
โโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโ
โผ โผ โผ
โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ
โ Python โ โ Bash โ โ Binary โ
โ transpiler โ โ transpiler โ โ compiler โ
โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ
Featuresโ
Standard Libraryโ
Written in Externum itself โ the stdlib proves the language is expressive enough to build real programs:
math.extโ math functionsstring.extโ string manipulationio.extโ file I/Olist.extโ list operationsrandom.extโ random number generation
Browser Playgroundโ
The Externum playground executes entirely in your browser โ the transpiler (written in Python) runs through WebAssembly (Pyodide), with no server at all.
Module Systemโ
# Import own modules
import utils
from math import sqrt
# Import with alias
import collections as coll
Testsโ
120/120 tests passing โ comprehensive coverage of:
- Parser correctness (all syntax constructs)
- Transpiler output (Python, Bash, binary)
- Runtime behaviour (all data types, control flow)
- Standard library functions
- Edge cases and error handling
See also: Syntax ยท Compiler ยท Architecture ยท Standard Library ยท Playground