AK CODE is a ground-up programming language built entirely in x86-64 assembly — no borrowed VM, no interpreter, no C runtime. Everything from the bootstrap compiler to the standard library is built from scratch.
| Feature | Example |
|---|---|
| Natural syntax | if age is greater than 18 then show "Adult" |
| No punctuation clutter | No semicolons, no curly braces |
| Variables | let name = "Alice" |
| Constants | always PI = 3.14159 |
| Lists | let items = list of "apple" "banana" "cherry" |
| Maps | let config = map key is value end |
| Functions | define greet taking name and age |
| Classes | make kind called Animal |
| Error handling | try / catch / finally |
| Pattern matching | match value when it is |
| Concurrency | do in background / wait for |
| Modules | bring in math |
stdlib/
├── ai/ Neural networks, tensors, optimizers, tokenizers
├── core/ IO, strings, lists, maps, memory, numbers, sets, errors
├── math/ Algebra, calculus, matrices, statistics, symbolic, visualization
├── web/ HTTP server/client, routing, HTML/CSS, JSON, WebSocket, templates
├── database/ SQL, NoSQL, ORM
├── os/ File I/O, networking, processes, threads
├── ui/ Windows, widgets, canvases, layouts
└── test/ Unit testing framework
- Bootstrap compiler: x86-64 assembly via NASM
- Output: Linux ELF binaries + Windows PE/COFF executables
- Runtime: Custom malloc, garbage collection, print, I/O — all from scratch
- No dependencies: Zero external libraries required
| Tool | Required For |
|---|---|
| NASM | Assembling the bootstrap compiler |
ld (GNU ld) |
Linking Linux binaries |
MSVC link.exe + kernel32.lib |
Linking Windows binaries |
Linux:
chmod +x build.sh
./build.shWindows:
build.bat# hello.ak
show "Hello from AK CODE!"
let name = ask "What's your name?"
show "Welcome," name "!"./build/akc hello.ak -o hello
./helloshow "Hello, World!"define fibonacci taking n
if n is less than 2 then
give back n
end
give back fibonacci with n minus 1 plus fibonacci with n minus 2
end
let result = fibonacci with 10
show "Fibonacci(10) =" resultbring in web.server
bring in web.router
let app = router new
app get "/" give
give back "Welcome to AK CODE Web!"
end
app get "/api/hello" give
give back json of map
message is "Hello from AK CODE"
version is "1.0"
end
end
server start with port 8080 and router app
show "Server running at http://localhost:8080"bring in ai.model
bring in ai.layer
bring in ai.optimizer
let model = neural network new
model add layer of type dense with 784 inputs and 128 outputs
model add layer of type relu
model add layer of type dense with 128 inputs and 10 outputs
model add layer of type softmax
model compile with optimizer "adam" and loss "categorical_crossentropy"
model train on dataset for 10 epochs┌─────────────────────────────────────────────────────┐
│ AK CODE Compiler │
│ │
│ ┌─────────┐ ┌──────────┐ ┌───────────┐ ┌──────┐ │
│ │ Lexer │→ │ Parser │→ │ Codegen │→ │ Link │ │
│ │ (asm) │ │ (asm) │ │ (asm) │ │(glue)│ │
│ └─────────┘ └──────────┘ └───────────┘ └──────┘ │
│ │ │ │ │
│ ▼ ▼ ▼ │
│ tokens AST x86-64 asm ELF/PE │
│ │
│ ┌────────────────────────────────────────────────┐ │
│ │ Runtime Library │ │
│ │ malloc │ GC │ print │ IO │ type info │ math │ │
│ └────────────────────────────────────────────────┘ │
└─────────────────────────────────────────────────────┘
│
▼
┌─────────────────┐ ┌──────────────────┐
│ Stage 2 Compiler│ │ AK CODE IDE │
│ (written in AK) │ │ (written in AK) │
└─────────────────┘ └──────────────────┘
│
▼
┌─────────────────────────────────────────────────┐
│ Standard Library │
│ AI │ Web │ Database │ Math │ OS │ UI │ Testing │
└─────────────────────────────────────────────────┘
- Lexer (
asm/lexer.asm) — Tokenises AK CODE source into tokens - Parser (
asm/parser.asm) — Recursive-descent parser builds AST - Codegen (
asm/codegen.asm) — Generates x86-64 machine code - Linker Glue (
asm/linker_glue.asm) — Wraps into ELF or PE/COFF binary - Runtime (
asm/runtime.asm) — Built-in malloc, GC, print, I/O
The Stage 2 compiler (compiler/) is written in AK CODE itself — once the bootstrap compiler is stable, AK CODE will compile itself.
- Phase 0: Project structure & build system
- Phase 1: Complete language specification (900+ lines)
- Phase 2: Assembly bootstrap compiler (lexer, parser, codegen, runtime)
- Phase 3: Stage-2 compiler written in AK CODE (compiler/)
- Phase 4: Standard library (stdlib/)
- Phase 5: AK CODE IDE with multi-agent AI panel (ide/)
- Phase 6: Advanced compiler optimisations (O1, O2, O3)
- Phase 7: Package manager (
akpkg) - Phase 8: Language server protocol (LSP) support
- Phase 9: Self-hosting — compiler compiles itself
- Phase 10: WASM backend & browser playground
akcode/
├── asm/ # Bootstrap compiler (x86-64 assembly)
│ ├── lexer.asm # Tokeniser
│ ├── parser.asm # Recursive-descent parser
│ ├── codegen.asm # x86-64 code generator
│ ├── runtime.asm # Runtime library
│ └── linker_glue.asm # ELF/PE binary builder
├── compiler/ # Stage-2 compiler (written in AK CODE)
├── stdlib/ # Standard library
│ ├── ai/ # Neural networks, ML
│ ├── math/ # Algebra, calculus, stats
│ ├── web/ # HTTP, routing, templates
│ ├── database/ # SQL, NoSQL, ORM
│ ├── os/ # File, network, process
│ └── ui/ # Windows, widgets, canvas
├── ide/ # AK CODE IDE
│ ├── editor/ # Code editor with syntax highlighting
│ ├── agents/ # Multi-agent AI panel
│ ├── build/ # Build system & debugger
│ └── ui/ # IDE user interface
├── tests/ # Test suite
├── docs/ # Documentation
│ └── spec/ # Language specification
├── assets/ # Branding assets
├── build.bat # Windows build script
├── build.sh # Linux build script
└── README.md # This file
| Document | Description |
|---|---|
| Language Specification | Complete language specification (900+ lines) |
| Standard Library API | Full stdlib API reference |
| Syntax Reference | Quick syntax reference |
| Hello World Tutorial | Getting started guide |
| Web App Tutorial | Building a web application |
| AI Tutorial | Training a neural network |
AK CODE is at an early stage and contributions are welcome! See CONTRIBUTING.md for guidelines.
- Report bugs — Open an issue
- Suggest features — Start a discussion
- Write code — Fork and submit a PR
- ⭐ Star this repo — helps others discover it
- 🐛 Report issues — I respond within 24 hours
- 📬 Share feedback — contact@jaytechsoln.in
- ☕ Buy me a coffee — Sponsor
Made with ❤️ by Aswin Jay — part of JAY TECH SOLUTIONS
This project is licensed under the MIT License — see LICENSE for details.