(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.
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.
[deleted]
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.
[dead]
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
[dead]
[dead]
[dead]
[dead]
[dead]
[dead]
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.
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.
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.
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.
[dead]
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.
[dead]
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://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.
[deleted]
[dead]
...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 }
}``` <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.
[deleted]
This is not true. Nobody is forced to give their own source code to the world, because nobody is forced to use a GPL library. Proprietary software can just not depend on a specific GPL library, just like free software can just not depend on a proprietary library
Using a GPL library is quid pro quo: you receive a free software library, and you give back a free software application. If you don't believe in sharing code, you can just write eveything yourself (and hey, now with AI agents this is much more practical)
There was some rumblings PR-wise of it becoming a thing but I don't know offhand if it went anywhere.
[deleted]
GPUI, in fact, works quite well in most case.
It's not as polished as I'd like it to be, and use of the APIs in Zed isn't there yet, but if you feel it's "not accessible at all" I'd be interested to learn more.
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?
[deleted]
[dead]
And the minute you start going along the lines of "well why don't you cache unchanged parts of the UI as images" now you may as well go for a retained mode UI because you're reinventing the wheel.
[deleted]
you can make it work for whatever usecase you want. that's the beauty of oss.
> move |_| container::background(c)
There's no way anyone can see this and thinks it is legible
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.
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?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.
[dead]
fn view(_: &()) -> impl Widget<()> {
and think "nailed it"Pretty straightforward to my mind.
fn view() -> impl Widget {
or fn view() -> impl BasicWidget {
but even that feels a little bit clunky. You could imagine this working by a) having traits let you choose one of a few different ways to implement them and automatically deriving the rest and b) either not forcing you to specify the <T> of a generic type when the T can be inferred, or making BasicWidget an alias for Widget<()>, or automatically deriving Widget<()> for types that implement BasicWidget.[dead]
use iced::widget::{column, *};
use iced::{Center, Color, Fill, Theme, border, color};
fn main() -> iced::Result {
iced::application(new, update, view)
.window_size((500, 500))
.run()
}
// fill in your state and message types as needed
pub type State = ();
pub type Message = ();
fn new() -> State {}
fn update(state: &mut State, message: Message) {}
fn view(state: &State) -> impl Widget<Message> {
let swatch = |c: Color| {
container("")
.width(32)
.height(32)
.style(move |theme| 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: &Theme) -> container::Style {
container::background(color!(0x505050)).border(border::color(color!(0x0000ff)).width(1))
}
but you'll get warnings for unused variablesit's just Widget<Message> and Message is defined by the user of the library so can't be handwaved away in advance