@taym95@ServoDev I can experiment with that over the weekend. I hope maybe I can come up with a cleaner and more suitable approach that better matches Servo!
the world has too few Flexbox engines in Rust, so I built yet another one, which is somehow different from everything we had so far.
meet hooke: https://t.co/0eREvCuBUc
but... what should I do with it now?
Wow, this is incredible. LMK if I can help with anything. Ofc, hooke only supports flexbox for now, so it can’t be used as-is in Servo. I think, Given Servo’s scale and its unique requirements, a bespoke layout engine makes sense there. And ofc feel free to borrow any of the design ideas if that's applicable.
@kudochien ... right after the decide to rewrite in 🦀. so, probably never. 😅
the headline joke from legendary https://t.co/EVoeyLh3MW
"5 games and 50 game engines written in Rust" is reality now. it feels that we will have more UI frameworks than useful apps built with them.
I think you know what I mean, and you’ve probably seen https://t.co/6CYaQZkAWZ and https://t.co/KxVceqPjFU.
You’re right that if layout nodes are embedded in bigger application/DOM nodes, the extra size block layout adds is negligible.
But my point was about need: modern UI frameworks don’t need block layout at all, so we should cut it for a better, more laser-focused design.
The best part is no part, you know.
Yeah, Exact is phenomenal. I asked Claude and he told me:
Short answer: hooke can’t replace Exact’s layout engine, but Exact is the strongest evidence yet that hooke’s ideas are needed. Exact has spent months adding hooke-style features to Taffy through patches.
Which again proves that Exact is phenomenal.
@ccheever, maybe you can just ask Claude to fork hooke and add Block layout support.
I did some digging, and it seems Longbridge's GPUI Fast could get a lot out of hooke’s layout model: gpui-fast already spends ~1.5k lines keeping Taffy nodes alive across frames and working around its dirtying.
but there is a catch: fast means small, so a lean engine has to drop block layout
@SaadNajmi not really. but it could be the first piece of the puzzle if someone sets out to build the ultimate UI framework from the ground up in Rust.
honestly, I doubt the world really needs it. the niche for this particular set of constraints is quite slim.
but it’s fun to play with!
I don’t think the question is whether it should run on the main thread or a background one. It’s whether the framework supports executing it on any thread, concurrently.
Native UI frameworks only require the mounting stage to happen on the main thread (which is a fundamental constraint), but apps have always been free to choose where their business logic, or even layout, runs.
Threading-related performance problems have always existed in native mobile development, regardless of framework or programming language.
My point is that if we’re building a modern rendering pipeline, it’s a good idea to make it truly concurrent and thread-agnostic. :p