Starling — a Linux desktop environment built on a Swift port of Flutter's framework

Hi all — sharing a project that turned into a large Swift-on-Linux experiment:
Starling, a desktop environment (shell, Wayland compositor, window manager,
apps) whose UI layer is a from-scratch port of Flutter's framework to Swift —
widgets, rendering, layout, animation — running on the Flutter engine's C core with no Dart VM. Swift replaces the Dart framework entirely.

It's ~190k lines of Swift (the framework port is one SwiftPM package), built with the Swift 6.2.4 toolchain on Ubuntu 26.04. The shell and first-party apps(Files, Terminal, Settings, Calculator, an App Store) are all written against it, and it drives real third-party clients — Chrome, VS Code, IntelliJ, GIMP, Blender — as Wayland/X11 windows.

A few Swift-specific things that might interest this crowd:

• C/C++ interop is load-bearing. The framework binds the engine's stable C API;
the compositor is C called from Swift; input, DRM and dma-buf all cross the boundary. Every target enables C++ interop, which surfaced a fun one on 26.04: with interop on, Foundation's C shim compiles in C++ mode, its <math.h> pulls textually while the prebuilt std module already has it → duplicate overloads. Fix is predefining the wrapper's include guard and
force-including glibc's math.h.

• Concurrency on a non-standard embedder bites. The engine's UI runs on its own
thread (io.flutter.ui), not main. channelBuffers is @MainActor-isolated, so touching it from that thread hits MainActor.assumeIsolated →
dispatch_assert_queue_fail → SIGILL. We route platform messages through direct C callbacks to avoid the actor hop entirely.

• Small Linux-embedder gotchas: Foundation.Timer never fires on the DRM
embedder (we use DispatchQueue.main.asyncAfter + a generation token), and print() is block-buffered through pipes, so early debugging was raw
write(2, …).

Honest scope: early preview (v0.2), verified on AMD and virtio-gpu, Ubuntu
26.04, scaling currently pinned to 2.0. And for full disclosure it was largely written with AI (Claude) under my direction — but I'm posting here for the Swift engineering and I'm glad to go deep on the framework port, the interop, or the concurrency model.

Site + screenshots: https://starling.build
Source (Apache-2.0): GitHub - starling-build/starling: Starling — a new Linux desktop environment: Swift shell, its own compositor, a Flutter-to-Swift framework port, and first-party apps · GitHub

Would love feedback from anyone who's done heavy Swift-on-Linux or C++-interop work.

6 Likes