[Haskell-cafe] Fwd: Generating valid html

Mike Meyer mwm at mired.org
Thu Nov 13 21:15:36 UTC 2014


On Thu, Nov 13, 2014 at 12:56 PM, Evan Laforge <qdunkan at gmail.com> wrote:

> On Wed, Nov 12, 2014 at 2:44 PM, Wojtek Narczyński <wojtek at power.com.pl>
> wrote:
> > How to create a DSL for HTML generation, that would (statically) allow
> only
> > valid HTML to be generated? Parent - child relations, valid attributes
> only.
> >
> > Or does such a DSL already exist, perhaps?
>
> WASH did that, a long time ago.  They mentioned that they
> intentionally relaxed the rules, since being totally correct was
> annoying to actually use.  There are docs here:
> http://www2.informatik.uni-freiburg.de/~thiemann/WASH/
>

Well, a lot of folks felt that any validation beyond "it works in my
browser" was annoying to actually use. I, on the other hand, used NSGML in
emacs and the actual DTD without much problem. But there were multiple
DTDs, some of which also relaxed things because so many people felt the
strict rules were annoying to actually use.

It didn't seem to catch on, so maybe it was too heavy for its benefits.
>

Based on a decade of trying to get people to write valid HTML - so that it
would work in browsers other than the most popular two or three on the most
popular two or three platforms - most people don't care about "correct"..
I've had people - including employees of the FSF, who I would expect
otherwise from - tell me that their HTML was tested on some limited set of
browser/platform pairs when I pointed out it was incorrect and hence broke
on some obscure browser/platform combination. Or even on one of those
browser/platform pairs with a configuration change.

This also seems to be true in the Haskell community. The web platforms help
catching the obvious problems you find testing against a browser. But -
like most popular web platforms - break the tools that help with the
creation of valid HTML

Validating HTML against a DTD is much easier than doing so against
browsers, but my clients never did it unless I set it up for them. Doing so
helped find more than one really obscure bug, and on one occasion kept my
clients web site working when a major browser tweaked how it handled broken
code and broke a lot of web sites.

I think this may be related to why ADTs are a hard sell. While they help a
lot writing correct programs, but for just writing working programs not so
much.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20141113/4190c8aa/attachment.html>


More information about the Haskell-Cafe mailing list