On Dec 14, 4:54 am, Alex Boisvert <alex.boisv...@gmail.com> wrote:
> On Sat, Dec 12, 2009 at 11:06 AM, Marius <marius.dan...@gmail.com> wrote:
> > That is certainly one way to go but personally I'm not at all a fan of
> > this string literals approach,. For instance if Scala would not have
> > had built in XML support using XML as string literals Lift would
> > probably loose some of its attractions... but that's my opinion.
>
> Agreed, XML is baked-in.  It's not a DSL built on top of other features.
>
> > Furthermore a DSL like language allows better compositionality than
> > concatenating strings when we want to iteratively add JS code ... for
> > instance calling the same function multiple times with different
> > arguments, or collecting code fragments generated by different
> > application components etc.
>
> There's no guarantee of compositionality for DSLs.   You have to design it
> to be, and it's quite difficult to get right.   And then you pretty much
> reinvent another language.  First you have Scala, then you have Javascript,
> then you have something in between which is FrankenScalaScript.    Just my
> opinion :)

Yeah ... I'm also a little concerned about the "new syntax" but I
don't think that's such a big impediment. What I meant by
compositionality is that you can easily put together code fragments by
naturally using  ~ or `;` functions and that's supported by the above
code. Similar with JsCmd & function. Also most function are taking JS
parameters which allows us to pass JS code (calls to other JS
functions or even pass functions and have higher order javascript
functions) as arguments to JS functions.

I know it's your opinion and I do respect it. To be honest I'm not a
huge DSL fun but in this context I really think it can help writing
JavaScript fragments from Scala code.

>
> > Also it seems to me that your approach (somehow similar with
> > Velocity's) is more expensive but I admit that this is not at all a
> > strong argument because we're talking about small javascript fragments
> > so the delta is negligible.
>
> I would beg to differ but we're so far from any implementation of either to
> judge performance at this stage.

Not judging ... just that the style you mentioned inherently implies
string parsing that is not necessary in the DSL approach.


Are there any other opinions out there?

>
> alex

--

You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@googlegroups.com.
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en.


Reply via email to