[jifty-devel] some progress update about Template::Declare

Kang-min Liu gugod at gugod.org
Wed Jan 7 07:18:09 EST 2009


ruz:

imho, the new syntax is easier to read. And it actually renders faster in
runtime. Of course it's just shift some jobs to compile time like all those
Devel::Declare based modules. Moose.
I've done a very simple benchmark program a few weeks ago:

    http://gist.github.com/37042

By that time Markapl had only very limited features but the result of
benchmarking shows that Markapl is somewhere about 200% faster then TD. I
wish it'll still be that much faster when Markapl becomes almost as feature
rich as TD.

However, I don't know what "problem" does it really solve for TD, actually.
Maybe not, since TD is like super solid for a long time. It's more like a
matter of preference. I prefer this syntax  much more from the moment that I
saw TD and I couldn't change it to the way I want until now that I've learn
to play with Devel::Declare.

As for the concern of maintability, by what I've got in the current work
progress of integrating Markapl into TD, I'd say there're probably some
decision to make to drop some backward compatibility at some point. Not now,
nor it's coming soon, but having to support all sorts of syntaxes to assign
attribute values make the code look horrible.

On Wed, Jan 7, 2009 at 6:56 PM, Ruslan Zakirov <ruslan.zakirov at gmail.com>wrote:

> New syntax. I'm afraid such step could lower maintability. What the
> point? What will it give? Which problems it solves?
>
> On Sat, Dec 27, 2008 at 2:55 AM, Kang-min Liu <gugod at gugod.org> wrote:
> > Hi, all
> >
> > Recently I've been trying to use Devel::Declare to re-implement
> > Template::Declare for this very fancy syntax:
> >
> >     div(id => "salute") { "Hiya" }
> >
> > And it worked very fine, big success. I'm very impressed by how much
> > it can be done with
> > Devel::Declare and B::Hook* modules. Kudos to rafl++
> >
> > I released the implementation under the name "Markapl" (Mark up as
> > Perl) on CPAN few days ago.
> > The Markapl repository is on Github:
> http://github.com/gugod/markapl/tree/master
> >
> > And since obra requested, I'm currently integrating it into
> > Template::Declare. Several basic parts are
> > all ported, so statement like these are all working now:
> >
> >     div(id => "salute") { "Hiya" }
> >     div("#salute") { "Hiya" }
> >     div(".salute") { "Hiya" }
> >     div("#salute.box") { "Hiya" }
> >
> > And it's still backward compatible:
> >
> >     with(id => "salute"), div { "Hiya" }
> >     div { attr { id => "salute"} outs "Hiya" }
> >
> > The development is on "markapl-syntax" branch of Template-Declare
> > repository, the new code passes
> > about 60% of tests now. So please take a look, give me some thoughts
> > and may patches. It's all welcome. :)
> >
> > btw, I've just done a tool Markpl::FromHTML (on CPAN now) that
> > currently convert
> > simple HTML to Markapl. This can be a pretty handy tool when working
> > with HTML-capable visual designers. :)
> >
> > Cheers,
> > Kang-min Liu
> >
> > _______________________________________________
> > jifty-devel mailing list
> > jifty-devel at lists.jifty.org
> > http://lists.jifty.org/cgi-bin/mailman/listinfo/jifty-devel
> >
>
>
>
> --
> Best regards, Ruslan.
> _______________________________________________
> jifty-devel mailing list
> jifty-devel at lists.jifty.org
> http://lists.jifty.org/cgi-bin/mailman/listinfo/jifty-devel
>



-- 
Cheers,
Kang-min Liu
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jifty.org/pipermail/jifty-devel/attachments/20090107/c275fc16/attachment.htm 


More information about the jifty-devel mailing list