Better HN
topnewbestaskshowjobs
Log inSign up

ogoffart

1,235 karma · joined Jun 30, 2012 (14y ago) · 287 submissions

https://slint.dev
Submissions

comment 6h ago · link · parent

It lives on in Slint. The syntax is inspired to QML, but statically typed and compiled to native code (no JS engine, no browser). Can be used from different programming languages. https://github.com/slint-ui/slint

comment 16h ago · link · parent

Ugly is a matter of taste. But I agree Rust isn't the best language to describe UI: it makes you focus on ownership and lifetimes and explicit memory allocation, instead of the layout. That's in Slint, we uses a DSL for the UI description and keeps the logic in Rust. I blogged about the subject here: https://slint.dev/blog/domain-specific-language-vs-imperativ...

comment 16h ago · link · parent

What's considered harmful is unstructured programming.

Historically, goto was used where we would now use function calls, or braced if/else statements. (early programming language didn't even have these constructs)

The famous "Go To Statement Considered Harmful" paper from Dijkstra was published before C was created. The "goto" from C and C++ is mostly fine.

comment 16h ago · link · parent

I have seen them, but it was mostly using leading 0 to align numbers, not realizing it was octal.

comment 17h ago · link · parent

I read the quote as "I have old code filled with bugs and UB. Using references don't magically solve the bugs"

comment 17h ago · link · parent

https://accesskit.dev/#:~:text=The%20following%20Rust%20proj...

comment 18h ago · link · parent

Slint is free of charge for commercial desktop projects. Slint is under multiple licenses. The GPL makes it open source, the royalty free license makes it free of charge on desktop and mobile, only proprietary embedded projects need a commercial license.

comment 2d ago · link · parent

I was curious, so I asked Claude to make a benchmark with this prompt: "I'd like you to make an hello world in Slint (skia GPU and software renderer), EGUI, electron, QML, QWidget, and measure the RAM usage."

Results on Linux, PSS 400×200 window:

    Slint, software renderer: 13.5 MiB
    Qt 6.12 Widgets: 33.6 MiB
    Qt 6.12 QML, software scenegraph: 48.1 MiB
    Slint, Skia Vulkan: 75.7 MiB
    egui (wgpu, Vulkan): 98.3 MiB
    Qt 6.12 QML (OpenGL, default): 125.0 MiB
    Electron 45: 260 MiB
(The GPU rows ran on Mesa's software drivers) I think QML intrinsically takes more memory: it has a JS engine, and every item is a dynamic object. In Slint, almost everything is resolved at compile time and compiled.

So I wouldn't call Slint resource hungry

comment 2d ago · link · parent

Slint can do that. You can render with wgpu or OpenGL into a texture and show it as an Image. There are examples for wgpu, OpenGL and Bevy in the repository.

comment 2d ago · link · parent

Thanks for the comparison! Keep in mind that there are fixed memory costs for font caches and GPU/driver resources that don't scale with application size. So a Hello World app might not be the most representative benchmark.

If RAM is an issue, Slint's software renderer uses considerably less memory.

(and even 70 MB is not particularly resource-hungry compared to other UI frameworks, especially browser-based ones.)

the spike when resizing is interesting and worth investigating

comment 2d ago · link · parent

I'd like to consider Slint as mature. It hasn't broken its API since 1.0 in 2023, it's used in production, and it has accessibility, live-preview tooling (I work at Slint.)

comment 2d ago · link · parent

Small correction: Slint is free for proprietary desktop, mobile and web apps under our Royalty-free license, regardless of company size.

comment 2d ago · link · parent

Could you elaborate on what you mean by resource hungry? What kind of application and hardware are you using, and what resource usage are you seeing?

I'd genuinely like to understand your experience. It might be a bug or something we can improve. (I work at Slint)

For context, Slint is designed to be lightweight. Especially compared to shipping an entire browser runtime, which appear to be considered normal by many.

comment 2d ago · link · parent

I'm working at Slint.

First, Slint is fully open source and totally free for desktop and mobile development. The article mostly focuses on that, so the pricing argument is simply not applicable in this context.

You're right about certification being a differentiator. We're currently in the process of obtaining ISO 26262 ASIL B certification, and pursuing other certifications relevant to industries such as automotive and medical.

Our customers don't necessarily want "free". They want a serious technology they can build products on, rely on and maintain for decades. They want a partner who takes responsibility and stands behind the technology.

For products with 10–20 year lifecycles, that's worth a lot more than a free library. And I believe that's where Slint's moat lies.

comment 2w ago · link · parent

The tree structure is what matters, not XML. Qt itself moved to QML for new UIs: a dedicated language that’s nicer to write

comment 2w ago · link · parent

Slint might fit: it runs on desktop and mobile, and it’s lightweight enough to run on microcontrollers. You write the UI in a small declarative language, and the logic in Rust, C++, JS, TS or Python, depending on your preference. (I work on it.)

comment 2w ago · link · parent

Not really. Slint also has a royalty-free license, so you can make proprietary applications for free. So it’s GPL for open-source apps (including if your own code is MIT/Apache as they are compatible), and royalty-free for proprietary apps. Is that not enough?

comment 2w ago · link · parent

The design here is very similar to Slint (https://github.com/slint-ui/slint), which I work on: both are implemented in Rust, with a declarative UI DSL and its own compiler, logic in a host language (Rust, C++, JS or Python for Slint), pure reactive expressions, and tooling that lets agents inspect and drive the app.

One difference is that Slint is more mature: it's been 1.x with a stable API since 2023

comment 2w ago · link · parent

But Slint is open source and you can for it if we were to change the license, and the royalty free license is free of charge.

Even MIT/Apache software can change license and start charging, as we've seen in the past with some project.

comment 2w ago · link · parent

The royalty free license is free of charge, no need to pay

comment 2w ago · link · parent

That’s what we’re trying to do with Slint (I work on it): a declarative, reactive UI like React, with the logic in Rust, C++, JS or Python. It needs no browser engine, so it uses a fraction of Electron’s memory.

comment 2w ago · link · parent

> Either it's a rust library or it's not.

It is one. Your app is a Rust program that depends on a crate. The UI compiles to Rust code, and we also have the `slint!` proc macro.

> there's always some edge case logic that needs a full programming language

Right, and that language is Rust. The DSL only describes the GUI. You operate it from Rust.

> Why was using js like qt quick not good enough?

QML was the inspiration. I worked on Qt and wrote QML bindings for Rust before (qmetaobject-rs). Slint is a new take on it, compiled ahead of time, no GC, strongly typed.

comment 2w ago · link · parent

But they even can. (royalty-free license)

comment 2w ago · link · parent

(Slint author here) Slint is written in Rust, and Rust API is at its core. That's not changing. What's wrong with the DSL? the UI is described in the DSL, the application logic in Rust. I wrote about why here: https://slint.dev/blog/domain-specific-language-vs-imperativ...

What gave you the impression we're moving away from Rust?

comment 2w ago · link · parent

It depends on what you're building. If your app is free software, a GPL library is no problem at all. (and your own code can even stay MIT or Apache.)

It "cannot be considered" only for proprietary apps.

comment 2w ago · link · parent

Slint is under multiple license, including the open-source GPL and a royalty free license. What specifically bothers you about the licensing? (I work on Slint, genuinely curious)

comment 2w ago · link · parent

Slint is an open source, free software. The whole framework is on GitHub. A rug pull can't take back what's already released, and one could always fork if needed.

Btw, a rug pull can happen under even the most permissive licenses. As we've seen in the past with some project changing license or direction. That's more or less already happened with GPUI when Zed refocused development on its own needs rather than other GPUI users resulting in several forks.

comment 2w ago · link · parent

I'm working on Slint. It is a declarative UI language that compiles to native code, the application logic can be written in Rust, C++, TS or Python, and it is cross platform, including mobile. Has accessibility through AccessKit. A live preview, so iterating on the UI doesn't mean recompiling Rust.

Compared to Electron, there is no browser, so binaries are a much smaller, use less memory, startup is fast. And the attack surface is also much smaller (no XSS)

12345
10