Elegant & powerful replacement for CSS

[Spin-off from the haskell-cafe discussion on functional/denotational GUI toolkits] I've been wondering for a while now what a well-designed alternative to CSS could be, where well-designed would mean consistent, composable, orthogonal, functional, based on an elegantly compelling semantic model (denotational). - Conal

Similarly, I've been wondering what's at the core of a GUI? It seems
in recent years that more people have been moving towards web-based
applications, and away from traditional GUIs, so the meaning of them
may be changing. The old question seemed to be Page vs.
Control-Board, but that seems like implementation, when the real
essence of a GUI is taking in common kinds of user input and
displaying output in a sensible way. Similarly, there are more ways
to interact with a computer than ever before, from simple keyboard up
through multitouch interfaces like the iPhone. It would be cool to me
to see a semantic model that captures this.
2009/2/3 Conal Elliott
[Spin-off from the haskell-cafe discussion on functional/denotational GUI toolkits]
I've been wondering for a while now what a well-designed alternative to CSS could be, where well-designed would mean consistent, composable, orthogonal, functional, based on an elegantly compelling semantic model (denotational).
- Conal
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Isn't CSS about giving a "style" to the "views" in the model-view-controller
paradigm? So basically it is a way to change the look of a user interface,
without having to change the user interface definition itself.
But isn't this just an environment monad that has functions to convert a
model into a view (= geometry = render function + picking function)? Plugin
a different environment and voila, the widgets are painted and maybe even
layed differently, but you don't have to change any code or data....
Of course what a "model" really is, is not fully clear:
http://blogs.msdn.com/johngossman/archive/2005/10/08/478683.aspx
On Tue, Feb 3, 2009 at 8:50 PM, Jeff Heard
Similarly, I've been wondering what's at the core of a GUI? It seems in recent years that more people have been moving towards web-based applications, and away from traditional GUIs, so the meaning of them may be changing. The old question seemed to be Page vs. Control-Board, but that seems like implementation, when the real essence of a GUI is taking in common kinds of user input and displaying output in a sensible way. Similarly, there are more ways to interact with a computer than ever before, from simple keyboard up through multitouch interfaces like the iPhone. It would be cool to me to see a semantic model that captures this.
2009/2/3 Conal Elliott
: [Spin-off from the haskell-cafe discussion on functional/denotational GUI toolkits]
I've been wondering for a while now what a well-designed alternative to CSS could be, where well-designed would mean consistent, composable, orthogonal, functional, based on an elegantly compelling semantic model (denotational).
- Conal
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

2009/2/3 Peter Verswyvelen
Isn't CSS about giving a "style" to the "views" in the model-view-controller paradigm? So basically it is a way to change the look of a user interface, without having to change the user interface definition itself.
In theory CSS separates content from presentation. In reality it looks like it isn't really powerful enough. Serendipitously, this rant popped up on reddit recently: http://www.flownet.com/ron/css-rant.html Summary: CSS's failures mean that the rendering of a page depends on the order of elements in the content. We have CleverCSS: a little less ambitious than Conal and Jeff imagined, I think, but still an improvement over raw CSS: http://sandbox.pocoo.org/clevercss-hs/ Alistair

Jeff Heard wrote:
Similarly, I've been wondering what's at the core of a GUI? It seems in recent years that more people have been moving towards web-based applications, and away from traditional GUIs, so the meaning of them may be changing. The old question seemed to be Page vs. Control-Board, but that seems like implementation, when the real essence of a GUI is taking in common kinds of user input and displaying output in a sensible way.
I would go with Bret Victor's argument (http://worrydream.com/ MagicInk/) that the concept of user interface as primarily _interaction_ is misguided. What GUIs are really about is visual _presentation_ of information. The semantic questions are about what it means graphically to compose information sources. We spend more time reading, viewing, and absorbing that information, than rearranging it, or adding to it. Interaction changes the sources, or the way they compose, but is (or should be) fundamentally an infrequent activity. The better the visual presentation, the less you need to interact with it. Regards, Malcolm

Bret's argument, though, only applies to Information Software.
Which... hey, if you want to go with describing fundamentally
different approaches to GUIs based on the classifications he uses in
his arguments, I think that's a better place to start than trying to
figure out how to make a new denotationally-semantic GUI toolkit that
works for everyone everywhere.
On Tue, Feb 3, 2009 at 4:48 PM, Malcolm Wallace
Jeff Heard wrote:
Similarly, I've been wondering what's at the core of a GUI? It seems in recent years that more people have been moving towards web-based applications, and away from traditional GUIs, so the meaning of them may be changing. The old question seemed to be Page vs. Control-Board, but that seems like implementation, when the real essence of a GUI is taking in common kinds of user input and displaying output in a sensible way.
I would go with Bret Victor's argument (http://worrydream.com/MagicInk/) that the concept of user interface as primarily _interaction_ is misguided. What GUIs are really about is visual _presentation_ of information. The semantic questions are about what it means graphically to compose information sources. We spend more time reading, viewing, and absorbing that information, than rearranging it, or adding to it.
Interaction changes the sources, or the way they compose, but is (or should be) fundamentally an infrequent activity. The better the visual presentation, the less you need to interact with it.
Regards, Malcolm
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Malcolm Wallace
I would go with Bret Victor's argument (http://worrydream.com/ MagicInk/) that the concept of user interface as primarily _interaction_ is misguided.
I tend to disagree. But then I'm a game developer, not an HTML monk... what definitely makes sense, though, is to divide the gui visually along presentation of the world vs. presentation of your interface to the world. "presentation of your interface to the world" subsumes such things as the marker on the minimap that shows which part you are looking at, and what tool you selected to interact with it (say zoom, smudge, paintbrush) -- (c) this sig last receiving data processing entity. Inspect headers for copyright history. All rights reserved. Copying, hiring, renting, performance and/or quoting of this signature prohibited.

