1,123 karma · joined June 30, 2012
Trying to bring that with Slint: https://slint.rs
What would you say is missing in Slint?
> probably not much harder than wrapping Qt, to be honest
There are already Qt bindings for rust (cxx-qt, qmetaobject-rs). What's missing from these?
Slint is under three licenses: GPL, or royalty-free on desktop/mobile, or paid for embedded. So you only have to pay if you sell hardware.
Slint was created with the same idea as what drives "Qt Bridges". We made a UI toolkit that is language-agnostic from the start. Slint uses its own UI language (inspired by QML), and gives you first-class, idiomatic APIs in Rust, C++, Pyhton, and JavaScript. And a clean separation between UI and business logic.
In Rust, you can call async functions from normal ones by spawning them on the executor. The .await syntax isn't as painful as dealing with callbacks and closures in JavaScript. Plus, if you call an async function incorrectly, Rust's compiler will catch it and give you a clear error message, unlike JavaScript, where bad function calls could lead to unpredictable behavior. The premises of the article don't apply, so Rust's async/await doesn't introduce the same "colored function" issues.
(See also https://without.boats/blog/let-futures-be-futures/ )
The code was already broken. It was an undefined behavior.
That's a problem with C and it's undefined behavior minefields.
This has been working since Rust 1.0, I think:
trait Foo {
fn foo(&self);
}
trait Bar : Foo {}
impl Foo for () {
fn foo(&self) { println!("Hello") }
}
impl Bar for () {}
fn xxx(x: &dyn Bar) {
x.foo();
}
pub fn main() {
xxx(&());
}
> With the current beta version you can upcastRight. Now you can convert from `&dyn Bar` to `&dyn Foo` which wasn't possible before.
return foo().bar();
No `auto` and you still don't know the return type of foo.
And knowing the type might not be the only reason you'd want an IDE anyway. What is `foo()` doing? I want to be able to easily jump to the definition of that function to verify that the assumption taken by the calling function are correct.> the same include file is accessible under different path names (granted, that's a very esoteric scenario)
And most likely a build system problem anyway if, say, different versions of the same library get included in your build.
I usually let the original content after a
### Original message
...
For Slint (Another GUI toolkit in Rust), we try to keep our API as stable as possible for as long as possible. We use other crates behind the scene such as winit and co., but we don't expose them in our public API, and we take care of the burden to update them.
Some reason I can think of:
- Can't update the compiler (eg, porting the code base to the new compiler is too complicated)
- No compiler support for the new standard that target a specific platform that one still want to support.
- Too much work to update the whole code base to work with the new standard.
- A 3rd party library is not supporting new standard yet.
- The team is reluctant to have to learn new technologies.
Some are somewhat valid reason, some are less, some are indication of deeper problems.
(P.S: My C++ code base is using C++20. Didn't move to C++23 yet because I think some customers might not be ready for it yet for one of these reasons, but I'm going to push for it at some point.)
(even this association could be done with a local DB similar to mime types if we wanted to simplify)