[erlang-questions] [ANN] Brim - HTML templating library

Per Melin per.melin@REDACTED
Sun Mar 18 18:34:59 CET 2012


On Mar 15, 2012, at 21:42 , Bob Ippolito wrote:

> You could also consider going down the road of parse transforms to keep the string syntax but get rid of the runtime string parsing.

Good idea. I've written an optional parse transform now.

The performance gain should in most cases be negligible. To parse a fairly complex selector takes ~5 µs on my computer. Still, if e.g. you are filling a table with a large data set you could otherwise end up parsing the same selectors thousands of times at runtime for a single page.


> Personally I like the CSS selector syntax. It's terse but not hard to understand, and you already know it if you've done pretty much any client-side web development. Even with an alternative syntax you're still going to need to learn a subset of the same keywords (id, first_child, etc.) which is I think much more work than picking up the grammar.

Yes, I'm partial to CSS selectors too. But as O'Keefe likes to say; "STRINGS ARE WRONG".

At least problems and inconveniences with escaping should be minimal in this case.




More information about the erlang-questions mailing list