I can't understand the logic for this
I can't understand the logic for this
Posted Aug 13, 2024 1:52 UTC (Tue) by atai (subscriber, #10977)In reply to: I can't understand the logic for this by Cyberax
Parent article: COSMIC desktop makes its debut
Qt proved that in, what, 1999?
Rust is nothing new in this front.
Posted Aug 13, 2024 2:14 UTC (Tue)
by Cyberax (✭ supporter ✭, #52523)
[Link]
Posted Aug 13, 2024 3:54 UTC (Tue)
by comex (subscriber, #71521)
[Link] (10 responses)
Oh, and more recently, Qt decided to implement its own scripting language, QML.
Not that newer UI frameworks are immune to this trend of reinventing the world. I don’t know about Iced, but Slint, one of the other Rust-based UI frameworks, also has its own scripting language similar to QML.
Posted Aug 13, 2024 7:54 UTC (Tue)
by hunger (subscriber, #36242)
[Link] (7 responses)
Having a simple language to describe UI has a host of advantages: https://slint.dev/blog/domain-specific-language-vs-impera...
Just look at the web: Do younreally think it would be as successful as it is if you had to actually program pages in rust, C++ or any other "proper" programming language?
Posted Aug 13, 2024 9:58 UTC (Tue)
by anselm (subscriber, #2796)
[Link]
Indeed? We knew that in the early 1990s, with Tcl/Tk.
(Tcl/Tk may not be everyone's cup of tea, but at the time it ran in circles around everything else in that space.)
Posted Aug 15, 2024 10:56 UTC (Thu)
by khim (subscriber, #9252)
[Link]
That question is, essentially, impossible to answer before you would give criteria for “success”. Would it have been successful at attracting bazillion “designer” who created bazillion barely-usable sites? Probably not. Would it have been successful at facilitating the ability of people to communicate? Most likely yes, and even more than web achieves that today.
Posted Aug 15, 2024 13:05 UTC (Thu)
by jengelh (guest, #33263)
[Link] (2 responses)
And here we are, people programming web pages with Javascript (which is "proper" in the sense that it is imperative rather than declaring the UI).
Posted Aug 15, 2024 19:01 UTC (Thu)
by yeltsin (guest, #171611)
[Link] (1 responses)
Posted Aug 19, 2024 5:04 UTC (Mon)
by ssmith32 (subscriber, #72404)
[Link]
React is not a declarative model, even moderately. Maybe slightly if you squint really hard after too many drinks? But it's mostly *not* declarative.
It's very much an imperative language that lets you build components.. similar to how most object-oriented UI frameworks work. If you stretch the definition of declarative enough, maybe? But then GTK would be considered declarative...
But you very much tell it to
Build component A,
Step by step, in an imperative fashion.
Having abstractions and components != declarative.
SQL is probably the closest thing to declarative that most folks are familiar, and it's nothing like building a React app, and is absolutely *atrocious* for building large apps out of. Large SQL queries are usually much less maintainable than code of any sort of a similar size.
Prolog is also much closer to declarative than React. And is also absolutely horrible for large programs.
A declarative language for UIs would let you declare what you want to accomplish, literally, something like: "A UI to let me update the time and timezone on COSMIC"... and then the optimizer goes off and builds that UI.
React, you have to tell it exactly what you want, and, most importantly, how to handle input, step by step. That's imperative.
Posted Aug 15, 2024 16:00 UTC (Thu)
by DanilaBerezin (guest, #168271)
[Link] (1 responses)
Ironically, if you actually do take a look at the *modern* web, you'll find that nearly everyone programs almost the entirety of their web pages in the "proper programming language" called Javascript. The original purpose of the web in providing an internationally accessible repository of documents has been relegated to the dustbin of history. The reality is that the web has been turned into its own application platform by its users. A transformation which was so egregiously abusive of it's original design that Google poured billions of dollars into creating an optimizing javascript engine, and when that proved to be insufficient and still painful, people decided to invent WASM. And now, people do (and in fact quite commonly) write entire web pages in Rust and C++ thanks to WASM.
Posted Aug 22, 2024 10:04 UTC (Thu)
by DOT (subscriber, #58786)
[Link]
Any new desktop GUI library has to do the hard work of making their widgets available to accessibility tooling. On the web, this is much easier: you get most of it for free by using HTML tags, and you can easily improve on it by using ARIA attributes.
Of course, we can imagine whole websites being created as a single canvas element drawn by a WASM binary. That's not very popular though, because the DOM already gives you the primitives you need.
Posted Aug 13, 2024 16:52 UTC (Tue)
by mathstuf (subscriber, #69389)
[Link] (1 responses)
Posted Aug 14, 2024 8:31 UTC (Wed)
by mbunkus (subscriber, #87248)
[Link]
One thing that Qt simply doesn't have is differences in implementation quality. As the STL is only a spec, there are multiple implementations of that spec by multiple vendors (gcc's libstdcpp, clang's libstdc++, Apple clang's libstdc++, Microsoft's, the mingw implementation which is gcc's but adjusted for Windows or something like that, most likely others). Not only do they implement various differing parts of the STL specs, their quality of implementation is also often lacking. Here are two examples:
The standard's std::filesystem::path library is based on Boost's library of the same name, boost::filesystem::path. Paths are a tricky thing. Boost's implementation has had a LOT of years to mature, whereas the STL implementations haven't. One result is that the implementation in mingw doesn't support UNC paths for Windows properly (things such as \\?\C:\Test\Foo.txt). Therefore I cannot implement a simple algorithm such as "look through the directory structure going upwards until you find a directory containing a certain file" properly as certain test functions ("is this path empty?" or "is this the root path?") just don't work with it. The corresponding algorithm works just fine with boost::filesystem::path with exactly the same functions (as in, the STL's spec copied Boost's implementation almost verbatim). It also just works with Qt's path libraries. Of course this has been reported as a bug but hasn't been fixed yet.
Another bug due to different quality in STL implementations is again mingw's, this time with random number generation. For C++ with the STL you're supposed to use something like the following in order to generate random numbers:
std::random_device r;
Unfortunately std::random_device on mingw doesn't see the RNG (which the STL specs allow!). Therefore each run of the program produces the same sequence of numbers. Meaning I cannot use std::random_device in cross-platform compatible code.
And don't get me started on the quality of the regular expression engine in the STL… Pretty much the worst one out there.
For me using Qt's own classes is much more satisfying & much less annoying. It's easier to use, easier to reason about, quicker to implement, produces faster code, more correct code.
I can't understand the logic for this
I can't understand the logic for this
I can't understand the logic for this
I can't understand the logic for this
Having a simple language to describe UI has a host of advantages
> Just look at the web: Do younreally think it would be as successful as it is if you had to actually program pages in rust, C++ or any other "proper" programming language?
I can't understand the logic for this
I can't understand the logic for this
>
>Just look at the web: Do younreally think it would be as successful as it is if you had to actually program pages in rust, C++ or any other "proper" programming language?
I can't understand the logic for this
I can't understand the logic for this
then connect it to component B,
when you get signal X, then update Y, etc.
I can't understand the logic for this
I can't understand the logic for this
I can't understand the logic for this
I can't understand the logic for this
std::default_random_engine e1(r());
std::uniform_int_distribution<int> uniform_dist(1, 6);