6 ms·
This is a somewhat superficial history that only briefly touches on origins, and doesn't discuss the fundamental idea behind CSS, from which everything else is,
by inopinatus 6y ago
This is a somewhat superficial history that only briefly touches on origins, and doesn't discuss the fundamental idea behind CSS, from which everything else is, directly or otherwise, a consequence.
Two decades ago I was overjoyed to discover that Scheme was finally going to have a useful application beyond illustrating SICP and writing koans to amuse myself, because DSSSL was on the cusp of evolving into the last document styling language anyone would ever need.
Unfortunately following an incident with a broken Lisp machine, a liquid lunch, and an unlicensed particle accelerator, I became trapped in a parallel universe where the HTML ERB anointed CSS by mistake during a drunken night out in Oslo.
The fundamental concept of CSS (best revealed by H.W.Lie's thesis IMO[1]) was to create a rich and versatile and non-Turing-complete set of structural selectors in lieu of DSSSL's recursive logic, and to allow styles to overlay one another; two design choices that only by the application of gallons of irony can explain why most web pages are composed of a bunch of nested DIV elements with hashed IDs and overloaded semantic class attributes, and everyone compiles their assets into a static file.
[1] https://www.wiumlie.no/2006/phd/css.pdf https://www.wiumlie.no/2006/phd/css.pdf
- tannhaeuser 6y agoWow, I'd absolutely love to hear more about this if you've got something to share ... To win a sizable portion of HNers, it suffices to say that DSSSL was the Scheme-based styling and transformation language of SGML (implemented by Jade/OpenJade). I can only imagine where we'd be now if DSSSL had won over CSS and similar FOSI-like ad-hoc styling languages (or even SGML's own LINK process declarations that however was kindof questioned by James Clark seeing the need for DSSSL). Personally I'm not into Lisp, but I'm very much missing the Lisp community's relentless search for ultimate simplicity, clarity, and expressiveness in the design of CSS.
- goto11 6y ago> I can only imagine where we'd be now if DSSSL had won over CSS We probably wouldn't have dynamic HTML then. DSSSL is basically the same idea as the XSLT/FO where document in semantic markup is transformed into a different purely presentational markup language (like PDF if it was SGML-based). It is a one-way operation on the whole document, and made totally sense for the intended use case which was to prepare document for print publishing.
- foobiekr 6y agoI did a lot of XSLT at one point. I think if I still had to do it I'd need to be on medication. Conceptually, I have no issue. Tree-to-tree transformations is a perfectly good concept and you use them a lot, especially if you do work that involves a lot of ASTs, for example. But the specifics matter, and XSLT was designed to be infuriating and punishing and the tools are terrible.
- lisper 6y ago> I can only imagine where we'd be now if DSSSL had won over CSS Or if Brendan Eich had prevailed when he wanted to embed Scheme in Netscape instead of Javascript.
- inopinatus 6y agoHe embedded Scheme in JavaScript instead but nobody noticed. As Lou Reed once said, “JavaScript is Lisp in drag”.
- lisper 6y agoExcept it isn't. JS has lexical closures, but that's not the only feature that makes Scheme what it is. JS got one thing right and about a dozen other things very badly wrong. https://blog.kevinchisholm.com/javascript/javascript-wat/ https://blog.kevinchisholm.com/javascript/javascript-wat/
- deleted 6y ago[deleted]
- inopinatus 6y agoJust to be clear, the Lou Reed quote was fake.
- lowwave 6y agoIt is called The Little JavaScripter https://www.crockford.com/little.html https://www.crockford.com/little.html Javascript is pretty much scheme or lisp.
- ajross 6y agoDon't forget the gigabytes of code spent trying to work around the cascade and produce some kind of framework for styling "components" that doesn't leak crazy state from the enclosing context (but does inherit the good stuff). The "cascade" was, for sure, a mistake. Not being in this world, though, I do wonder why there's been no real attempt to fix this from the ground up? I mean... it wouldn't really be "hard" to come up with an alternative metaphor for styling a tree of DOM fragments that compiled to CSS where needed but could be implemented as a first class technology with a proper specification. Modern browsers have multiple competing implementations of all sorts of other technologies. Why has no one tried to do a new style language? What should it look like?
- Scarbutt 6y agoThe "cascade" was, for sure, a mistake. FWIW, tailwind solves this problem (in a tedious way).
- azangru 6y ago> The "cascade" was, for sure, a mistake. Aren't global styles only possible because of the cascade and the child elements inheriting from parent elements? Without cascade, wouldn't you have to re-declare your font size and font family, and line-height, etc. on every element of your markup?
- im3w1l 6y ago.big-list > li {font-size: 200%}
- im3w1l 6y agoReplying to myself: What if you want to have a link or a span inside your list though? Wouldn't it look weird if they have different size than the surrounding text?
- strbean 6y agoThe cascade is not inheritance. The cascade is deciding the order to apply rules/stylesheets in, and which rule applies here: html: <div><a>Blah</a></div> css: a { color: red; } div a { color: blue; } Where the font color ends up being blue because `div a` is more specific than `a`.
- sixo 6y agoCan we just start over on the entire web stack? 1. create a serious styling and scripting framework, basically React as a language since people seem to like it 2. implement an interpreter in WASM. Ship the interpreter with the website unless the browser says not to 3. over time, build the interpreter into the browser
- justinator 6y ago> Can we just start over on the entire web stack? Haha, so sorry, but: no. And if we're starting over, when just start at the web stack?
- y04nn 6y agoI think it would worth it to start over with today's knowledge. The whole stack is garbage: HTTP should be replaced with HTTP2 or Quick, vanilla Javascrip is horrible, CSS feel even worse, HTML is not too bad. Almost all browsers are Webkit based, and there a very few browsers in use (Chrome/Firefox/Safari) which should ease the transition. I can't imagine all the wasted time and energy the world is putting into the current state of the web. A new standard would make navigation more performant, snappier, more responsive and much more reliable.
- justinator 6y agoThere's a lot I agree about starting over, but perhaps one of the main features of the web is its backwards compatibility. Most often when things are built from scratch, they fail miserably, unless one entity has full control of the entire stack. Unfortunately, that doesn't really describe the web. We're kind of stuck with a mess.
- LoSboccacc 6y agothere's canvas, you can already write apps that target it both in unity and Godot, the latter spring a wealth of languages
- 6y ago
- epc 6y agoI have a really dim recollection of an IBM WebExplorer variant that had limited support of DSSSL but it may have been tied to the work we were doing with HyTime. None of the interesting WebExplorer variants ever saw the light of day in public and it was killed fairly quickly by neglect.