It's almost definitely going to be faster to do it on the server. Not only are many servers going to have more computing power to devote to the task than your average browser (and remember, in-browser Javascript runs slowly, although it's getting faster), but Haml is much, much slower when it needs to be parsed. On the server, Haml templates are cached; they only need to be parsed and evaled once, and from then on it's no more expensive than calling a Ruby function. Client-side, though, every browser would need to parse the Haml every time it loads a page.
Not to mention that a significant portion of what makes Haml nice is its templating facilities - it allows you to embed Ruby code in a nice way. That wouldn't work at all, and you'd probably need an additional templating language just to insert server values into the templates. On Fri, Jun 26, 2009 at 10:24 PM, Jan Koprowski <[email protected]>wrote: > > Hi ! > > From last few days i consider some extra scenario for using HAML. > How If HAML wasn't be translate on framework (server) side but a > little bit later on client side. Exactly in browser. This idea is was > submited on "Make the Web Faster" initiative Google Group. > How this could work ? For instance like web extension with high > performance HAML translator wrote in JavaScript - which we can use in > almost all web browsers as GreasMonkey script or in Google Chrome > natively. Maybe there is the better way to make and use there extra > efficient C implemented translator. > From C implementation is a short way to make HAML translation > entirely putting it to webservers for example as Apache 2 module, > nginx module. > > What do You think ? Is this a good goals for make this cool HAML stuff > more popular and web faster ? > > Greetings from Poland ! > -- > Jan Koprowski > > > > --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
