Parsing doesn't factor into any benchmarks for any templating language,
because that's not where time is being spent. For a good implementation,
once it's parsed once, it's never parsed again - it's compiled to Ruby (or
whatever the host language is) and that compiled form is cached as a method.
What the Parkaby benchmarks are measuring is the speed of these methods. I
still need to do some research to see why Parkaby ends up being so much
quicker than Haml, but rest assured it's not because they parse the
templates faster.

On Fri, Jul 10, 2009 at 3:36 PM, Chris Eppstein <[email protected]> wrote:

> Basic lexing, parsing and generation could be done in C, with binding
> callbacks to the host language for language specific bits. I would love to
> see some big performance enhancements for
> haml, I don't think a pure ruby implementation gets it done.
> If you've not seen Parkaby, check it out:
> http://github.com/judofyr/parkaby
>
> It is fast because it's basically using the ruby parser (written in C) and
> nothing else. I think Haml could get close to these numbers with a C engine
> (5-10x faster). With a parser generator like ragel, we could even allow for
> generating a pure ruby or pure java version as well for environments that
> are hostile to native libraries.
>
> chris
>
> On Fri, Jul 10, 2009 at 12:11 PM, Nathan Weizenbaum <[email protected]>wrote:
>
>> There are indeed several implementations of Haml in various languages: the
>> Wikipedia article has a 
>> list<http://en.wikipedia.org/wiki/Haml#Implementations>.
>> If you're implementing a new one, feel free to join the haml-dev google
>> group <http://groups-beta.google.com/group/haml-dev>.
>> As for a C baseline, I don't think that's
>> workable. In order for Haml to integrate reasonably into a host language, 
>> it'll need to support that language's control structures. This means 
>> basically that it will need to be compiled into that language, leaving not a 
>> whole lot of room for a C imlementation.
>>
>>
>> On Fri, Jul 10, 2009 at 2:33 PM, Norman Clarke <[email protected]> wrote:
>>
>>>
>>> Hi,
>>>
>>> I'm curious if anyone is currently working on implementing Haml in
>>> other languages. I've seen that there are a few implementations in PHP
>>> underway already, and some questions about using it with Python, so
>>> obviously there's some interest in using Haml outside of Ruby.
>>>
>>> Right now I'm working on an implementation in Lua. This is something
>>> that I don't think is going to be widely used (Lua isn't exactly
>>> popular for web development at the moment) but scratches a personal
>>> itch.
>>>
>>> I was talking with a friend last night who liked the idea of
>>> developing a library in C that could provide a basis for fast
>>> implementations in other languages, though we still have no concrete
>>> plans.
>>>
>>> So really I'm just wondering if other people have looked into this and
>>> what their thoughts might be.
>>>
>>> Regards,
>>>
>>> Norman
>>>
>>>
>>>
>>
>>
>>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Haml" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [email protected]
For more options, visit this group at http://groups.google.com/group/haml?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to