On 3 Feb 2009, at 20:39, Conal Elliott wrote:
[Spin-off from the haskell-cafe discussion on functional/ denotational GUI toolkits]
I've been wondering for a while now what a well-designed alternative to CSS could be, where well-designed would mean consistent, composable, orthogonal, functional, based on an elegantly compelling semantic model (denotational).
Can I start by replacing html please :) I'd like to separate the document in roughly the same way as html and css attempt to, meaning I'd like a document description language, and a styling description language. I can imagine the styling language having the meaning "function from documents onto geometry", but the document description language is harder. Ideally what I'd like to do with it is to make it describe *only* the logical structure of the information being conveyed – sections, text, figures, tables (no, not for layout, for tabular data) etc. I can't though come up with a nice simple solution to that that (a) restricts users to really describing documents, not layout (b) still allows for composability in any sensible kind of way. Bob

On Tue, Feb 3, 2009 at 2:06 PM, Thomas Davie
On 3 Feb 2009, at 20:39, Conal Elliott wrote:
[Spin-off from the haskell-cafe discussion on functional/denotational GUI
toolkits]
I've been wondering for a while now what a well-designed alternative to CSS could be, where well-designed would mean consistent, composable, orthogonal, functional, based on an elegantly compelling semantic model (denotational).
Can I start by replacing html please :)
I'd like to separate the document in roughly the same way as html and css attempt to, meaning I'd like a document description language, and a styling description language.
I can imagine the styling language having the meaning "function from documents onto geometry", but the document description language is harder. Ideally what I'd like to do with it is to make it describe *only* the logical structure of the information being conveyed – sections, text, figures, tables (no, not for layout, for tabular data) etc.
This is easy to me. Everything is content. Sections, text, figures, tables -- these are all static content. Functions are interactive content. Numbers are content, as are lists of content, maybe content ... The interesting part is how you display it. In the simplest sense, a "style" is just a function Style a = a -> Geometry. But work has been done, eg. with TVs, that have composition of content and composition of the display mirror each other. I'm not totally satisfied with TVs. For example, I think it's worth exploration describing *how* the content was composed, such that styling language maps compositions of content to compositions of geometry. Content is not interesting. The *mapping* from content to presentation is the important part. Luke

Thomas Davie wrote:
I can imagine the styling language having the meaning "function from documents onto geometry", but the document description language is harder. Ideally what I'd like to do with it is to make it describe *only* the logical structure of the information being conveyed – sections, text, figures, tables (no, not for layout, for tabular data) etc. I can't though come up with a nice simple solution to that that (a) restricts users to really describing documents, not layout (b) still allows for composability in any sensible kind of way.
I can see LaTeX as demonstrating that there is no such (single) language. It seems to me that the elementary units (chapters, sections, paragraphs,...) depend almost entirely on the domain of the document (a book, an article,...). In a similar way, many of the most painful examples of HTML come from people bludgeoning the elementary units into misservice. XML escapes from this by only providing a syntax/ontology rather than a language per se. So it seems to me that a general document framework should be an ontology of what primitives could exist, rather than a set of actual primitives. Of course, an ontological framework is no good without some collection of example languages it describes. One of the big tricks here is not in what languages look like in isolation, but in how languages can be combined or extended. -- Live well, ~wren

wren ng thornton
I can see LaTeX as demonstrating that there is no such (single) language. It seems to me that the elementary units (chapters, sections, paragraphs,...) depend almost entirely on the domain of the document (a book, an article,...).
This is what I had in mind while I tried to write the plumbing to agar objects: Defining your own widgets. A library to do this, it seems would consist of things like ActionProducers instead of Buttons, and TextInput instead of TextBoxen and ListBoxen... that is, of Event ()'s and Behaviour/Event String's, alongside with high-level renderers, coupled with a feedback mechanism, that'll then be called Button and TextBox. A Listbox is already made out of such primitives, but this should be transparent to the developer. Another most important thing that I really want to have, is to enable the end-user to edit presentation, in a sensible way, like re-specifying the width of textboxen, add additional hiding panes etc. -- (c) this sig last receiving data processing entity. Inspect headers for copyright history. All rights reserved. Copying, hiring, renting, performance and/or quoting of this signature prohibited.

