On Tue, Aug 26, 2008 at 10:33 AM, David Reiss <[EMAIL PROTECTED]> wrote:

> > At least if you expect java to be installed on the system it can't be
> > much easier than that ;)
> It's been my experience that it is easier to get a stable lexx/yacc/g++
> working on a Linux system than Java.  And for distributions that use
> binary packages, the runtime requirements for the Thrift compiler are
> miniscule.


That might be true for Linux systems. But getting things up and running on,
let's say Windows or OS X is usually not that easy.
I might be a bit biased here, but installing the Java runtime and JAR
containing the Thrift compiler (and it's dependencies) is a lot simpler, and
also very cross-platform.

Bryan's idea on having the code generators written in their respective
languages is nice. Not everyone maintaining the Ruby/Erlang/PHP/whatever
libraries are familiar with C++, or would want to be familiar with that.
However, it would introduce some complexity in the form of getting the
generator code cut-off into subprojects. And requiring specific runtimes for
code generation each language could cause some frustration.



>
> > On the
> > other hand I would imagine
> > that implementing new languages would be much easier with a clean
> > templating approach.
> I'm not sure that I agree with this.  If the Thrift data model were
> simpler (which I usually wish it were when working on the compiler),
> then I think this would work well, but my experience is that the
> amount of special-case code required to generate stubs as versatile
> as Thrift's is quite large and could not be succinctly expressed by
> templates.  I would love to be proven wrong on this point, though.
>
>
>
I know some of you have been skeptical of a template approach in the past.
Perhaps I'm just naïve here, but what exactly is this special-case code?
I think templates would be able to handle such problems. For example, take a
look at Enunciate and their code generation for GWT.
http://svn.codehaus.org/enunciate/trunk/enunciate/gwt/src/main/resources/org/codehaus/enunciate/modules/gwt/gwt-endpoint-interface.fmt(see
http://enunciate.codehaus.org/)
They are using FreeMarker for the templates. To me at least, that code gets
closer to the point/domain than the current C++ generator. And still I
consider myself lightyears better at C++ than at the FreeMarker language.

Reply via email to