logoalt Hacker News

jacoblambda11/08/20242 repliesview on HN

> - 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).


Replies

skydhash11/08/2024

The web spec is so complex because it serves different masters. You either making a web page, a web app, or some hybrid of the two. And there’s different constraints for each. And you will have to choose which subset to target if you were the one building that modern language.

show 1 reply
troupo11/08/2024

> 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).

Depends on what you mean by sane modern layout :)

Many modern layouts are still impossible without a lot of JS intervention. Many web flourishes also require Javascript :)

That's why there are no DSLs for this: HTML and CSS already are the DSLs you're looking for.