High Performance Rust UI

  Рет қаралды 42,405

Raph Levien

Raph Levien

Күн бұрын

Пікірлер: 47
@234_gokulsoumya3
@234_gokulsoumya3 2 жыл бұрын
Timestamps: 00:00 - Introduction 00:25 - Outline 01:32 - History 05:23 - Research questions to answer 07:47 - Rust (pros and cons) 11:25 - Performance 17:20 - Xilem architecture (example code) 20:50 - Xilem architecture (why, inspiration, etc) 24:18 - Xilem core concept: View trait 28:16 - Performance problems with diffing large trees 31:29 - Xilem flow 33:53 - Xilem async 37:14 - piet-gpu 38:58 - piet-gpu pipeline 39:44 - piet-gpu scene encoding 42:26 - piet-gpu scene fragment 44:08 - piet-gpu WGSL port 45:40 - piet-gpu WGSL demo 47:00 - Signature of paint method in widget trait 48:18 - Scene fragments vs layers (compositing) 50:55 - A bit about the widget tree 52:41 - AccessKit integration 55:06 - AccessKit demo from egui 58:19 - Layered architecture 1:02:35 - View vs Widget 1:05:25 - Xilem demo 1:06:33 - Problems out of scope (for now) 1:09:12 - Current status 1:10:31 - Next steps 1:15:15 - Python demo
@IanMcKellar
@IanMcKellar 2 жыл бұрын
It's exciting to see a11y baked right into the architecture.
@NoNameAtAll2
@NoNameAtAll2 2 жыл бұрын
who's ally?
@bernhardschmidt9844
@bernhardschmidt9844 2 жыл бұрын
@@NoNameAtAll2 Stands for Accessibility (a, 11 characters, y), similar to how i18n is used for internationalization or l10n for localization.
@Sammi84
@Sammi84 2 жыл бұрын
@@bernhardschmidt9844 horrible acronyms. Super hard to guess. Unwelcoming to newcomers.
@SimonBuchanNz
@SimonBuchanNz 2 жыл бұрын
​@@Sammi84 Do you prefer "acby", "lczn", or "ntzn"? They are about as good as you're going to get for contractions. (But yes, they're generally overused.)
@lycantropos
@lycantropos Жыл бұрын
@@SimonBuchanNz I prefer full names whenever possible
@marschrr
@marschrr 2 жыл бұрын
Finally! Nice! Love your work on hi perf 2d gpu graphics! Let's watch it!
@sombrastudios
@sombrastudios 2 жыл бұрын
I really enjoyed hearing these details and about your progress. Keep up the great work, these are exciting times
@JoeTaber
@JoeTaber 2 жыл бұрын
Raph got the Authentic™ twitch chat experience trying to answer troll/joke questions 😂
@realsong-fake
@realsong-fake 2 жыл бұрын
It's great to see ui frameworks put async support to priority.
@nikitadudnik271
@nikitadudnik271 2 жыл бұрын
I want to laugh and cry at the same time, because this is extremely cool, specifically a11y baked in, but beyond my comprehension regarding implementation. Anyway looking forward to using it as a library.
@CalebRox
@CalebRox 2 жыл бұрын
Why go for React-style view diffing instead of an actual finer-grained reactive style of something like SolidJS? (which would also probably perform better)
@RaphLevien
@RaphLevien 2 жыл бұрын
I answered in more detail on Reddit: old.reddit.com/r/rust/comments/zce386/vector_graphics_done_entirely_in_compute_shaders/iyxkgbf/
@tsalVlog
@tsalVlog 2 жыл бұрын
I've been trying to come up with my next "weekend development" project, and I keep coming back to an ECS-based editor, particularly using Bevy.
@rupertthurner8311
@rupertthurner8311 Жыл бұрын
does zed industries GPUI build on your ideas, e.g. antonio scandurra blogging about rednering a text editor like a video game?
@anotherelvis
@anotherelvis 2 жыл бұрын
Great talk.
@forresto
@forresto 2 жыл бұрын
55:30 the accessibility demo is great! More interface developers should learn VoiceOver etc enough to interact with their own interfaces.
@BboyKeny
@BboyKeny 2 жыл бұрын
I'm learning Rust and building a social media post scheduler with a UI. I'm using the Iced crate at the moment which is Elm inspired. I might rewrite the UI in Xilem, because this sounds interesting.
@JuanManuelCañabate
@JuanManuelCañabate Жыл бұрын
Very interesting work indeed!
@dealloc
@dealloc 2 жыл бұрын
Funny, I was thinking about implementing a GUI library based on SwiftUI, and here we are :)
@Speykious
@Speykious 2 жыл бұрын
One thing that I've been waiting for a long time in Rust GUIs is a declarative animation/easing/tweening system. Edit: ah, seems like that's currently a non-goal but that would be nice to have.
@DHorse
@DHorse Жыл бұрын
Thanks. Very informative.
@jimmyraconteur
@jimmyraconteur Жыл бұрын
the only example you give is a window with a button?
@simonfarre4907
@simonfarre4907 2 жыл бұрын
Are there any reasons why we aren't adopting the more "Immediate mode" for GUI's? ImGui for C++ seems to be so much faster than anything else. Is this because it's more narrow in scope or some other explanation I haven't thought of? Why build it in these abstract ways with what I assume contributes quite a lot of overhead?
@chip2389
@chip2389 Жыл бұрын
There are pros and cons to immediate and retained mode. While immediate mode is easy to code, it wastes computations due to re-rendering the world over and over, and complex layout (anything with mutltiple passes) is not intuitive to implememt. Retained mode updates incrementally, which makes it more efficient, but manipulating the widget graph manually is verbose and bug-prone. So, instead people now use an imediate mode API to mutate the hidden underlying retained widget graph. I think ImGUI actually does this these days. The twist with xilem is that you can implement your own views and widgets, which is not the case for React as its widget are tied to platform widgets. Furthermore, passing the id path in events could possibly solve difficult widget communication patterns (nested collections like trees, asynchronus rendering etc.) more elegant.
@simonfarre4907
@simonfarre4907 Жыл бұрын
@@chip2389 very interesting. I think i did a very, very, simple and naive version of something like that for a very simple text editor, emulating a terminal text editor rendered using OpenGL where some elements did not get redrawn unless explicitly needed to. So i think I get what you mean. Obviously everything I did was pure hackery, but still.
@flylord42
@flylord42 2 жыл бұрын
So I had an idea I wanted to run past you. What if you created a graphics queue and a thread that owned the graphics memory that would just pop stuff off the queue to do memory tasks?
@disieh
@disieh 2 жыл бұрын
It is a good question which is better, something like Figma exporter or doing the Electron/Tauri approach of using HTML+CSS as the UI input. To me Figma sounds nicer but HTML+CSS is probably better in the long term. That being said, since Tauri is implemented in Rust, might there be a possibility to use Xilem as backend and HTML+CSS scene building from Tauri.
@keeslinp
@keeslinp 2 жыл бұрын
Any thoughts on mobile or is this strictly aimed at desktop?
@RaphLevien
@RaphLevien 2 жыл бұрын
We're focusing on desktop first but I am hoping that we get to mobile as well. I've been experimenting with piet-gpu (the drawing layer) on Android, and it seems to be working well.
@davidallen5146
@davidallen5146 2 жыл бұрын
Is there someplace that describes widgets and views and how they are related?
@RaphLevien
@RaphLevien 2 жыл бұрын
The best current place is xi.zulipchat.com/#narrow/stream/354396-xilem/topic/Widget.20trait/near/313688326 but I will try to make sure that gets covered in a proper writeup.
@general9064
@general9064 2 жыл бұрын
Does tauri suffice?
@AshkanKiani
@AshkanKiani 2 жыл бұрын
If mobile is a target, then isn't basing everything on compute shaders a risk? The driver support there isn't consistent afaik. That's why I target basic gl3 primitives myself and use SDF in my shaders and UI library I wrote. In that setup, variable length binary encoding isn't really possible (fixed size of the max instruction), which is a let down, but I can still get a similar pipeline.
@RaphLevien
@RaphLevien 2 жыл бұрын
It's a valid concern, but I think newer devices are increasingly capable. And for a fallback, we do have a plan, which is to do the early stages (including the variable size decode) in CPU, and only fine rasterization on GPU. In that setup, we'll have a lot more flexibility, including custom shaders that work specifically on low-spec GPUs.
@JoeTaber
@JoeTaber 2 жыл бұрын
Could it be possible to swap in completely different rendering strategies for the middle layers that operate at different "interaction bandwidths" than a desktop UI? Say you take your xilem app which typically operates on a desktop with full bandwidth interactivity (live mouse cursor location, wgpu output), and instead "render" it to an environment with much lower interactivity capabilities like a plain html page with forms for display and interaction. Maybe I'd characterize this idea as "extreme progressive enhancement".
@RaphLevien
@RaphLevien 2 жыл бұрын
It's an intriguing concept. On the Zulip we've been talking a bit about a View trait that can generate more than one type of element tree - Widgets and DOM nodes to be specific. Zoxc has an intriguing proposal of making the View trait generic on a dyn Trait and having several impls. I think that could work. The question is whether it's worth it and whether you want to deal with the impedance mismatch in semantics between the different element trees.
@SimonBuchanNz
@SimonBuchanNz 2 жыл бұрын
This is basically what Flutter started with for their HTML target, they apparently found it worse than just tossing elements out and using canvas and doing everything themselves (layout, input, a11y, etc)
@DHorse
@DHorse Жыл бұрын
1:06:15 Where did my slides go? Oh no! 🤣🤣🤣
@jaysistar2711
@jaysistar2711 2 жыл бұрын
All new UI architectures must work on the web. That doesn't mean "use the browser DOM", but it does mean that a full SPA style webapp should be possible, as well as a native (browserless) version. I see potential here.
@Ergzay
@Ergzay 2 жыл бұрын
I disagree. Overly web-focused UI kits are ruining the world right now and we shouldn't be overly catering to them.
@jaysistar2711
@jaysistar2711 2 жыл бұрын
@@Ergzay I didn't say "web focused" I said "work on the web". I did also say that that doesn't mean "use the browser DOM". Look at "egui" to see what I mean.
@_general_error
@_general_error 2 жыл бұрын
So this guy says, that Garbage Collection makes program startup slow... interesting...
@medennis3467
@medennis3467 2 жыл бұрын
“A Bit of History” pun intended?😂🤣😂🤣 From a medical background, UI is disturbingly close to UTI. Sorry, back to our regularly scheduled program (see what I did there).
@xtiooplus
@xtiooplus 10 ай бұрын
If you don't even manage to mention the name of the GUI pack in the title, your spirit loses its meaning for me
@sbray-n1g
@sbray-n1g 6 ай бұрын
8 years and nothing to show for it. Vaporware.
"Type-Driven API Design in Rust" by Will Crichton
40:57
Strange Loop Conference
Рет қаралды 126 М.
Compute shader 101
1:22:52
Raph Levien
Рет қаралды 26 М.
“Don’t stop the chances.”
00:44
ISSEI / いっせい
Рет қаралды 62 МЛН
黑天使只对C罗有感觉#short #angel #clown
00:39
Super Beauty team
Рет қаралды 36 МЛН
小丑教训坏蛋 #小丑 #天使 #shorts
00:49
好人小丑
Рет қаралды 54 МЛН
VIP ACCESS
00:47
Natan por Aí
Рет қаралды 30 МЛН
Rust at speed - building a fast concurrent database
52:54
Jon Gjengset
Рет қаралды 214 М.
Makepad: Designing modern UIs with Rust - Rik Arends - RustNL 2023
55:20
Rust Nederland (RustNL)
Рет қаралды 55 М.
Migrating from SQL Scripts to DataForge - Case Study
28:14
The Truth about Rust/WebAssembly Performance
29:47
Greg Johnston
Рет қаралды 188 М.
Use Arc Instead of Vec
15:21
Logan Smith
Рет қаралды 156 М.
TLS Lecture
23:48
ECEn Networking
Рет қаралды 71
Man Vs. Copilot: Outlook
14:32
Pragmatic Works
Рет қаралды 200
“Don’t stop the chances.”
00:44
ISSEI / いっせい
Рет қаралды 62 МЛН