Architecture & Core Features
1. Python Frontend
The compiler toolchain is entirely Python-based. The robust regex scanner successfully tokenizes keywords, operators, and data types, utilizing explicit Enum token categories while expertly handling Python-style indentation mapping (INDENT/DEDENT scopes).
2. Low-Level Power
Ion+ is built for systems programming. The syntax explicitly supports strict typing (int, float, byte), pointer manipulation (ptr), bitwise operations, custom struct and enum definitions, and memory allocation handling.
3. Future LLVM Backend
The intended compiler pipeline is strictly defined: Python Frontend → Parser/AST → Semantic Validation → LLVM IR Code Generation. The ultimate goal is blistering machine-code execution.
# Sample Ion+ syntax demonstrating structures, pointers, and control flow
struct Buffer:
int size
ptr byte data
?int Buffer.validate(int max_size):
if size <= 0 or size >= max_size:
return none
int index = 0
while index < size:
index += 1
return index
Project Roadmap & Status
- Phase 1: Lexing (Completed) - Regex-based scanning, token definitions, and indentation tracking are fully implemented.
- Phase 2: Parsing & AST (In Progress) - Currently structuring Python nodes for Expressions, Declarations, and Control Flow.
- Phase 3: Semantics - Implementation of symbol tables, type checking, and scoped variable resolution.
- Phase 4: LLVM Backend - Mapping AST nodes to LLVM IR instructions for true compilation.
- Phase 5: OOP Expansion - Bringing full Object-Oriented paradigms into the low-level architecture.