A minimalist system programming language with Python-like syntax and C-level performance.
AXIS compiles directly to x86-64 machine code without requiring external linkers, assemblers, or runtime libraries.
curl -fsSL https://raw.githubusercontent.com/AGDNoob/axis-lang/main/installer/standalone_install.sh | bashThis will:
- ✅ Install AXIS compiler to
~/.local/bin - ✅ Set up the
axiscommand - ✅ Optionally install VS Code extension
- ✅ Configure your PATH automatically
# Clone repository
git clone https://github.com/AGDNoob/axis-lang
cd axis-lang
# Install
cd installer
./install.sh --user# Write your first program
cat > hello.axis << 'EOF'
fn main() -> i32 {
return 42;
}
EOF
# Compile to executable
axis build hello.axis -o hello --elf
# Run
./hello
echo $? # Output: 42AXIS follows four core principles:
- Zero-Cost Abstractions – You only pay for what you use
- Explicit Control – Stack, memory, and OS interactions are visible
- Direct Mapping – Source code maps predictably to assembly
- No Magic – No hidden allocations, no garbage collector, no virtual machine
- Learnable in ≤1 week – Small, focused language
- Immediately productive – Build real programs from day one
- Predictable performance – Performance ceiling = C/C++
- Systems access – Direct syscalls, full OS integration
AXIS provides hardware-native integer types with explicit sizing:
// Signed integers
i8 // -128 to 127
i16 // -32,768 to 32,767
i32 // -2,147,483,648 to 2,147,483,647
i64 // -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807
// Unsigned integers
u8 // 0 to 255
u16 // 0 to 65,535
u32 // 0 to 4,294,967,295
u64 // 0 to 18,446,744,073,709,551,615
// Other types
bool // 0 or 1 (u8)
ptr // 64-bit pointerType safety: All variables must be explicitly typed. No implicit conversions.
// Immutable by default
let x: i32 = 10;
// Mutable variables
let mut y: i32 = 20;
y = y + 5; // OK
// Initialization is optional
let z: i32; // Uninitialized (use with care)// Basic function
fn add(a: i32, b: i32) -> i32 {
return a + b;
}
// No return value
fn print_something() {
// ...
}
// Entry point (must return i32)
fn main() -> i32 {
return 0;
}Calling convention: System V AMD64 (Linux)
- First 6 arguments:
rdi,rsi,rdx,rcx,r8,r9 - Return value:
rax(oreaxfor i32)
fn abs(x: i32) -> i32 {
if x < 0 {
return -x;
} else {
return x;
}
}
// Without else
fn positive_check(x: i32) -> bool {
if x > 0 {
return 1;
}
return 0;
}fn count() -> i32 {
let mut i: i32 = 0;
while i < 10 {
i = i + 1;
}
return i; // 10
}fn find_even() -> i32 {
let mut i: i32 = 0;
while i < 100 {
i = i + 1;
if i == 50 {
break; // Exit loop
}
if i < 10 {
continue; // Skip to next iteration
}
}
return i;
}let a: i32 = 10 + 5; // Addition
let b: i32 = 10 - 5; // Subtraction
let c: i32 = 10 * 5; // Multiplication (MVP: not implemented)
let d: i32 = 10 / 5; // Division (MVP: not implemented)
let e: i32 = -10; // Negationx == y // Equal
x != y // Not equal
x < y // Less than
x <= y // Less than or equal
x > y // Greater than
x >= y // Greater than or equalAll comparisons return bool (0 or 1).
x = y // Simple assignment
x = x + 1 // Compound expression// Decimal
let dec: i32 = 42;
// Hexadecimal
let hex: i32 = 0xFF; // 255
let hex2: i32 = 0x1A2B; // 6699
// Binary
let bin: i32 = 0b1010; // 10
let bin2: i32 = 0b11111111; // 255
// Negative
let neg: i32 = -100;
// Underscores for readability (ignored)
let big: i32 = 1_000_000;// Single-line comments only
// Multi-line comments: use multiple single-line comments
fn example() -> i32 {
// This is a comment
let x: i32 = 10; // Inline comment
return x;
}┌─────────────────────┐
│ Source Code │ .axis file
└──────────┬──────────┘
│
▼
┌─────────────────────┐
│ Lexer │ tokenization_engine.py
│ (Tokenization) │ → Token stream
└──────────┬──────────┘
│
▼
┌─────────────────────┐
│ Parser │ syntactic_analyzer.py
│ (Syntax Analysis) │ → Abstract Syntax Tree (AST)
└──────────┬──────────┘
│
▼
┌─────────────────────┐
│ Semantic Analyzer │ semantic_analyzer.py
│ (Type Checking) │ → Annotated AST
└──────────┬──────────┘ → Symbol table
│ → Stack layout
▼
┌─────────────────────┐
│ Code Generator │ code_generator.py
│ (x86-64) │ → Assembly instructions
└──────────┬──────────┘
│
▼
┌─────────────────────┐
│ Assembler │ tets.py
│ (Machine Code) │ → Raw x86-64 machine code
└──────────┬──────────┘
│
▼
┌─────────────────────┐
│ ELF64 Generator │ executable_format_generator.py
│ (Executable) │ → Linux executable
└─────────────────────┘
No runtime library. AXIS executables contain only:
- ELF64 Header (64 bytes)
- Program Header (56 bytes)
- _start stub (16 bytes) – Calls
main()and invokesexitsyscall - User code – Your compiled functions
Entry point:
_start:
xor edi, edi ; argc = 0
call main ; Call user's main()
mov edi, eax ; exit_code = main's return value
mov eax, 60 ; syscall: exit
syscall ; exit(code)Virtual address space:
- Base:
0x400000(4MB, Linux standard) - Code:
0x401000(page-aligned at 4KB) - Stack: Grows downward from high addresses
Function frame:
[rbp+0] = saved rbp
[rbp-4] = first local variable (i32)
[rbp-8] = second local variable
...
Stack size is computed at compile-time and 16-byte aligned.
Prerequisites:
- Operating System: Linux x86-64 (Ubuntu, Debian, Fedora, Arch, openSUSE, etc.)
- Python: 3.7 or higher
- Not supported: Windows, macOS, ARM/ARM64
git clone https://github.com/AGDNoob/axis-lang
cd axis-langNo additional dependencies required (Python 3.7+ only).
Generate ELF64 executable (Linux):
python compilation_pipeline.py program.axis -o program --elf
chmod +x program
./programGenerate raw machine code:
python compilation_pipeline.py program.axis -o program.binVerbose output (show assembly):
python compilation_pipeline.py program.axis -o program --elf -vHex dump only (no output file):
python compilation_pipeline.py program.axisAXIS includes a VS Code extension for syntax highlighting.
Install:
# Extension is already installed in: axis-vscode/
# Reload VS Code (Ctrl+Shift+P → "Developer: Reload Window")Features:
- Syntax highlighting for
.axisfiles - Auto-closing brackets
- Line comments via
Ctrl+/ - Build task:
Ctrl+Shift+B
fn main() -> i32 {
return 42;
}$ python compilation_pipeline.py hello.axis -o hello --elf
$ ./hello
$ echo $?
42fn main() -> i32 {
let x: i32 = 10;
let y: i32 = 20;
let z: i32 = x + y;
return z; // 30
}fn factorial(n: i32) -> i32 {
let mut result: i32 = 1;
let mut i: i32 = 1;
while i <= n {
result = result * i;
i = i + 1;
}
return result;
}
fn main() -> i32 {
return factorial(5); // 120
}fn max(a: i32, b: i32) -> i32 {
if a > b {
return a;
}
return b;
}
fn clamp(x: i32, min: i32, max: i32) -> i32 {
if x < min {
return min;
}
if x > max {
return max;
}
return x;
}fn is_prime(n: i32) -> bool {
if n <= 1 {
return 0;
}
let mut i: i32 = 2;
while i < n {
// Note: modulo operator not implemented in MVP
// This is pseudocode for demonstration
i = i + 1;
}
return 1;
}
fn count_primes(limit: i32) -> i32 {
let mut count: i32 = 0;
let mut i: i32 = 2;
while i < limit {
if is_prime(i) == 1 {
count = count + 1;
}
i = i + 1;
}
return count;
}
fn main() -> i32 {
return count_primes(100);
}Arguments:
| Position | i32 Register | i64 Register |
|---|---|---|
| 1st | edi | rdi |
| 2nd | esi | rsi |
| 3rd | edx | rdx |
| 4th | ecx | rcx |
| 5th | r8d | r8 |
| 6th | r9d | r9 |
| 7+ | Stack | Stack |
Return value: eax (i32) or rax (i64)
Preserved registers: rbx, rbp, r12-r15
Offset | Size | Section
--------|------|-------------------
0x0000 | 64 | ELF Header
0x0040 | 56 | Program Header (PT_LOAD)
0x0078 | ... | Padding (to 0x1000)
0x1000 | 16 | _start stub
0x1010 | ... | User code
Entry point: 0x401000 (_start)
Currently implemented:
exit(code): rax=60, rdi=exit_code
Planned:
write(fd, buf, len): rax=1read(fd, buf, len): rax=0
- ELF64 executable format
- Stack-based local variables
- Control flow (if/else, while, break, continue)
- Arithmetic (
+,-) - Comparisons (
==,!=,<,>,<=,>=) - Function calls (basic)
- Integer types (i8-i64, u8-u64)
- Mutable/immutable variables
- VS Code syntax highlighting
Compilation:
- ~100ms for small programs (< 100 lines)
- No external tools required
Runtime:
- Zero overhead – No runtime library
- Direct syscalls – No libc indirection
- Native machine code – Same performance as C/C++
- Minimal binary size – ~4KB + code size
Comparison:
| Metric | AXIS | C (gcc) | Python |
|---|---|---|---|
| Startup time | <1ms | <1ms | ~20ms |
| Binary size | ~4KB | ~15KB | N/A |
| Runtime deps | None | libc | CPython |
| Compilation | ~100ms | ~200ms | N/A |
axis-lang/
├── tokenization_engine.py # Lexer
├── syntactic_analyzer.py # Parser + AST
├── semantic_analyzer.py # Type checker + Symbol table
├── code_generator.py # x86-64 code generator
├── executable_format_generator.py # ELF64 writer
├── compilation_pipeline.py # Main compiler driver
├── tets.py # Assembler backend
├── axis-vscode/ # VS Code extension
│ ├── package.json
│ ├── language-configuration.json
│ └── syntaxes/
│ └── axis.tmLanguage.json
├── tests/ # Test programs
│ ├── test_arithmetic.axis
│ ├── test_control_flow.axis
│ └── syntax_test.axis
├── .vscode/
│ └── tasks.json # Build tasks
└── README.md
AXIS is an experimental language project. Contributions welcome!
Areas of interest:
- Standard library design
- Optimization passes
- Language Server Protocol
- More architectures (ARM64, RISC-V)
- Windows support (PE format)
MIT License
Recommended reading:
Similar projects:
- Zig – Systems language with manual memory management
- Odin – Simple, fast, modern alternative to C
- V – Fast compilation, minimal dependencies
Built with precision. No runtime overhead. Pure machine code.
AXIS – Where Python meets the metal.