The first systems programming language designed and built entirely in Uzbekistan. Al-Khwarizmi, born in Khiva, gave the world the algorithm. From the same soil, the next generation is building the machines that run them.
A statically-typed systems language with manual memory control, native compilation, and a built-in memory profiler. ~5,000 lines of pure C11. Zero external dependencies.
- License: Apache 2.0
- Author: Abrorbek Patidinov β Amity University Tashkent
- Current version: Bytecode v13 Β· 29/29 regression tests green (VM + Native)
AbyssLang is built on a dual-engine architecture:
- Native AOT Mode β Transpiles to C, compiles with GCC
-O3 -flto -march=native, produces a standalone ELF binary. Runs at the speed of silicon. - Resonance VM Mode β Stack-based virtual machine with computed-goto dispatch, featuring the Abyss Eye β a revolutionary built-in memory profiler that tags allocations with their source-level variable names at the opcode level, without debug symbols.
AbyssLang is 100% sovereign. The compiler is pure C11 β no Flex, no Bison, no LLVM. The standard library is written entirely in AbyssLang itself.
- β‘ Blazing fast. 6.75Γ faster than Python on verified real-world workloads (Mandelbrot, packet scanning, prime sieve).
- ποΈ The Abyss Eye HUD β call
abyss_eye();anywhere to summon a live terminal HUD. Visualizes active stack/heap memory, tracks allocation lifecycles (leak analysis), displays hex dumps, and shows the variable name you wrote in source code β propagated through a dedicatedOP_TAG_ALLOCopcode. - π§ Explicit memory control. Manual heap (
new), auto-freeing stack (stack), manualfree(). Zero garbage collection pauses. - π‘οΈ Static type checking with Option B semantics. Widening implicit, narrowing forbidden. Catches bugs at compile time without forcing explicit casts everywhere.
- π οΈ Modern syntax.
struct,enum, dynamicinterfacedispatch, tuple returns (including through interfaces), short-circuit&&/||, bitwise ops,try/catch/throw, string + number concatenation, forward references with mutual recursion. - π¦ Self-hosted standard library.
std.math,std.time,std.io,std.arrayβ written in pure AbyssLang. No external code.
Identical algorithms, identical hardware (AMD Ryzen 5 4600H, Arch Linux).
| Benchmark | AbyssLang Native | Python 3 | Speedup |
|---|---|---|---|
| Mandelbrot 800Γ600 (33.5M iter) | 0.564 s | 4.369 s | 7.74Γ |
| Packet Signature Scanner (500K) | 0.046 s | 0.369 s | 8.02Γ |
| Prime Sieve (10 M) | 0.310 s | 1.476 s | 4.76Γ |
| Total showcase runtime | 0.92 s | 6.21 s | 6.75Γ |
Reproducible from showcase_real.al and showcase_equivalent.py in the repo.
Two-pass compiler that reads .al source and emits either bytecode (.aby) or transpiled C:
- Pass 1 β Signature scan: Collects all top-level declarations (functions with their argument types, structs, enums, interfaces, globals). No bytecode emitted.
- Pass 2 β Bytecode emission: Re-walks with full symbol knowledge. Forward function references resolved via patch table. Argument types checked at every call site.
Properties:
- Lexer: Handwritten. File-context stack for multi-file imports (idempotent). Supports decimal/hex integer literals, float literals, character literals with full escape sequences, and both line (
//) and block (/* */) comments. - Parser: Recursive descent, 12-level precedence climbing. No AST β bytecode emitted directly.
- Type checker: Integrated. Every assignment, return, and call-site argument runs through
check_assign_compat()with Option B semantics.
Stack-based with computed-goto dispatch:
- Stack: 1 MiB value stack (1,048,576 Γ 64-bit slots)
- Call stack: 4,096 frames
- Exception stack: 256 frames
- Opcodes: 60+ instructions
Stack overflow, call-stack overflow, and bytecode version mismatches are all caught cleanly β never segfault.
Bytecode-to-C transpiler producing standalone native binaries:
- Each opcode β equivalent C statement
- GCC
-O3 -flto=auto -march=native - Value union
{ int64_t i; double f; void *p; }β eliminates memcpy overhead - Computed-goto jump table preserved
- Output: standalone ELF, no runtime dependencies
Requirements:
- GCC or Clang
- GNU Make
Build the toolchain:
make clean && makeOutputs:
abysscβ the compilerabyss_vmβ the virtual machine
Verify install:
bash tests/run.sh
# Expected: All 29 checks passed.Create game.al:
struct Weapon {
int damage;
str name;
}
void main() {
print("Equipping player...");
// Allocate on the stack with an Abyss Eye memory comment
Weapon sword = stack(Weapon, "Player's main sword");
sword.damage = 50;
sword.name = "Excalibur";
// String + int concatenation (v13+)
str report = "Damage: " + sword.damage;
print(report);
// Summon the Memory Resonance HUD
abyss_eye();
}
VM mode (for debugging + Abyss Eye):
./abyssc game.al game.aby
./abyss_vm game.abyNative mode (for maximum speed):
./abyssc --native game.al game_native
./game_nativeNative mode with profiler:
./abyssc --native --eye game.al game_debug
./game_debug- Statically typed:
int,float,char,str,void - Numeric literals: decimal
42, hex0xFF, float3.14, char'A'with escape sequences nullkeyword for pointer-typed variables- Block and line comments:
/* ... */and//
- Arithmetic with intβfloat auto-promotion
- Short-circuit
&&and|| - Full bitwise suite:
& | ^ ~ << >> - All compound assignments:
+= -= *= /= %= <<= >>= &= |= ^=(in statements and for-loop step) - Ternary
? :
- Three declaration forms:
void name(),int name(),function name() : (int ret) - Multiple return values (tuples), up to 8
- Forward references with mutual recursion
- Argument type checking at every call site
- Namespaced functions:
std.math.pow(2, 10)
- Heap:
new(Type, "comment"), arrays:new(Type, N) - Stack:
stack(Type)β auto-freed on return - Manual:
free(ptr) - Abyss Eye profiler:
abyss_eye();β no debug symbols needed
- Structs with nested fields and compound field assignment
- Enums with auto-increment and explicit values
- Interfaces with dynamic dispatch, including tuple returns (v13+)
- Arrays with heap allocation
try/catch/throwwith string error values- Nested try/catch with re-throwing
- Dynamic concatenation:
"hello " + name(heap-allocated) - String + number:
"x=" + 42β"x=42" - Float conversion:
"pi=" + 3.14β"pi=3.140000"
import std.math;β relative path loading- Idempotent (importing twice is free)
- Self-hosted stdlib:
std.math,std.time,std.io,std.array
For the complete language reference, see LANGUAGE_GUIDE.md.
AbyssLang ships with official VSCode support:
- Go to the
/releasesfolder. - Install
abysslang-0.2.0.vsixin Visual Studio Code. - Enjoy syntax highlighting, bracket matching, and code snippets for structs, enums, and interfaces.
29 integration tests cover the full language surface β arithmetic, floats, control flow, imports, structs, bitwise, try/catch, interfaces, arrays, tuples, forward references, mutual recursion, and every compile-time limit. Each test runs against both the VM and the native backend.
bash tests/run.shContributions are welcome. Current focus areas:
std.strβ string parsing, splitting, to_int, truncstd.fsβ file I/O beyond stdinstd.netβ socket bindingsstd.json
Please read CONTRIBUTING.md before submitting pull requests. Major architectural changes should be discussed in an Issue first.
Planned for v14 and beyond:
- Explicit cast syntax:
(int)f,(char)(n % 256) - Array literals:
int[] a = {1, 2, 3}; - Named struct literals:
Vec{x=1, y=2} - Array element-type tracking through indexing
std.math.fmod()for float modulo- Optional
--safecompile flag (bounds checks, null checks, catchable div-by-zero) - Source line/column mapping in runtime errors
- Stack traces on uncaught
throw - REPL
- Debugger (step, breakpoints, variable inspection)
- Package manager / module registry
AbyssLang is open-source and licensed under the Apache License 2.0.
See the LICENSE file. Free to use, modify, and distribute in both open-source and commercial projects.
Built from scratch. Zero dependencies. Total control. Designed and written in Tashkent, Uzbekistan.