<div>Thanks for the feedback on the proposal. It is good to hear some criticism- that means there are people using hamlet! So we have heard from current users now- can we get feedback from those not using hamlet? Does the new syntax tempt you into switching? If you were forced into a project with hamlet, which syntax would you like best? Does anyone think that designers would be more comfortable with the new syntax?</div>
<div><br></div><div>I would like to note another possible benefit to the proposal noted by a commenter on Michael's blog- the removal of the '%' character means that instead of signifying variable interpolation with '$' it could be done with the '%', making the syntax uniform across hamlet, cassius, and julius.</div>
<div><br></div><div><div>I would like to be clear on the design goal of being closer to html. All other things being equal, it is simply about avoiding a larger mental overhead when switching between html and hamlet. The new syntax does not mean we are "writing html" or have any "constraints" not already present in hamlet. It simply means attributes use a space instead of a '!', and tags begin with a '<' instead of a '%', and are separated with their inner text by a '>' instead of a space. While the proposal discusses the possibility of allowing things like closing tags, that would be optional if it were implemented.</div>
<div><br></div><div>Reducing the mental "context switch" could be useful for existing hamlet users that also works with html in other projects. But it is largely about getting more users of hamlet, particularly when they start a new project. I would not expect many projects to switch a project over, and closeness to html when switching an existing project over doesn't matter much once converters are available, and the larger the project, the more practical it is to write a converter. I see the real practical use on a smaller scale- if you want to copy and paste some html into your file, including html from a more traditional templating language where a converter may not available.</div>
<div><br></div><div>Space-based attributes:</div><div>Are there any objection to the *concept* of the change to use a space with attributes instead of a '!'?. This would actually make hamlet *more* similar to HAML.</div>
<div><br></div><div>The difficulty in implementation is with determining the end of the attribute portion of the tag. For '%body id=the-body' there would be ambiguity as to whether the id started an attribute or inner text. Even worse is an attribute without a value 'input type=checkbox checked'. One technique is to assume it is an attribute if an '=' sign is present- requiring escaping the '=' sign, and requiring a (possibly empty) value for every attribute. HAML handles attributes by requiring opening and closing symbole: '(attribute=name attribute2=name)', which looks nice, but I would much rather have white space to begin attributes, and the closing character is forced on you when there is no inner text.</div>
<div>Following my original proposal, the attributes could have a closing character that is optional when there is no text.</div><div><br></div><div> %body id=the-body class=the-class>Inner Text</div><div><br></div><div>
I could appreciate that this might look peculiar to someone when the tag leads with a '%' instead of a '<' as in the original proposal. I think '&' could be a lot more appealing and signifies 'and there is text', also similar to how it signifies more parameters in a url.</div>
<div><br></div><div> %body id=the-body class=the-class&Inner Text</div><div><div><br></div><div>So I am still proposing the original proposal. If the original is not accepted, or if we want more time to think about it or otherwise an intermediate step is desired I would still propose using a space-based attribute syntax. We could also consider the possibility of allowing both the '%&' and the '<>' syntaxes now that they would be very similar. However, I would strongly argue for using the html-compatible syntax. Those whose senses are offended by a lone opening '<' can still add the '>' and justify that it prepares them for adding inner text.</div>
<div><br></div><div class="gmail_quote">On Sun, Dec 12, 2010 at 3:00 AM, <span dir="ltr"><<a href="mailto:web-devel-request@haskell.org">web-devel-request@haskell.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Send web-devel mailing list submissions to<br>
<a href="mailto:web-devel@haskell.org">web-devel@haskell.org</a><br>
<br>
To subscribe or unsubscribe via the World Wide Web, visit<br>
<a href="http://www.haskell.org/mailman/listinfo/web-devel" target="_blank">http://www.haskell.org/mailman/listinfo/web-devel</a><br>
or, via email, send a message with subject or body 'help' to<br>
<a href="mailto:web-devel-request@haskell.org">web-devel-request@haskell.org</a><br>
<br>
You can reach the person managing the list at<br>
<a href="mailto:web-devel-owner@haskell.org">web-devel-owner@haskell.org</a><br>
<br>
When replying, please edit your Subject line so it is more specific<br>
than "Re: Contents of web-devel digest..."<br>
<br>
<br>
Today's Topics:<br>
<br>
1. Re: proposal for hamlet-like syntax that is more compatible<br>
with html (Michael Snoyman)<br>
2. Re: proposal for hamlet-like syntax that is more compatible<br>
with html (Alexandros Salazar)<br>
3. Re: proposal for hamlet-like syntax that is more compatible<br>
with html (Alexander Dunlap)<br>
<br>
<br>
----------------------------------------------------------------------<br>
<br>
Message: 1<br>
Date: Sat, 11 Dec 2010 17:48:48 +0200<br>
From: Michael Snoyman <<a href="mailto:michael@snoyman.com">michael@snoyman.com</a>><br>
Subject: Re: [web-devel] proposal for hamlet-like syntax that is more<br>
compatible with html<br>
To: Simon Michael <<a href="mailto:simon@joyful.com">simon@joyful.com</a>><br>
Cc: <a href="mailto:web-devel@haskell.org">web-devel@haskell.org</a><br>
Message-ID:<br>
<AANLkTinumxoNV-efehgrVBUnoNUYvRB1ijC01aN6Pv=<a href="mailto:6@mail.gmail.com">6@mail.gmail.com</a>><br>
Content-Type: text/plain; charset=ISO-8859-1<br>
<br>
Alright, at this point I've only heard positive things about this<br>
syntax change. Does anyone want to volunteer to try and tackle this,<br>
or will this need to wait till I can get around to it? Fair warning:<br>
I'm likely to try to deal with the WAI + enumerator and xml-enumerator<br>
tasks first. If someone wants to take a crack at the Hamlet changes,<br>
I'll be happy to review things.<br>
<br>
Michael<br>
<br>
On Sat, Dec 11, 2010 at 2:38 AM, Simon Michael <<a href="mailto:simon@joyful.com">simon@joyful.com</a>> wrote:<br>
> I support this proposal's goal, and would be fine with rewriting my<br>
> templates.<br>
><br>
><br>
> _______________________________________________<br>
> web-devel mailing list<br>
> <a href="mailto:web-devel@haskell.org">web-devel@haskell.org</a><br>
> <a href="http://www.haskell.org/mailman/listinfo/web-devel" target="_blank">http://www.haskell.org/mailman/listinfo/web-devel</a><br>
><br>
<br>
<br>
<br>
------------------------------<br>
<br>
Message: 2<br>
Date: Sat, 11 Dec 2010 11:17:37 -0500<br>
From: Alexandros Salazar <<a href="mailto:nomothetis@gmail.com">nomothetis@gmail.com</a>><br>
Subject: Re: [web-devel] proposal for hamlet-like syntax that is more<br>
compatible with html<br>
To: <a href="mailto:web-devel@haskell.org">web-devel@haskell.org</a><br>
Message-ID:<br>
<<a href="mailto:AANLkTikxJfPFOnD8Fzo9-bpH9g8Z6S6n8aCwB9%2BkvbAM@mail.gmail.com">AANLkTikxJfPFOnD8Fzo9-bpH9g8Z6S6n8aCwB9+kvbAM@mail.gmail.com</a>><br>
Content-Type: text/plain; charset="utf-8"<br>
<br>
My belated 2c (sorry, work has been keeping me away from things Yesod and<br>
Haskell):<br>
<br>
1. The key reason I switched to Yesod was Hamlet. I'm very new to Haskell,<br>
and I wanted to try developing a webapp in it; when I looked at the various<br>
frameworks, my main question was "What will require me to learn the least<br>
new stuff, while still giving me a full Haskell-based development<br>
experience?" Yesod was the answer, because I was already familiar with Haml.<br>
So, it is one less thing a large swath of people need to learn when they<br>
decide to give Yesod a try. And at least in my case, it was a deciding<br>
factor.<br>
<br>
2. I'm not convinced closeness to HTML is a design goal. My experience is<br>
again limited, but I wouldn't expect many people to switch existing projects<br>
to Yesod (or really, from any framework to any other); therefore, the idea<br>
that someone will have a bunch of HTML to be converted as simply as possible<br>
to whatever templating language we use seems remote.<br>
<br>
3. Along the same lines, the reason for the existence of templating<br>
frameworks like Haml and Hamlet is precisely that people don't enjoy writing<br>
HTML: why would we constrain ourselves by similarity to something people<br>
have put large (and creative) amounts of effort into avoiding? I think it is<br>
unduly limiting.<br>
<br>
4. I do believe there are some issues with Hamlet; in fact, the issues<br>
raised by Greg are exactly the issues I have. I don't see having a<br>
Yesod-specific templating language as the solution, unless this new syntax<br>
gives Yesod such a big productivity boost compared to using Hamlet that it's<br>
worth putting in the effort.<br>
<br>
In brief, I think Hamlet is 95% of the way there, and that Michael has done<br>
a great job with it. It seems easier to take it another 4% and get it to 99%<br>
than it would be to rewrite the syntax from scratch. I don't view HTML<br>
similarity as a bonus (or a malus, either way). Maintaining (and furthering)<br>
similarity with Haml seems worthier goal, given how many people use it, are<br>
familiar with it, and love it; it will ease adoption.<br>
<br>
I hope this all made sense, and that I didn't start an argument about bike<br>
shed colors... ;-)<br>
<br>
Alexandros<br>
<br>
<br>
<br>
On Sat, Dec 11, 2010 at 10:48 AM, Michael Snoyman <<a href="mailto:michael@snoyman.com">michael@snoyman.com</a>>wrote:<br>
<br>
> Alright, at this point I've only heard positive things about this<br>
> syntax change. Does anyone want to volunteer to try and tackle this,<br>
> or will this need to wait till I can get around to it? Fair warning:<br>
> I'm likely to try to deal with the WAI + enumerator and xml-enumerator<br>
> tasks first. If someone wants to take a crack at the Hamlet changes,<br>
> I'll be happy to review things.<br>
><br>
> Michael<br>
><br>
> On Sat, Dec 11, 2010 at 2:38 AM, Simon Michael <<a href="mailto:simon@joyful.com">simon@joyful.com</a>> wrote:<br>
> > I support this proposal's goal, and would be fine with rewriting my<br>
> > templates.<br>
> ><br>
> ><br>
> > _______________________________________________<br>
> > web-devel mailing list<br>
> > <a href="mailto:web-devel@haskell.org">web-devel@haskell.org</a><br>
> > <a href="http://www.haskell.org/mailman/listinfo/web-devel" target="_blank">http://www.haskell.org/mailman/listinfo/web-devel</a><br>
> ><br>
><br>
> _______________________________________________<br>
> web-devel mailing list<br>
> <a href="mailto:web-devel@haskell.org">web-devel@haskell.org</a><br>
> <a href="http://www.haskell.org/mailman/listinfo/web-devel" target="_blank">http://www.haskell.org/mailman/listinfo/web-devel</a><br>
><br>
-------------- next part --------------<br>
An HTML attachment was scrubbed...<br>
URL: <<a href="http://www.haskell.org/pipermail/web-devel/attachments/20101211/1d41e534/attachment-0001.htm" target="_blank">http://www.haskell.org/pipermail/web-devel/attachments/20101211/1d41e534/attachment-0001.htm</a>><br>
<br>
------------------------------<br>
<br>
Message: 3<br>
Date: Sat, 11 Dec 2010 18:32:51 -0800<br>
From: Alexander Dunlap <<a href="mailto:alexander.dunlap@gmail.com">alexander.dunlap@gmail.com</a>><br>
Subject: Re: [web-devel] proposal for hamlet-like syntax that is more<br>
compatible with html<br>
To: Michael Snoyman <<a href="mailto:michael@snoyman.com">michael@snoyman.com</a>><br>
Cc: Simon Michael <<a href="mailto:simon@joyful.com">simon@joyful.com</a>>, <a href="mailto:web-devel@haskell.org">web-devel@haskell.org</a><br>
Message-ID:<br>
<AANLkTinqnFVeCyOHLudnxpKGXWXFGmsHrFVX=<a href="mailto:6eBTivr@mail.gmail.com">6eBTivr@mail.gmail.com</a>><br>
Content-Type: text/plain; charset=UTF-8<br>
<br>
I would prefer that the bikeshed stay the color it already is. ;) The<br>
syntax is easier for me as it is different from HTML. The HTML-like<br>
syntax looks to me like invalid HTML and is more difficult to read.<br>
<br>
Alex<br>
<br>
On Sat, Dec 11, 2010 at 7:48 AM, Michael Snoyman <<a href="mailto:michael@snoyman.com">michael@snoyman.com</a>> wrote:<br>
> Alright, at this point I've only heard positive things about this<br>
> syntax change. Does anyone want to volunteer to try and tackle this,<br>
> or will this need to wait till I can get around to it? Fair warning:<br>
> I'm likely to try to deal with the WAI + enumerator and xml-enumerator<br>
> tasks first. If someone wants to take a crack at the Hamlet changes,<br>
> I'll be happy to review things.<br>
><br>
> Michael<br>
><br>
> On Sat, Dec 11, 2010 at 2:38 AM, Simon Michael <<a href="mailto:simon@joyful.com">simon@joyful.com</a>> wrote:<br>
>> I support this proposal's goal, and would be fine with rewriting my<br>
>> templates.<br>
>><br>
>><br>
>> _______________________________________________<br>
>> web-devel mailing list<br>
>> <a href="mailto:web-devel@haskell.org">web-devel@haskell.org</a><br>
>> <a href="http://www.haskell.org/mailman/listinfo/web-devel" target="_blank">http://www.haskell.org/mailman/listinfo/web-devel</a><br>
>><br>
><br>
> _______________________________________________<br>
> web-devel mailing list<br>
> <a href="mailto:web-devel@haskell.org">web-devel@haskell.org</a><br>
> <a href="http://www.haskell.org/mailman/listinfo/web-devel" target="_blank">http://www.haskell.org/mailman/listinfo/web-devel</a><br>
><br>
<br>
<br>
<br>
------------------------------<br>
<br>
_______________________________________________<br>
web-devel mailing list<br>
<a href="mailto:web-devel@haskell.org">web-devel@haskell.org</a><br>
<a href="http://www.haskell.org/mailman/listinfo/web-devel" target="_blank">http://www.haskell.org/mailman/listinfo/web-devel</a><br>
<br>
<br>
End of web-devel Digest, Vol 16, Issue 6<br>
****************************************<br>
</blockquote></div><br></div></div>