[CMake] CMake and Lua

Brandon Van Every bvanevery at gmail.com
Thu Feb 28 17:00:29 EST 2008


On Thu, Feb 28, 2008 at 4:08 PM, Bill Hoffman <bill.hoffman at kitware.com> wrote:
>   I think it is an enormous effort to write a translator.  I think
>  translators don't work.  It is one thing to convert a word document from
>  one version to another.  It is a totally different thing to translate a
>  human written computer language from one to another and have it work.

CMake script, by design, is a trivial language.   If you actually do
implement Lua at some point, then I'll look at CMake --> Lua
translation, if it makes business sense for me to do so.  I believe
other people in the Lua community will also.  There are a lot of
language translator and metaprogrammer guys over there.  They abound
in the Lua community because Lua was intended to be an embeddable
basis for Domain Specific Languages.  Their perspective, and mine, is
that CMake --> Lua translation is a pretty easy problem.  I mean, the
entire syntax of CMake is command(arg arg KEYWORD arg arg ...), what's
the big deal?

>  You are missing my point.  I think we should respect the people that
>  have picked CMake to build there project, and part of that respect
>  includes not obsoleting there hard work.  We are disagreeing on this
>  point because of the first point.  You believe that a good enough
>  translator is possible.  I do not.

I believe an *almost perfect* translator is possible.  As perfect as
open source software ever is.  In fact, given CMake's trivial syntax,
I can't think of any reason why it wouldn't be.  Can you give me one
concrete example of something that would actually be hard?  I gave you
the only one I could think of: metaprogramming.  Almost nobody
metaprograms CMake.  It's not a corner case worth worrying about.
Give me an example of something that people do in the real world with
CMake script that would be hard to translate to Lua.

>  Just suppose I am correct and it is
>  not possible to write a good enough translator.  Would you then still
>  advocate dropping the cmake language?

Of course not.  That's why I said the translator would have to prove
itself for 2 years.

>  I am not coming up with excuses
>  here, I really really do believe that the translator idea is nonsense.
>  How many times do I need to type it for you to understand that is what I
>  believe?

Ok, at this point, I intellectually understand what you believe.  You
haven't provided much evidence for your belief so far.  You've
commented that general purpose language translation, such as Fortran
to C, is exceedingly difficult.  That is true, but we're talking about
converting CMake script, a trivial language.  You haven't provided an
example of something that would be difficult to translate.  You agreed
that nobody metaprograms CMake script, that that's crazy talk.

>  You are not willing to accept that I have a different point of view.  A
>  good enough translator is not possible.

You have provided no firm evidence for your point of view, so I will
continue to challenge it.

> That is my position.  I am not
>  talking about corner cases here.  I am thinking of real world projects
>  like KDE/ParaView/SecondLife/VTK.  The thought of translating these
>  large projects with a translator is not one I would appreciate being
>  driven into by the CMake developers.

Estimating conservatively, I got 1/2 of the way there with Mozilla.
Autoconf + GMake --> CMake is a much more difficult translation
problem than CMake --> Lua.  I know what is possible.


Cheers,
Brandon Van Every


More information about the CMake mailing list