We describe a preliminary design of a webpage layout and scripting language based on constraints and reactivity. The language is intended to play the role of CSS (layout) and AJAX (reactivity) in today's browsers, which together account for more than half of the CPU cycles, a performance bottleneck on smart phones. The rationale is to (1) integrate layout and reactivity in one language, thus eliminating the overhead of the frequent context switch between JavaScript and the layout engine; (2) allow web designers define custom layout semantics, freeing them from the inflexible CSS and allowing them to write layouts that adapt to a range of screen sizes; (3) parallelize layouts with the help of hierarchically expressed constraints; and (4) parallelize handling of multiple events by detecting that events have independent effects on the constraint system. We describe our semantics for combining events and constraint solving and illustrate, on a small case study, how we deal with under-constrained and over-constrained programs.




Download Full History