Reasons:
- Browsers don't "talk" any other language but JS
- All browser APIs are exposed through JS only
- You can't manipulate DOM except through JS
- You can't do "fancy web flourish" without manipulating DOM. If you target Canvas/WebGL/WebGPU, you'd have to first create your entire graphics lib + flourish + font handling and rendering + accessibility + ... from scratch. And load all that on every page load
- Any language compiling into WASM would still need JS-integration for any of the above. Including Canvas/WebGL/WebGPU
- Any language without JS and DOM semantics will need to account for that (e.g. GC on DOM nodes)
- Any language compiling to WASM would need to load its runtime to actually run (including any libs). See network tab for any such project. e.g. Blazor
> - Browsers don't "talk" any other language but JS
I'm not looking for browsers to talk with any language. I'm looking for some DSL that directly maps to the 3 layout languages that browsers understand (i.e. HTML + CSS + SVG). Not anything turing complete at runtime but rather a sane way of describing a webpage layout with fancy styling, UI elements, transitions, and animations but without dealing with the pain that comes with actually writing in the native browser layout languages.
> You can't do "fancy web flourish" without manipulating DOM.
There is a lot of web flourish you can do without manipulating the DOM. It's not actually terribly unperformant to do but writing that code (mostly HTML + CSS, occasionally SVG) feels like peeling your eyelids with an unwashed lemon zester.
> ...
And for the rest of that, again I'm not looking for anything that actually executes in the browser. Just a sane, modern layout language that compiles down to static HTML and CSS with no JS or WASM (unless you explicitly ask for it).