Conal Elliott
[Spin-off from the haskell-cafe discussion on functional/denotational GUI toolkits]
I've been wondering for a while now what a well-designed alternative to CSS could be, where well-designed would mean consistent, composable, orthogonal, functional, based on an elegantly compelling semantic model (denotational).
I think a very important thing to keep in mind while investigating web-technologies for pointers is that Haskell already comes with XML and XSLT (in the disguise of ADT's and functions), and that CSS is often abused for operations that are in the domain of XSLT. I don't believe that it's possible to draw a clear destinction between "concerns the programmer" and "concerns the designer". In fact, I get offended by the notion that I'm inherently incapable of distinguishing readable from unreadable text, and think that the notion of designers being unable to do anything but assembling a colourful collage of the data they're given is more of a self-fulfilling prophecy than a truth. -- (c) this sig last receiving data processing entity. Inspect headers for copyright history. All rights reserved. Copying, hiring, renting, performance and/or quoting of this signature prohibited.

amen & amen! thanks, achim.
On Tue, Feb 3, 2009 at 4:50 PM, Achim Schneider
Conal Elliott
wrote: [Spin-off from the haskell-cafe discussion on functional/denotational GUI toolkits]
I've been wondering for a while now what a well-designed alternative to CSS could be, where well-designed would mean consistent, composable, orthogonal, functional, based on an elegantly compelling semantic model (denotational).
I think a very important thing to keep in mind while investigating web-technologies for pointers is that Haskell already comes with XML and XSLT (in the disguise of ADT's and functions), and that CSS is often abused for operations that are in the domain of XSLT.
I don't believe that it's possible to draw a clear destinction between "concerns the programmer" and "concerns the designer". In fact, I get offended by the notion that I'm inherently incapable of distinguishing readable from unreadable text, and think that the notion of designers being unable to do anything but assembling a colourful collage of the data they're given is more of a self-fulfilling prophecy than a truth.
-- (c) this sig last receiving data processing entity. Inspect headers for copyright history. All rights reserved. Copying, hiring, renting, performance and/or quoting of this signature prohibited.
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

On Wed, Feb 4, 2009 at 1:50 AM, Achim Schneider
I don't believe that it's possible to draw a clear destinction between "concerns the programmer" and "concerns the designer". In fact, I get offended by the notion that I'm inherently incapable of distinguishing readable from unreadable text, and think that the notion of designers being unable to do anything but assembling a colourful collage of the data they're given is more of a self-fulfilling prophecy than a truth.
Having worked in the nexgen games industry with lots of designers and artists, I can only agree with Achim here. One cannot draw a hard line between programmers and designers, because these two come in all kinds of flavors ;-)

Conal Elliott wrote:
I've been wondering for a while now what a well-designed alternative to CSS could be, where well-designed would mean consistent, composable, orthogonal, functional, based on an elegantly compelling semantic model (denotational).
Me too. I think there are several aspects 1. Layout description, i.e. sidebar `besides` (content `above` footer) 2. Visual properties, like red borders or blue backgrounds. 3. Applying the style sheet to the document, i.e. to the semantic markup. Current CSS is very weak at point 1, a clean box model in the spirit of TeX or Lout http://en.wikipedia.org/wiki/Lout is preferable. Point 2 is solved fairly well by current CSS. Background and border colors are primitives, after all; so it boils down to a list of attributes. But a higher-order language is preferably as well, for example to capture common combinations in a variable instead of having to cascade it. Concerning point 3, CSS does ok for a hard-coded and specific output medium. Ideally, one and the same content could be visualized for different output media like web browsers (resizable), printer (PDF quality) or an overhead projector. I imagine some kind of macro language like LaTeX, Lout or XML "with macros"; but none of these examples are elegant enough for my taste. It should be possible to embed other languages for instance for mathematical formulas, highlighted source code, etc. I imagine that 3 is compiled to some kind of "CSS bytecode" consisting of 2 and 1. Regards, apfelmus -- http://apfelmus.nfshost.com

You might be interested in some of the recent work by Leo Meyerovich et al. at Berkeley. They wanted to parallelize CSS processing, and found they had to construct a simplified, orthogonal version of CSS and express their algorithms in terms of that subset. This is very much work in progress, but there's a description and pointer to talk slides here: http://www.eecs.berkeley.edu/~lmeyerov/#projects Presumably their forthcoming HotPar paper will yield more details. -Jan-Willem Maessen On Feb 3, 2009, at 2:39 PM, Conal Elliott wrote:
[Spin-off from the haskell-cafe discussion on functional/ denotational GUI toolkits]
I've been wondering for a while now what a well-designed alternative to CSS could be, where well-designed would mean consistent, composable, orthogonal, functional, based on an elegantly compelling semantic model (denotational).
- Conal
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
participants (11)
-
Achim Schneider
-
Alistair Bayley
-
Conal Elliott
-
Heinrich Apfelmus
-
Jan-Willem Maessen
-
Jeff Heard
-
Luke Palmer
-
Malcolm Wallace
-
Peter Verswyvelen
-
Thomas Davie
-
wren ng thornton