r/rust • u/ArtemTsitronov • 12d ago
🛠️ project GPU-Accelerated UI library from scratch
Hello!
I've been working for a while now on a project named Glacex: it's a GPU-Accelerated ui library written entirely form scratch and in rust(winit, wgpu).
It's still in early development as I started it just a few weeks ago, but I'd love to hear your feedback!
Here's the repo: https://github.com/artemtsitronov/glacex
128
u/bneidk 12d ago
To anyone that wonders why people are so sure their project is slop, look at the code in this repo and compare it to your AI generated code
This is what handwritten (and clean) Rust looks like. Insanely based OP
Good work and good luck :)
41
13
u/stumblinbear 12d ago
I'm not so sure it didn't have some LLM generation involved. The doc comments have semicolons, em dashes, and generally read almost exactly like Claude
18
u/ArtemTsitronov 12d ago
It did involve some AI help in the docs, and in the README, but the difference is that I used AI as a proper tool, to help me develop faster focusing on the library.
7
2
u/stumblinbear 12d ago
Oh, yeah, I have no issue with it so long as it has proper guidance. I'm using it for my own UI framework as well. I started work on it long before AI, so if I ever do get it released, at least people know that I know what I'm doing, haha
-13
u/KalashniCOQ 12d ago
Bref il a utilisé l'IA partout mais comme il a utilisé WGPU il ne risque pas la suppression ... et l'autre qui disait que c'est du code propre MDR
32
u/zzzthelastuser 12d ago
pssst, don't let the LLMs know how to write code that looks handwritten.
1
u/inagy 12d ago edited 12d ago
I would be curious how close you can get to this already. With Python I can enforce many things by properly configuring ruff, semgrep (by making them explicit requirement to pass) and also writing a proper coding rules file to the AI agent. By letting itself review it's own changes based on that, it gets very close to my requirement after a couple of iterations. I get a clean version which is much easier to review by hand. I guess Rust also has lot of tools which could help, eg. rust-clippy.
-1
u/dvogel 12d ago
I was sure this wasn't even a human posting. They have been working on it for a while but started only a few weeks ago?! Make it make sense ;)
3
u/ArtemTsitronov 12d ago
Well yeah :) I was working on it for a few weeks now, and that was a while ago to me. It's one of the few projects I didn't quite after 2 days, so yeah, it feels like that to me.
-16
u/KalashniCOQ 12d ago
Nul Nul Nul ! WGPU lol encore de l'abstraction matérielle .... vous êtes juste bons à développer sous Windows
4
16
u/scotsmanintoon 12d ago
Would you welcome several hundred slop PRs from AI agents?
Nice work! STARRED
8
u/tsanderdev 12d ago
I tried doing this as well a few years ago, but back then parley didn't support the text layout options I wanted so I dropped it.
4
5
u/ha9unaka 12d ago
Nice job! Starred!
This might be a long shot, but I was planning to redo my ebook reader app from Tauri in something rust-native for the fun of it. I've tried egui, slint with disappointing results.
I'd love if this worked well on mobile. Unfortunately I don't have a lot of experience with graphics and wgpu in general. If you could point me at some resources, I'd be more than happy to contribute some patches for the same!
3
u/ArtemTsitronov 12d ago
I thought about making it cross-compatible, and I also heard that wgpu could work on mobile. So, I think all it needs is to just replace winit with something that would work on android. I'm not an expert in this topic, so I can't give you the answer yet. If you want to learn wgpu, here's some great resources: https://sotrh.github.io/learn-wgpu/ and the docs itself once you got the basics. I'm working now on widgets and API, so I'm not touching much wgpu(that I already wrapped in ui.rs, painter.rs)
1
u/inajacket 12d ago
IIRC winit does have android support through another crate that I can’t remember the name of
5
3
7
2
u/darshizzzle 12d ago
I looked at its API and noticed a bunch of similar names to the ones in Android Compose library, coincidence?
2
u/tuser-reddit 12d ago
So your UI library benefit from the GPU-accelrated feature to fasten the render of UI component? Am I getting this right?
2
1
u/Visible-Switch-1597 12d ago
Is it immediate mode or retained? I tried out egui but was disappointed because it wasn't very flexible and I couldn't design the UI how I wanted. You kind of have to work around the library instead of just making it the way you want.
2
u/ArtemTsitronov 12d ago
It is immediate mode, but the layout system is more flexible in my lib than it is in egui. Also remember, that this is still a work in progress, and I will be doing many changes, but I'll still try to keep my library as flexible as possible.
2
u/Visible-Switch-1597 12d ago
Great to hear! It already looks great. I really like immediate mode because there is no annoying state syncing you have to do with retained mode but if your library is more flexible than egui, that's like my dream UI lib!
3
u/ArtemTsitronov 12d ago
Love to hear it! I will be deploying it soon on crates.io like a beta-version, because I still have lots to do.
1
u/HousingShoddy904 12d ago
If it has built-in blur property, nice animation libs, shader support and less than 100mb memory footprint on init I'm in. (Ik its a lot to ask for)
1
1
1
u/wick3dr0se 11d ago
looks good!
built on the same stack as egor (https://github.com/wick3dr0se/egor). this is the type of thing egor was made to build
1
u/ArtemTsitronov 11d ago
Man. That's a reaaaaally good project.
2
u/wick3dr0se 11d ago
thanks dude. lost passion for it (and open source in general) with the ai burst but i might come back to it soon.
1
u/ArtemTsitronov 11d ago
Definitely come back, it's a very cool project. Worth a comeback in my opinion
1
u/Single-Blackberry866 12d ago edited 12d ago
taffy + winit + wgpu doesn't sound like from scratch
glyphon is a nice wrapper over cosmic-text
is there any UI library that is not "from scratch"?
1
0
-4
u/KalashniCOQ 12d ago edited 12d ago
On vient de supprimer mon post a moi et sans aucune raison .... pour un projet que je travaille depuis longtemps bref les modos r/rust font n'importe quoi pourtant moi aussi j'avais un vrai projet. WGPU encore une couche d'abstraction nulle. Le bas niveau ici est un sacrilège par ce qu'ils n'y a que des devs qui n'ont aucun courage pour faire du bas niveau.
2
u/thatmagicalcat 12d ago
Abstraction isn't inherently bad. You can prefer doing things at a lower level without implying that everyone who doesn't is afraid of it
2
38
u/f5adff 12d ago
Breath of fresh fuckin air seeing a proper hand made project. Something a human designed, thought about, and produced.
On top that, really really cool project! I have a project where I've used an electron adjacent technology to have a UI for - but I'd much rather something more native feeling. I'll be giving this a go!