Quick Start
Create your first NeolyxOS application in minutes.
1. Create a New Project
Use the Reox compiler to scaffold a new NeolyxOS application:
# Create a new NeolyxOS app
$ reoxc new MyApp
# Or with a specific template
$ reoxc new MyApp --template neolyx-app
$ reoxc new MyCLI --template cli
$ reoxc new MyLib --template library
# Navigate to your project
$ cd MyApp.appProject Templates: neolyx-app creates a full NeolyxOS GUI application with NXRender integration. cli creates a command-line tool. library creates a reusable Reox library.
2. Project Structure
A NeolyxOS app follows this standard structure:
MyApp.app/
├── main.rx # Entry point
├── Makefile # Build configuration
├── manifest.npa # App manifest (permissions, metadata)
├── README.md
├── bin/ # Compiled binaries
├── resources/
│ ├── myapp.nxi # App icon
│ └── themes/ # Light/dark themes
└── src/ui/ # UI components3. Hello World (Console)
The simplest Reox program:
// hello.rx
fn main() {
println("Hello from Reox!");
}# Run directly (interpreter mode)
$ reoxc hello.rx --run
# Or compile to executable
$ reoxc hello.rx --emit exe -o hello
$ ./hello4. Hello World (GUI)
A simple GUI application with a window and button:
// main.rx
import prelude;
import transition;
fn main() {
// Create application
let app = app_new("My App");
let window = app_create_window(app, "Hello", 400, 300);
// Build UI
let root = center();
let btn = button_primary("Click Me!");
view_add_child(root, btn);
// Animate entrance
let t = transition_ease_out(300);
view_fade_in(root, t);
// Run
window_set_root(window, root);
app_run(app);
}5. Build & Run
Use the Makefile to build and run your app:
# Build (development mode)
$ make dev
# Build (release with optimizations)
$ make release
# Run
$ make run
# Package for distribution
$ make package # Creates MyApp.nxpkgCompiler Options
Common reoxc options:
| Option | Description |
|---|---|
--emit c|obj|exe | Output type (C code, object file, executable) |
-o <path> | Output file path |
-O0 / -O2 / -O3 | Optimization level (0=none, 2=standard, 3=aggressive) |
--lto | Enable Link-Time Optimization |
--run / -r | Run immediately (interpreter mode) |
--strip | Strip symbols for smaller binaries |