A cross-platform UI framework where .lony files compile to native apps. One language, one codebase -- runs on Web, macOS, iOS, Android, and Linux.
.lony source --> lonyc (compiler) --> binary IR (.lonybin) --> C runtime (SDL3)
# 1. Build the compiler
make compiler
# 2. Create a new project
lonyc init my_app --path examples
# 3. Run on your platform
make run-macos # macOS (Vulkan/MoltenVK)
make run-ios # iOS Simulator
make run-android # Android device/emulator
make run-wasm # Browser (WebGPU + hotreload)
make run-linux # LinuxUse a different example:
make run-macos EXAMPLE=examples/my_app/App.lonyLony uses the SAVE pattern: State, Action, View, Error.
Component Counter() {
State {
count: int = 0
}
Action increment(): void {
count = count + 1
}
Action decrement(): void {
count = count - 1
}
View {
Flex(direction="column", align_items="center", gap=16, padding=20) {
Text("Counter", fontSize=32)
Text(count, fontSize=48)
Flex(direction="row", gap=12) {
Button("-", onClick=decrement)
Button("+", onClick=increment)
}
}
}
}
import Welcome from components.Welcome
import Counter from components.Counter
Routes {
"/": Welcome
"/counter": Counter
}
Component App() {
View {
Router.Outlet()
}
}
Component ApiFetch() {
State {
title: string = "Press to fetch"
}
Action fetchPost(): void {
response = await fetch("https://jsonplaceholder.typicode.com/posts/1")
data = response.json()
title = data.title
}
View {
Flex(direction="column", align_items="center", gap=16, padding=20) {
Text(title, fontSize=18)
Button("Fetch", onClick=fetchPost)
}
}
}
| Layout | Input | Display | Data | Overlay |
|---|---|---|---|---|
| Flex | Button | Text | Table | Dialog |
| ScrollView | Input | Image | ProgressBar | Toast |
| Divider | TextArea | Avatar | ||
| Tabs | Checkbox | VideoPlayer | ||
| Toggle | Shader | |||
| Slider | ||||
| Select | ||||
| Radio |
- Reactive state -- state variables automatically update the UI
- Async actions --
await fetch()with built-in JSON parsing - Flexbox layout --
direction,gap,padding,justify_content,align_items - Routing --
Routes+Router.navigate()for multi-screen apps - Components --
importand compose reusable components - Themes --
theme.lonyfor shared styles - Native modules -- extend with platform-specific C code
- Hotreload -- instant updates during development
cli/compiler/ Rust compiler (lonyc) -- parses .lony, emits binary IR
engine/
common/src/ C runtime -- loads IR, renders via SDL3
core/ Runtime, IR loader, draw, actions, components, arena allocator
layout/ Flexbox layout engine
renderer/ Vulkan, WebGPU, OpenGL ES backends
hotreload/ Platform-specific hotreload clients
state/ Global state store + action execution
net/ HTTP + WebSocket (native: mbedTLS; WASM: browser APIs)
media/ Image, video, audio, camera, microphone
std/storage/ File persistence (all platforms + WASM IDBFS)
wasm/ Emscripten build scripts
macos/ Xcode project
ios/ Xcode project
android/ Gradle + CMake
linux/ Linux build + cross-compilation (via zig)
lsp/ Language server (Rust)
lony-vscode/ VS Code extension
examples/ Example apps
docs/ Standard library and module docs
lonyc init <name> [--path <dir>] # Scaffold a new project
lonyc build -i <input.lony> -o <dir> -t <target> # Compile to IR or other targets
lonyc serve -i <input.lony> # Hotreload server (TCP + WebSocket)
lonyc watch -i <dir> -t <target> # Watch and rebuild on changes
lonyc dev -i <input.lony> -p <platforms> # Multi-platform dev mode
lonyc check <input.lony> # Type-check only
lonyc run <input.lony> -t <macos|ios|android|wasm> # Build + run on platformlonyc create-module <name> --project <dir> # Create module
lonyc create-module <name> --project <dir> --cmake # Create CMake module
lonyc build-module <name> --project <dir> -t all # Build for all platforms
lonyc delete-module <name> --project <dir> # Remove module
lonyc sync # Sync modules into platform builds# Build
make compiler # Build lonyc (release), links to ~/.cargo/bin/lonyc
make build-all # Full clean + compiler build
make clean # Clean all build artifacts
# Run
make run-macos # macOS
make run-ios # iOS Simulator
make run-ios-device TEAM_ID=XXX # iOS real device
make run-android # Android
make run-wasm # WASM + hotreload + HTTP server
make run-linux # Linux native
make serve # Hotreload server only
# Cross-compilation (macOS to Linux x86_64 via zig)
make cross-build-linux # Software renderer
make cross-build-linux-minimal # Minimal (no FFmpeg/shaders/SVG)
make deploy-linux # Cross-compile + deploy to QEMU VM
# Logs
make logs-runtime LOG_PLATFORM=macos
make logs-runtime LOG_PLATFORM=android
make logs-runtime LOG_PLATFORM=ios
make logs-help # All log commands- Parse:
lonycparses.lonyfiles using a PEG grammar into an AST - Compile: The AST is serialized into a compact binary IR (
.lonybin) - Load: The C runtime loads the IR at startup or receives it via hotreload
- Layout: A flexbox engine computes positions and sizes for the component tree
- Render: SDL3 draws to screen using Vulkan (native), WebGPU (WASM), or OpenGL ES (iOS sim)
- React: State changes trigger re-layout and re-render
cd cli/compiler && cargo test # Compiler tests
cd cli/compiler && cargo test <test> # Single testlonyc servewatches.lonyfiles, recompiles IR on change- Pushes new
.lonybinover TCP (native) or WebSocket (WASM) - Runtime clears registries, rebuilds component tree from new IR
print()in actions sends logs back to the server
Install the Lony extension for VS Code from lony-vscode/. It provides syntax highlighting and language server integration via the LSP in lsp/.
std.router-- client-side routing (Router.navigate(),Router.Outlet())std.storage-- app-local file persistence on all platforms (seedocs/std/storage.md)
- Language specification:
LONY_LANGUAGE.md - Module system:
docs/modules/ - Standard library:
docs/std/
- Rust -- compiler
- Xcode -- macOS and iOS builds
- Android SDK + NDK -- Android builds
- Emscripten -- WASM builds
- Python 3 -- WASM dev server
- zig (optional) -- Linux cross-compilation from macOS
MIT License -- see LICENSE.