Skip to content
kotsutsumiPublic

About

Resources

Contributing

Security policy

Stars

78 stars

Watchers

1 watching

Forks

Repository files navigation

Zylix

License Zig

High-performance cross-platform UI framework powered by Zig

Zylix enables you to build native applications for Web, iOS, Android, macOS, Linux, and Windows from a single codebase. Leveraging Zig's zero-cost abstractions and predictable performance, Zylix provides a Virtual DOM architecture with native platform bindings.

Documentation | Live Demo | Getting Started

Features

  • Blazing Fast - Zero-cost abstractions with Zig. No garbage collection, predictable performance.
  • 7 Platforms - Web/WASM, iOS, watchOS, Android, macOS, Linux, Windows. One codebase, native performance everywhere.
  • Virtual DOM - Efficient diffing algorithm for minimal updates. Only render what changes.
  • Tiny Bundle - Core library under 50KB. WASM builds are incredibly small and load fast.
  • Type Safe - Zig's compile-time checks catch errors before runtime. No null pointer exceptions.
  • Native Bindings - C ABI for seamless integration with Swift, Kotlin, C#, and more.

Platform Support

Platform Framework Status Notes
Web/WASM HTML/JavaScript Production Ready Full Zig core integration, JavaScript SDK
iOS SwiftUI Production Ready ZylixSwift package with C FFI integration
watchOS SwiftUI In Development Companion app and driver support
macOS SwiftUI Production Ready Shares ZylixSwift package with iOS
Android Jetpack Compose In Development UI demo only, JNI pending
Linux GTK4 In Development Build infrastructure ready
Windows WinUI 3 In Development Build infrastructure ready

Note: Web/WASM and iOS/macOS platforms have full integration with the Zig core. See the Compatibility Reference for definitions and the Roadmap for details.

Quick Start

Prerequisites

  • Zig 0.15.0 or later

Try the Working Samples

# Counter demo (minimal example)
cd samples/counter-wasm
./build.sh
python3 -m http.server 8080
# Open http://localhost:8080

# TodoMVC demo (full application)
cd samples/todo-wasm
./build.sh
python3 -m http.server 8081
# Open http://localhost:8081

Use the JavaScript SDK

npm install zylix
import { init, state, todo } from 'zylix';

await init('node_modules/zylix/wasm/zylix.wasm');

// Counter operations
state.increment();
console.log(state.getCounter()); // 1

// Todo operations
todo.init();
todo.add('Learn Zylix');
console.log(todo.getCount()); // 1

Platform-Specific Setup

Each platform has its own setup requirements. See the platform documentation:

Project Structure

zylix/
├── core/           # Zig core library (Virtual DOM, state management, events)
├── packages/       # Published packages
│   └── zylix/      # JavaScript SDK (npm package)
├── platforms/      # Platform-specific implementations
│   ├── android/    # Kotlin/Jetpack Compose + JNI
│   ├── ios/        # Swift/SwiftUI + ZylixSwift package
│   ├── linux/      # GTK4 native app
│   ├── macos/      # SwiftUI native app
│   ├── web/        # WASM demos
│   └── windows/    # WinUI 3 implementation
├── samples/        # Working example applications
│   ├── counter-wasm/  # Minimal counter demo
│   └── todo-wasm/     # Full TodoMVC implementation
├── site/           # Documentation website (Hugo)
└── docs/           # Internal documentation

Architecture

Zylix uses a layered architecture:

  1. Core Layer (Zig) - Virtual DOM, state management, event system, diffing algorithm
  2. ABI Layer (C) - Stable C interface for cross-language bindings
  3. Platform Layer - Native UI implementations (SwiftUI, Jetpack Compose, GTK4, WinUI 3, HTML/JS)
┌─────────────────────────────────────────────────────────┐
│                    Your Application                      │
├─────────────────────────────────────────────────────────┤
│  SwiftUI  │ Compose │  GTK4  │ WinUI 3 │  HTML/JS       │
├───────────┴─────────┴────────┴─────────┴────────────────┤
│                      C ABI Layer                         │
├─────────────────────────────────────────────────────────┤
│                    Zylix Core (Zig)                      │
│  Virtual DOM │ State │ Events │ Diff │ Scheduler        │
└─────────────────────────────────────────────────────────┘

Development

Build Commands

# Build the core library
cd core && zig build

# Run tests
cd core && zig build test-lib --summary all

# WASM build
cd core && zig build -Dtarget=wasm32-freestanding

# iOS build (aarch64)
cd core && zig build -Dtarget=aarch64-macos

# Android build (aarch64)
cd core && zig build -Dtarget=aarch64-linux-android

Zig 0.15 Notes

This project uses Zig 0.15.x. Key API differences from older versions:

  • ArrayList API: Use .{} for initialization, pass allocator to deinit() and append()
  • Memory patterns: Structs with ArrayList fields store allocator for cleanup
  • Error handling: Use explicit error handling instead of catch {}

See CLAUDE.md for detailed Zig 0.15 patterns.

Documentation

Contributing

We welcome contributions! Please see our Contributing Guide for details.

Support

If you find Zylix useful, consider supporting the project! Your support helps maintain and improve Zylix.

GitHub Sponsors

Feel free to buy me a coffee! Every bit of support is greatly appreciated.

License

Zylix is licensed under the Apache License 2.0.

Acknowledgments

About

Resources

Contributing

Security policy

Stars

78 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages