by hysan · 2w ago · 0 comments
The UI code you write gets compiled to a "plan" which is sort of like bytecode but constrained and simpler, so a simple Rust state machine (or JS on the web) can execute it (doesn't need a complex virtual machine with a garbage collector, etc.)
The layout is expressed using CSS terms and so the layout engine is just Taffy, a Rust based CSS engine, with a bunch of patches on top of it.
Each host like iOS, web, etc. then draws the UI with native elements (UISwitch, DOM elements, etc.) or by drawing the pixels itself (Linux, etc.)