A modern, expressive programming language with native compilation, component-based architecture, and universal NativeUI rendering.
Alterion is a revolutionary systems programming language designed for modern cross-platform application development. It combines the performance of native compilation with the simplicity of component-based architecture and powerful async programming patterns.
- π― Component-First Architecture - Build applications as reusable, native components
- β‘ Async-Native - Built-in async blocks with try/catch/finally support
- π¨ NativeUI System - Universal UI rendering across desktop, mobile, and web
- οΏ½ Native Compilation - Direct compilation to machine code (x86_64, ARM, RISC-V)
- π‘οΈ Memory Safety - Rust-inspired ownership system with lifetime analysis
- π¦ Modern Syntax - Clean, readable syntax with type inference
// Traditional C++ Desktop Application
#include <windows.h>
#include <iostream>
class UserProfile {
HWND window;
HWND label;
HWND button;
public:
void create() {
window = CreateWindow(...);
label = CreateWindow(L"STATIC", ...);
button = CreateWindow(L"BUTTON", ...);
// 50+ lines of Win32 boilerplate...
}
void loadUser(int userId) {
// Manual async handling, error management
std::thread([=]() {
try {
auto user = ApiService::getUser(userId);
// Update UI on main thread...
} catch (...) {
// Handle errors...
}
}).detach();
}
};
// Equivalent Alterion Component
component UserProfile {
user: object = null
loading = true
error= null
@async
loadUser(userId: int) {
loading = true
async {
[user = await ApiService.getUser(userId)]
[catch(err) error = err.message]
[finally loading = false]
}
}
render:
loading ? <div>Loading...</div> :
error ? <div>Error: {error}</div> :
<div center>
<h2>{user.name}</h2>
<p>{user.email}</p>
</div>
}
- Windows: MinGW-w64 or Visual Studio 2019+
- macOS/Linux: GCC 7+ or Clang 8+
- Build Tools: CMake 3.15+
git clone https://github.com/Chace-Berry/Alterion.git
cd alterion
# Windows
scripts\build.bat
# macOS/Linux
chmod +x scripts/build.sh
./scripts/build.shCreate hello.alt:
component HelloWorld {
name = "Alterion" // Inferred as String
count: Int = 0 // Statically declared
increment {
count += 1
}
render:
<div center>
<h1>Hello, {name}!</h1>
<p>Clicked {count} times</p>
<button onClick={increment}>
Click me!
</button>
</div>
}
Compile and run:
# Compile to native executable
alterion build hello.alts --target native
# Compile for web (NativeUI β DOM)
alterion build hello.alts --target web
# Compile for mobile (NativeUI β native mobile UI)
alterion build hello.altx --target mobile
# Development mode with hot reload
alterion dev hello.altxcomponent TodoApp {
todos = []
newTodo = ""
addTodo {
if (newTodo.trim() != "") {
todos.push({ text: newTodo, completed: false })
newTodo = ""
}
}
toggleTodo(index: Int) {
todos[index].completed = !todos[index].completed
}
render:
<div class="todo-app">
<input
value={newTodo}
onChange={updateInput}
placeholder="Add a todo..."
/>
<button onClick={addTodo}>Add</button>
<ul class="todo-list">
for todo, index in todos[
<TodoItem
todo={todo}
onToggle={() => toggleTodo(index)}
/>
]
</ul>
</div>
}
component DataFetcher {
data= []
loading = false
@async
fetchData {
loading = true
async {
[
let response = await fetch('/api/data')
data = await response.json()
]
[catch(error)
console.error('Failed to fetch:', error)
]
[finally
loading = false
]
}
}
}
processItems(items) {
// Numeric loop
for i (items.length)[
print("Processing item " + i + ": " + items[i])
]
// For-in loop
for item in items[
if (item.active) {
item.process()
}
]
// Range loop
for i (0, 100)[
if (i % 2 == 0) {
print("Even: " + i)
}
]
}
component ResponsiveLayout {
isMobile: boolean = window.innerWidth < 768
render:
<div class={isMobile ? "mobile-layout" : "desktop-layout"}>
<header center>
<h1>My App</h1>
</header>
<main flex="column" gap="20px">
<UserProfile />
<TodoList />
<Footer />
</main>
</div>
}
# Basic compilation
alterion build src/ --output dist/ --target native
# Development mode
alterion dev src/ --target native --hot-reload
# Cross-platform compilation
alterion build app.alt --targets native,web,mobile
# With optimizations
alterion build app.alt --optimize --target native- VS Code Extension: Full IntelliSense support
- Syntax Highlighting: Rich syntax coloring
- Error Detection: Real-time error checking
- Auto-completion: Smart code completion
- Go to Definition: Navigate your codebase easily
// alterion.toml (Project configuration)
[project]
name = "my-app"
version = "1.0.0"
[build]
target = "native"
optimize = true
[dependencies]
# External C libraries via FFI
openssl = "1.1"
sqlite = "3.0"alterion/
βββ core/ # Core language implementation
β βββ lexer/ # Tokenization and lexical analysis
β βββ parser/ # Syntax analysis and AST generation
β βββ semantic/ # Type checking and semantic analysis
β βββ codegen/ # Code generation and optimization
βββ include/ # Header files and API definitions
βββ runtime/ # Runtime system and standard library
β βββ nativeui/ # Cross-platform UI rendering engine
β βββ ffi/ # Foreign function interface
βββ stdlib/ # Alterion standard library
βββ tools/ # Development tools
β βββ cli/ # Command-line compiler
β βββ lsp/ # Language server protocol
β βββ debugger/ # Debug support
βββ tests/ # Test suite
β βββ unit/ # Unit tests
β βββ integration/ # Integration tests
β βββ benchmarks/ # Performance benchmarks
βββ examples/ # Example Alterion programs
βββ documentation/ # Language documentation
βββ scripts/ # Build and utility scripts
# Run all tests
alterion test
# Run specific test suite
alterion test --suite lexer
alterion test --suite parser
alterion test --suite codegen
# Generate coverage report
alterion test --coverage
# Performance benchmarks
alterion benchmark- π Language Guide - Complete language reference
- π― Getting Started - Beginner-friendly tutorial
- π§ API Reference - Detailed API documentation
- ποΈ Architecture - Internal architecture overview
- π Migration Guide - Migrating from other languages
We welcome contributions! Please see our Contributing Guide for details.
git clone https://github.com/Chace-Berry/Alterion.git
cd alterion
# Install development dependencies
npm install -g cmake
npm install
# Build development version
mkdir build && cd build
cmake .. -DCMAKE_BUILD_TYPE=Debug
make -j4
# Run tests
ctest --verbose- Phase 1: Lexical Analysis & Tokenization
- Phase 2: Syntax Analysis & AST Generation
- Phase 3: Semantic Analysis & Type Checking
- Phase 4: Code Generation & Optimization
- Phase 5: NativeUI Rendering Engine
- Phase 6: CLI Tools & Language Server
- Phase 7: Advanced Optimizations
- Phase 8: Package Manager & Registry
- Phase 9: Debugger & Profiler
- Phase 10: IDE Extensions & Tooling
My goals for Alterions' designed for performance:
- Fast Compilation: Multi-threaded compilation with intelligent caching
- Optimized Output: Generated code is optimized for target platforms
- Memory Efficient: Minimal runtime overhead
- Bundle Size: Tree-shaking and dead code elimination
| Metric | Value |
|---|---|
| Compile Time | ~1.8s for 10k LOC |
| Memory Usage | ~32MB peak |
| Binary Size | 60% smaller than equivalent C++ |
| Runtime Performance | Native machine code speed |
- οΏ½ Contact - Questions and discussions
- π Report Issues - Bug reports and feature requests
This project is licensed under the GNU General Public License v3.0 - see the LICENSE file for details.
- β Free to use
- β Free to modify
- β Free to contribute to open source projects
- β Cannot be used in proprietary software without releasing source code
- β Cannot be monetized without explicit permission from the author
For commercial licensing options, please contact chaceberry686@gmail.com.
- Inspired by modern languages like Rust, TypeScript, and Swift
- Built with love for the developer community
- Special thanks to all contributors and early adopters
Made with β€οΈ by Chace Berry
Contact: chaceberry686@gmail.com