A modern low-level programming language with clear error messages and fast builds
Why? • Performance • Getting Started • Usage • More docs
Apart from learning how compilers work because I love understanding how things run under the hood my idea with Orn is to create a strongly typed programming language with a clean and friendly syntax. Something that feels like TypeScript but also gives you the tools to work low-level with pointers and manual memory management
I also want fast compilation and great error feedback because clear errors save time and make development smoother instead of spending hours trying to figure out some cryptic Exxxx message
Right now Orn looks more like a scripting language with an imperative style but in the future I would love to add OOP like TypeScript does. It is far from done but that is the plan
Many low-level languages have steep learning curves that intimidate developers coming from high-level backgrounds. Orn tries to bridge that gap by offering
- Modern syntax – TypeScript-style type annotations with
constandletthat add a new layer of safety - Clear error feedback – Error messages are precise and tell you exactly what went wrong
- Low-level control – Direct access to memory and performance-critical operations
- Compiled – Runs fast instead of being interpreted like
js,tsorpython - Strong type guarantees – Minimize runtime surprises with a solid type system
- Gradual learning curve – Start with high-level concepts and dive into low-level details as needed
Orn now builds projects module by module, resolving imports and generating optimized code:
Entry Module
│
▼
Read File
│
▼
Module Discovery & Imports ──► Recursive for dependencies
│
▼
Lexical Analysis (lex)
│
▼
Parsing (ASTGenerator)
│
▼
Type Checking & Symbol Table
│
▼
Export Extraction (module interface)
│
▼
IR Generation
│
▼
IR Optimization (optional)
│
▼
Assembly Generation (.s)
│
▼
Object File Compilation (.o via gcc)
│
▼
Linking (gcc -no-pie -nostdlib)
│
▼
Executable
Notes:
- Modules are topologically sorted so dependencies compile first
- Interfaces allow modules to know what imports provide
- IR is optimized per module before generating assembly
- Final executable is linked from all compiled modules
- GCC or Clang
- CMake (3.10+)
- Git
git clone https://github.com/pabloosabaterr/Orn.git
cd Orn
mkdir build && cd build
cmake ..
cmake --build ../orn --helpThis will show all available options and usage examples.
fn fibonacci(n: int) -> int {
if (n <= 1) {
return n;
};
return fibonacci(n-1) + fibonacci(n-2);
}
const result: int = fibonacci(10);
print(result);Orn provides actionable error messages:
error [E2005]: cannot assign to constant (x)
--> source.orn:2:1
|
2 | x = 20;
| ^
|
= help: assignment to immutable value
= note: constants cannot be modified after initialization
= suggestion: use a mutable variable instead
error [E1001]: mismatched types (x)
--> source.orn:2:11
|
2 | const x: int = "hello";
| ^^^^^^^
|
= expected `int`, found `string`
= note: string literals cannot be assigned to int variables
= suggestion: change variable type or cast the value
We welcome contributors and feedback!
- Visit the GitHub repository
- Report issues on the issue tracker
- Join our Discord
- If you want to contribute please read Contribution guidelines
Built with ❤️
