3 ms·
A declarative description of what my machine should do with content I do not control is pretty important and gives important safety guarantees. We designed CSS,
by maweki 6y ago
A declarative description of what my machine should do with content I do not control is pretty important and gives important safety guarantees. We designed CSS, for example, to have a layouting algorithm that is limited in terms of backtracking (or disallows it) and is terminating.
I wouldn't want my Browser to execute any layouting algorithm somebody sends to me.
The web has been successful because it was declarative. And most avenues where imperative solutions were necessary, were later fixed with declarative extensions.
Once you're at the "just send me assembly"-level, every non-trivial property of the page is undecidable. And the declarative description of a website can be used by different renderers to generate something the user wants to see.
Implementing such a proposal based on a turing-complete imperative language would basically mean the end of the open web.
- sp332 6y agoeBPF and rust show that it's possible to require programs to have certain provable properties, and still have enough flexibility to write really useful programs. WASM already avoids certain classes of bugs by controlling memory layout. And browsers warn if a JS script runs too long. We don't have to make software completely declarative to have safety guarantees.