377 points · by EvilGoose · 1d ago · 140 comments
(Feel free to PR if you want to add another one or fix some non optimal implementation)
https://samoylenkodmitry.github.io/Cranpose/?tab=performance
> No screenshots on web site, docs, or repo
If you are posting a GUI product of any kind.
Put together a demo.
And then, put the link right at top where everyone can find it. Not buried in a help document on page 66.
I know they have one, i've seen it. Couldn't say how to find it again.
visual examples seen as an afterthought instead of a prerequisite
these are the people that cried ageism for the last 15 years not noticing their rejection was actually because they railed against javascript being used outside of jquery
Now they’ve finally found a way to skip from C++ straight to Rust for frontend work
hope the community picks it up and makes it more convincing and accessible, with visual aids
They did this for the benefit of a community already building apps with this library. They don't need screenshots because people already know they want what's on offer.
They'll probably get around to putting screenshots in the repo eventually. But this isn't going to be anywhere close to the top of their priorities. Their priority is obviously going to be their product.
We're looking forward to using this at ArtCraft. We've already forked egui (and we're going to try to upstream our work). Even so, we find lots of things we cannot use egui for.
GPUI is essential for some of the work we're doing.
I don't know anything about <other_open_source_Rust_GUI>, but I expect the documentation to be half-baked, and if I look at the GitHub repo the most recent activity is going to be somebody who made a bug report 6 weeks ago and nobody has responded to it yet.
The team behind the software matters and a team with funding is appealing.
You'd be surprised what throwing just 1 or 2 people at marketing can do to get visibility.
Compared to just a group of engineers crunching out code.
The group of engineers might be building something great, but its just a tree falling the forest. Nobody hears it. You have to spend some time broadcasting it, making demo's, posting about it.
TL;DR: (about a16z VC company) "a media company that monetizes through VC".
One of the article's themes was that it's about hockey stick growth, winner takes all mentality. Startups that win aren't necessarily first or best - often they just outspent others in PR and marketing department (especially to hype their IPOs).
[0] https://www.oreilly.com/radar/what-happened-to-silicon-valle...
edit: Slint has good accessibility support too, but it's commercial for commercial projects.
1. egui (30.3M total / 9.2M last 90 days) (note: immediate mode)
https://crates.io/crates/egui
2. Iced (3.2M / 770k)
https://crates.io/crates/iced
3. Slint (2.4M / 955k) (note: GPL/commercial license)
https://crates.io/crates/slint
5. Dioxus Native (181k / 26k)
https://crates.io/crates/dioxus-native
6. Freya (49k / 12k)
https://crates.io/crates/freya
7. Floem (45k / 15k)
https://crates.io/crates/floem
8. Vizia (7k / 700)
https://crates.io/crates/vizia
All of those options are technically superior to GPUI in my subjective opinion. GPUI focusses pretty narrowly on Zed's use case, and suffers from severe NIH syndrome (so has put a bunch of time and effort into building things that already exist as crates in the Rust ecosystem).GPUI does have a pretty nice component library. And of course an excellent code editing control. And it's... fine. But I wouldn't choose it over the other options.
This is why people are flocking to it. Nothing else really matters.
https://refract.rs https://crates.io/crates/refract https://refract.rs/examples/chat
In the past month 1 person has made commits.
What does it matter if it's superior?
Actually, AI has come into existence since I last looked at it, so maybe docs aren't needed anymore?
GPUI, in fact, works quite well in most case.
https://github.com/ppmpreetham/BUI
Some cool features (I guess coming from Blender) are builtin app menu search and Undo/Redo for UI fields.
honourable mention to slint, seems mature and good but I’ve never personally used it.
Thus far, it has also been quite fast hitting my performance targets which were also quite aggressive. The only real issue I’ve had is memory usage is higher than I’d like but it’s still 1/3rd of what I’d get if I was using Electron… and if I’m remembering right it’s mostly because of the driver stack.
I need to figure out what I plan on doing with the app when this first version is finished: open sourcing it, charging for it, or some combination of the two. Though I can’t imagine not trying to upstream or release the accessibility work.
I feel like naming a library after either GPUI/GPUGUI make talking about this technique difficult. And the technique didn’t originate in this library.
It is actually hard to objectively define how a programming language is ugly. Let the argument be countered. No need to get hurt (w.r.t. policies or rust)
...it also has a lot of really nice APIs, and traits allowing you to bolt on extra functionality "for free" is a big part of it.
I am relatively new to Rust but I do find shopping for API features harder than with other languages.
use iced::widget::{column, *};
use iced::{Center, Color, Fill, Theme, border, color};
fn main() -> iced::Result {
iced::application(|| (), update, view)
.window_size((500, 500))
.run()
}
fn update(_: &mut (), _: ()) {}
fn view(_: &()) -> impl Widget<()> {
let swatch = |c: Color| {
container("")
.width(32)
.height(32)
.style(move |_| container::background(c))
};
let colors = [
color!(0xff0000),
color!(0x00ff00),
color!(0x0000ff),
color!(0xffff00),
Color::BLACK,
Color::WHITE,
];
container(
column![
text("Hello, World!").size(20).color(Color::WHITE),
row(colors.map(swatch)).spacing(8),
]
.spacing(12)
.align_x(Center),
)
.center(Fill)
.style(panel)
}
fn panel(_: &Theme) -> container::Style {
container::background(color!(0x505050)).border(border::color(color!(0x0000ff)).width(1))
}
Also this is a pretty shit example because it's mostly showing styling... and in any sane app, you have a predefined themeThe typical GUI example is a counter
Syntax is rarely a reason to choose a language
If Rust feels "ugly" to you, may I suggest you consider how that comes from lack of familiarity, rather than an intrinsic shortcoming of the language?
use dioxus::native::{Config, LogicalSize, WindowAttributes};
use dioxus::prelude::*;
fn main() {
let window = WindowAttributes::default().with_surface_size(LogicalSize::new(500.0, 500.0));
let config = Config::new().with_window_attributes(window);
dioxus::native::launch_cfg(app, vec![], vec![Box::new(config)]);
}
fn app() -> Element {
rsx! {
Stylesheet { href: asset!("/assets/tailwind.css") }
HelloWorld { text: "World" }
}
}
#[component]
fn HelloWorld(text: String) -> Element {
rsx! {
div { class: "flex flex-col gap-3 bg-[#505050] size-[500px] justify-center items-center shadow-lg border border-[#0000ff] text-xl text-white",
"Hello, {text}!"
div { class: "flex gap-2",
div { class: "size-8 bg-[red]" }
div { class: "size-8 bg-[lime]" }
div { class: "size-8 bg-[blue]" }
div { class: "size-8 bg-[yellow]" }
div { class: "size-8 bg-black" }
div { class: "size-8 bg-white" }
}
}
}
}
You can also use standard CSS if you prefer it over tailwind. And if you wanted to deduplicate, the 6 divs can be written in a loop like so: for color in ["red", "lime", "blue", "yellow", "black", "white"] {
div { width: "32px", height: "32px", background_color: color }
}> move |_| container::background(c)
There's no way anyone can see this and thinks it is legible
The latter is literally just a normal closure. Sure, you get a move which is an ownership semantic, but otherwise it's a very normal closure with an unused parameter, writing
(_) => container::background(c)
doesn't make it much better, does it?New languages always feel a bit inapproachable. It’s like learning Russian (for a westerner). Super impenetrable at first, but at some point (early on!) the alphabet just clicks and then the rest is “just” regular language learning. Same with PL syntax. Overwhelming at first, until it clicks and then you can’t remember what you found overwhelming about it.
Does it make more sense now?
I really like :()), it looks like a monkey with two chins!
I see this and think it is very legible. It is hard to imagine why anyone can have issues with this.
fn view(_: &()) -> impl Widget<()> {
and think "nailed it"Pretty straightforward to my mind.
``` <Pin<Box<dyn Future<Thingy> + `a + OtherTrait>>> ```
or some nonsense when coming from other more succint languages - like Kotlin. There's a part of me that loves the power, and there's a part of me that thinks, "this is just too hard".
This is common in most lower level languages in a large part because they are more powerful.
The funny thing is the replies insulting you for a fairly tame and rather accurate opinion. Almost like rust has this weird subset of users who cannot handle anything negative about their favorite tool.
ref: https://gpui-ce.github.io/
edit: lmao downvotes for this? what even is this community anymore?
[1]: https://github.com/iamnbutler/gpuikit, https://github.com/gpui-archipelago/gpui-unofficial