31 ms·
Is there a reason why there seemingly aren't any frameworks to do all the fancy web flourish in a normal language and then have it compile down to plain HTML5 +
by CuriousCosmic 2y ago
Is there a reason why there seemingly aren't any frameworks to do all the fancy web flourish in a normal language and then have it compile down to plain HTML5 + CSS + SVG?
- aaronblohowiak 2y agonot sure what you mean, but htmx might be what you are looking for?
- zekrioca 2y agoYou are not sure what they meant, yet you think you know what they are looking for?
- Buttons840 2y agoI am not sure this dice will roll less than six, but I think it will.
- zekrioca 2y agoI am not sure what you meant, but I am sure there is a function with an infinite number of possibilities that it is really relatable to something.
- tlarkworthy 2y agoastro is a modern framework "optimised for content heavy websites" i.e. vanilla assets mostly except when asked for something more. [1] https://astro.build/ https://astro.build/
- vbezhenar 2y agoYou can compile almost any language to JS or WASM. As to HTML + CSS: it goes other way around: HTML and CSS (or rather its subsets) are being integrated into "normal languages", like Qt, Java. I'm not sure I ever saw any technology that could serve as a replacement for HTML + CSS. May be Eclipse RAP or Blazor? But they are so heavy that React will look like a butterfly and they're not aiming to replace HTML/CSS but rather just use it as output medium for their UI.
- CuriousCosmic 2y ago> As to HTML + CSS: it goes other way around... Yeah that kind of stuff is closer but most of those types of frameworks seem to lean heavily on mapping to JS because they try to be turing complete rather than just being easy to work with DSLs.
- troupo 2y agoReasons: - 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
- CuriousCosmic 2y ago> - 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).
- skydhash 2y agoThe 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.
- 2y ago
- fuzzy2 2y agoSounds like you might be looking for a Static Site Generator. Astro was already mentioned. There's plenty of others, mostly geared towards blogs. I also had success with docfx and MkDocs, both for project documentation.
- CuriousCosmic 2y agoYep. I'm well versed with static site generators but every one I've ever worked with has been heavily template based rather than being an actual layout engine that map onto HTML+CSS+SVG. i.e. They all require you to still write in HTML+CSS+SVG rather than being a generalised way of writing HTML+CSS+SVG without dealing with the warts of those languages.
- fuzzy2 2y agoI don't entirely get what you mean by "layout engine". A WYSIWYG editor perhaps? Or maybe a canvas like Microsoft OneNote, where you can draw and put text boxes? Or a word processor? Why isn't the usual Markdown (or the like) approach enough? My gut feeling is that you cannot (fully) abstract away HTML/CSS if you want the result to feel like an actual website. With Astro, MkDocs or docfx, I do not have to touch HTML, except maybe for creating the master layout and/or transformation rules, if needed.
- CuriousCosmic 2y ago> Why isn't the usual Markdown (or the like) approach enough? Because you can't use markdown to design CSS or SVG animations. I want to be able to design an animation with code that describes how the elements move/interact and then compile that down into CSS or SVG keyframes so that I don't have to manually declare however many arbitrarily complex keyframes. I understand the purpose of a static site generator and I'm not looking for anything to replace that. Rather I want to be able to write the templates for my static sites without 1. writing exceptionally tedious HTML & CSS and without 2. relying on client side JS to do those tedious things.
- consteval 2y ago
- octacat 2y agoThere are. It is not necessary faster/more optimized approach.