Earlier quoted context omitted.
There is always Grid Style Sheets[1] if you want to try it out. It is based on the same algorithms as iOS constraint engine[2] AFAIK. Unfortunately it has to compute the constraints using javascript as its not native. [1]: https://gridstylesheets.org/ [2]: https://en.wikipedia.org/wiki/Cassowary_(software)
WebAssembly should be able to help with that, no?
Languages Which Almost Became CSS
81–90 of 136 posts
Re: Languages Which Almost Became CSS
#82Writing pages in a web site is a mess, polluted by different syntaxes, HTML, CSS, Javascript, jQuery things, MarkDown, ... It's a miracle that Wikipedia exists! Several works have been done to bring some unity, for instance Skribe, Scribble, LAML, SXML, but they generally lead to complex systems devoted to coders and forgetting web designers and, of course, beginners. The {lambda way} project is built as a thin overl…
https://xkcd.com/927/
Re: Languages Which Almost Became CSS
#83Layout should have been constraint-oriented, not procedural. You should be able to express "Bottom of this box is adjacent to top of that box", and such. All those constraints go into a constraint engine, and a layout is generated. This is something a WYSIWYG editor can generate. To get a sense of how this could work, try sketch mode in Autodesk Inventor (there's a free 30 day demo) You can specify that a point must…
Constraint layout systems are O(n^2) algorithms, while a procedural layout algo can be O(1) or O(n). I think out of practicality it wasn't adopted. It would be better if both were available, but such is life. http://floriankugler.com/2013/04/22/auto-layout-performance-...
Those are the upper bounded constraints, but not reality.
Pragmatically, there's no reason 'constraint bounded' algs can't - in practice - approach procedural layouts.
Second, is the fact that layout is becoming less and less of an issue re: performance, to the point that in a few years, the argument may be moot.
Third, I'd argue that 'performance' is only one factor.
But good point.
Re: Languages Which Almost Became CSS
#84Layout should have been constraint-oriented, not procedural. You should be able to express "Bottom of this box is adjacent to top of that box", and such. All those constraints go into a constraint engine, and a layout is generated. This is something a WYSIWYG editor can generate. To get a sense of how this could work, try sketch mode in Autodesk Inventor (there's a free 30 day demo) You can specify that a point must…
> The people who designed HTML5 and CSS thought procedurally, not geometrically. It shows. The problem the article points out is that they wanted styling to happen, before the entire document is downloaded. Obv. you can't say, "hey, this box should be pinned to the bottom of the footer" if the HTML for the footer isn't yet existing in the stream that's downloaded. I think enough people fume when they see the Flash of…
Re: Languages Which Almost Became CSS
#85Earlier quoted context omitted.
Not only do I think the stylesheets would not end up appreciably smaller after gzip, I also disagree with that argument. Rendering performance (animations, scrolling, etc.) is one of the key reasons why native is perceived to be winning vs. the Web. Making the Web even slower at rich interactive apps is not doing the Web any favors.
> Rendering performance (animations, scrolling, etc.) is one of the key reasons why native is perceived to be winning vs. the Web. Except this is an argument against JavaScript driven behaviour, not against a restricted styling language slightly more expressive than CSS. The fact that we would be able to move some of this dynamic behaviour from a general purpose language where optimizing redraw is difficult, to a dom…
No, it wouldn't. "Optimizing redraw" isn't difficult, and to the extent that it is it has nothing to do with the expressiveness of CSS.
Re: Languages Which Almost Became CSS
#86Re: Languages Which Almost Became CSS
#87Earlier quoted context omitted.
It's used for screen layout in MacOS Lion and Grid Style Sheets.[1] There's also a subdomain that goes faster, and simple layouts should be in that subdomain. The idea is to get away from programmer-oriented layout input.
Right, but neither Lion or Grid Style Sheets were available in the early 90's. It may have been possible to implement, sure, but we're talking early enough in the web's history that the performance of the styling engine was a legitimate concern.
Re: Languages Which Almost Became CSS
#88Earlier quoted context omitted.
Constraint layout systems are O(n^2) algorithms, while a procedural layout algo can be O(1) or O(n). I think out of practicality it wasn't adopted. It would be better if both were available, but such is life. http://floriankugler.com/2013/04/22/auto-layout-performance-...
"Constraint layout systems are O(n^2) algorithms, while a procedural layout algo can be O(1) or O(n)." Those are the upper bounded constraints, but not reality. Pragmatically, there's no reason 'constraint bounded' algs can't - in practice - approach procedural layouts. Second, is the fact that layout is becoming less and less of an issue re: performance, to the point that in a few years, the argument may be moot. Th…
Devices you support will also last 5+ years and I don't think we will see the same power/performance ratio gains in mobile in the next 5 years like we have in the last 5 years. I bought an iPad Mini 4 recently and I see general stuttering in the OS programs alone and it's the most recent iPad Mini you can buy!
You can have something pretty close to constraint based layouts in procedural layouts in something like "snap view 1 bottom to view 2 top", etc.
Re: Languages Which Almost Became CSS
#89Re: Languages Which Almost Became CSS
#90Earlier quoted context omitted.
The engineering management that prevented Scheme in the browser should never be forgiven: https://brendaneich.com/2008/04/popularity/
Scheme in the browser would have been fine. Scheme in the hot path of every single restyle, not so much.