Slint 1.0
A native toolkit that promised API stability.
Slint 1.0 arrived on 3 April 2023, about two and a half years after the first sixtyfps publish. Like Tauri's 1.0 it is a public-API promise: the .slint language and the language bindings will not break within 1.x. Here is the UI, as a separate file in the .slint language.
import { Button, VerticalBox } from "std-widgets.slint";
export component App inherits Window {
in-out property <int> counter: 0;
callback clicked();
VerticalBox {
Text { text: "Clicked \{root.counter} times"; }
Button { text: "Click me"; clicked => { root.clicked(); } }
}
} A build script compiles that file into Rust at build time, and include_modules! makes the generated App type available. You then attach behaviour with generated setters, getters and callbacks. The SixtyFPS-to-Slint page shows the alternative, which embeds the same language in a macro.
// Build scripts conventionally return a boxed error: Cargo prints it and fails the build.
fn main() -> Result<(), Box<dyn std::error::Error>> {
// Compiles ui/app.slint to Rust at build time.
slint_build::compile("ui/app.slint")?;
Ok(())
} use book_error::Result;
slint::include_modules!();
fn main() -> Result<()> {
let ui = App::new()?;
let weak = ui.as_weak();
ui.on_clicked(move || {
if let Some(ui) = weak.upgrade() {
ui.set_counter(ui.get_counter() + 1);
}
});
ui.run()?;
Ok(())
} The promise is holding: Slint is at 1.18.1 today, eighteen minor releases after 1.0 and all of them 1.x. Both the file-based project and the macro version compile against 1.18. The cost of the stability is a language and compiler separate from Rust, and a licensing model (GPLv3, royalty-free, or commercial) that you need to read.