DEV Community

Cover image for Zylix — a Zig‑based UI framework for 7 platforms
Kazuhiro Kotsutsumi
Kazuhiro Kotsutsumi

Posted on

Zylix — a Zig‑based UI framework for 7 platforms

Introduction

“Could we build everything with just Zig?”

That simple question started Zylix.

Zylix is a cross‑platform UI framework built around Zig. From a single codebase, you can build native applications for Web
(WASM), iOS, Android, macOS, Linux, and Windows — and the supported targets have now grown to 7 in total.

We just released v0.19.0, which marks the end of the PoC stage. The project is still young, but I want to share the idea and
design behind it.

The name

If you’re a long‑time Delphi user, the name Zylix might feel familiar.

Yes — it’s inspired by Kylix, Borland’s early 2000s attempt to bring Delphi to Linux. Kylix didn’t last, but the idea of
“one language, many platforms” still feels powerful.

Zylix is a modern attempt to revive that spirit with Zig.

Zig + Kylix = Zylix.

Why Zig?

Cross‑platform development already has a lot of options. Each comes with trade‑offs:

Framework Trade‑off
Flutter Custom Skia rendering → less native feel
React Native JS bridge → performance overhead
Electron Chromium bundle → huge binary size
Tauri WebView → limited native integration

Zig feels like a promising way to push past those limits:

  • Zero‑cost abstractions: no runtime overhead
  • Predictable performance: no GC, deterministic memory
  • Cross‑compile ready: one toolchain for all targets
  • Full C ABI compatibility: easy to integrate with Swift/Kotlin/C#
  • Compile‑time safety: null safety, bounds checks

The Zylix approach

The core idea is simple:

Don’t unify the UI. Unify the meaning and decisions.

Frameworks like Flutter and React Native aim to unify the UI itself.
Zylix keeps native UI frameworks (SwiftUI, Jetpack Compose, GTK4, WinUI 3, etc.) and only shares the logic layer.

What’s shared in Zig:

  • application state
  • business logic
  • data validation
  • event handling

What stays platform‑native:

  • UI components
  • animations
  • OS APIs
  • native gestures

Architecture

Zylix uses a Central Brain architecture:

┌──────────────────────────────────────────────┐
│                 Your Application             │
├──────────┬──────────┬──────────┬─────────────┤
│ SwiftUI  │ Compose  │  GTK4    │  WinUI 3    │  HTML/JS
├──────────┴──────────┴──────────┴─────────────┤
│                C ABI Layer                   │
├──────────────────────────────────────────────┤
│               Zylix Core (Zig)               │
│   Virtual DOM | State | Events | Diff | ...  │
└──────────────────────────────────────────────┘
Enter fullscreen mode Exit fullscreen mode

This gives you:

For users

  • native look & feel
  • full accessibility support
  • small app size
  • better battery life

For developers

  • single source of logic
  • compile‑time type safety
  • cross‑compile from one toolchain
  • predictable memory behavior

Supported platforms

Zylix currently targets 7 platforms.
The stable ones today are:

  • Web / WASM
  • iOS
  • Android
  • macOS
  • Linux
  • Windows
  • watchOS

Implementation example

A minimal counter shared across platforms:

Zig core (shared logic)

pub const State = struct {
    counter: i64 = 0,
};

pub fn increment(state: *State) void {
    state.counter += 1;
}
Enter fullscreen mode Exit fullscreen mode

SwiftUI (iOS/macOS)

Text("\(zylixState.counter)")

Button("Increment") {
    zylix_dispatch(.increment)
}
Enter fullscreen mode Exit fullscreen mode

Jetpack Compose (Android)

Text("${zylixState.counter}")

Button(onClick = { zylixDispatch(INCREMENT) }) {
    Text("Increment")
}
Enter fullscreen mode Exit fullscreen mode

Same logic, fully native UI.

Project layout

zylix/
├── core/           # Zig core library
├── platforms/      # Platform implementations
│   ├── android/    # Kotlin/Jetpack Compose
│   ├── ios/        # Swift/SwiftUI
│   ├── linux/      # GTK4
│   ├── macos/      # SwiftUI
│   ├── web/        # WASM
│   └── windows/    # WinUI 3
├── site/           # Docs site
└── examples/       # Sample projects
Enter fullscreen mode Exit fullscreen mode

Current status & what’s next

Zylix v0.19.0 is now beyond PoC. Since the Zenn article (https://zenn.dev/kotsutsumi/articles/bd4607160de5be):

  • Supported targets have grown to 7
  • Core feature implementation is complete
  • Automated tests are in place
  • I’m now in the phase of building real apps with it and validating the experience

This is the most important phase: not just “it works,” but how it feels when you build something real with it.

Contributions welcome

Zylix is open source (Apache License 2.0).

All contributions are welcome:

  • 🐛 bug reports
  • 💡 feature ideas
  • 📝 docs improvements
  • 🔧 pull requests

GitHub: https://github.com/kotsutsumi/zylix
Docs: https://zylix.dev

If you’re into Zig or you want a new approach to cross‑platform native apps, come take a look.

Closing

“Doing everything in Zig” might sound reckless, but I wanted to see what’s possible.

Can we share logic without losing native UX?
Can we keep performance and still target multiple platforms?

Zylix is still early, but if this resonates with you, I’d love to build it together.

Thanks for reading.

Top comments (0)