3 ms·
The core of CSS layout, as I understand, is a few different layout algorithms (flex, columns, normal blocks, etc.) Properties are knobs to customize these algor
by noelwelsh 3y ago
The core of CSS layout, as I understand, is a few different layout algorithms (flex, columns, normal blocks, etc.) Properties are knobs to customize these algorithms. Internally I assume it's a constraint solving problem.
The kind of language I would be interested in would expose the constraint solving directly. So it would be much more like Prolog than, say, Rust.
You seem to working from the basis of reproducing CSS as it currently exists, and keeping design principles of CSS. This is reasonable POV, but these are not assumptions I share in my musing here.
- chrismorgan 3y agoSome parts of layout are constraint solving, but not all, not by a long shot. And CSS is about a lot more than layout. And most of the rest of CSS is absolutely nothing to do with constraint solving. So even though you can do layout as an exercise in constraint solving, you couldn’t just replace CSS with a constraint solver. And even if you did switch to some foundation of constraint solving, you’d just be replacing one form of complexity with another—one that’s more complex in the base case, more flexible in certain unusual cases, and generally has worse performance traps. Houdini, as mentioned by another, is an interesting concept that could blend the two worlds profitably. (By the way: your original comment implied nothing whatsoever to me about a change in foundation toward constraint solving. That does make it a more interesting proposition, but also fairly firmly unachievable for the web.)