A statically typed programming language and compiler built with Python and LLVM.
Nova is designed to provide a simple programming experience while compiling programs to native code through LLVM.
Nova is a compiled programming language with its own language syntax, compiler frontend, type system, and LLVM-based backend.
The project explores how a programming language works internally — from source code and lexical analysis to parsing, semantic analysis, type checking, and LLVM-based code generation.
Source Code
│
▼
Lexer
│
▼
Parser
│
▼
AST
│
▼
Semantic Analysis
│
▼
Type Checking
│
▼
LLVM IR
│
▼
Native Code
Nova was built to explore compiler design and understand how high-level programming languages are translated into executable code.
The language combines:
- Simple syntax
- Static typing
- Structured programming
- Top-level scripting
- LLVM-based compilation
- Native code generation
Nova currently includes language features such as:
- Variables
- Static types
- Functions
- Structs
- Arrays
- Control flow
- Top-level scripting
- Input and output
- Type checking
- LLVM-based code generation
A simple Nova program:
struct Point {
int x
int y
}
print("Hello, Nova!")
string name = input("Enter name: ")
func greet(string n) -> int {
print("Welcome,", n)
return 0
}
greet(name)
Nova supports both simple top-level scripts and structured programs using functions and types.
The lexer converts source code into a sequence of tokens that can be processed by the compiler.
Source Code
↓
Tokens
The parser consumes the tokens and constructs the program's abstract syntax tree.
Tokens
↓
Parser
↓
AST
The AST represents the structure and meaning of the source program in a form that later compiler stages can process.
Semantic analysis validates the program beyond syntax.
This stage handles language-level checks required before code generation.
Nova uses static typing to detect type-related errors during compilation rather than waiting until runtime.
The compiler generates LLVM Intermediate Representation (LLVM IR) as the backend representation.
Nova Source
↓
Compiler Frontend
↓
LLVM IR
↓
LLVM Backend
↓
Native Code
LLVM provides the infrastructure required to transform the generated IR into native executable code.
Download the latest release and extract the archive.
Then run:
nova hello.nvNova can be packaged into an executable using PyInstaller.
pyinstaller --onefile --name nova --add-data "runtime;runtime" --add-data "compiler;compiler" cli/nova.py./build.shCreate a Nova source file:
hello.nv
Add:
print("Hello, Nova!")
Then run:
nova hello.nvThe compiler processes the source program and uses LLVM as the compilation backend.
- Python — compiler implementation
- LLVM — intermediate representation and compilation backend
- LLVM IR — intermediate representation
- PyInstaller — executable packaging
Building Nova provided hands-on experience with:
- Compiler architecture
- Lexical analysis
- Parsing
- Abstract syntax trees
- Semantic analysis
- Static type checking
- Intermediate representations
- LLVM IR
- Code generation
- Language design
- Building developer tools from scratch
Nova is an ongoing compiler project.
The current implementation supports core language constructs, static typing and LLVM-based compilation. The language and compiler architecture are still evolving as new features and improvements are explored.
Potential areas for future development include:
- Expanding the type system
- Improving compiler diagnostics
- Additional language constructs
- More optimisation work
- Standard library development
- Improved tooling
- Better compiler error messages