Boost logo

Boost-Build :

Subject: Re: [Boost-build] [python] Python build description
From: Johan Nilsson (r.johan.nilsson_at_[hidden])
Date: 2010-07-14 04:24:28


Vladimir Prus wrote:
> While the immediate point of the Python port and my sabbatical is to
> get Boost.Build internals converted to Python, while keeping Jam
> languange allowed to build description, it is becoming apparent that:
>
> - For complex build tasks, Python might be better. In particular,
> it's almost impossible to allow Jam modules to extend classes defined
> in Python, so any code that defines custom generator classes has
> to be Python

Yes. I don't see this as a problem though, and it is probably what
"everyone" would want to do anyway.

> - It's awkward to have build description split over two files in
> different language

I'd argue that extensions aren't really part of the "build description" -
they are a part of the build system implementation (extensions or
built-ins).

>
> So, it seems reasonable to permit build description entirely in
> Python.

This is probably an inevitable conclusion that many people will draw.

> Like, if you have 'Jamfile', it's in Jam language, and if you
> have 'build.py', it's Python.

Perhaps the more terse "bb.py" (but I realize the above is only an example)?

>
> However, existing Python based tool has straight-forward, but not
> too nice syntax. Does anybody have great ideas how a build description
> in Python can look a little bit declarative, or nicer that plain
> sequence of function calls?

I'm no "Pythonista", but I must agree that it looks hard to define a nice,
declarative DSL in Python. IMHO Scons files look terrible. WAF looks better,
but not ideal. Perhaps a "fluent" interface
(http://en.wikipedia.org/wiki/Fluent_interface) could help out here at a
higher level?

If it's not possible to get a nicer DSL I think I would actually prefer the
jamfiles(!), as long as extensions can be written in Python.

[This is most definitely off-topic and non-constructive but: in terms of DSL
creation Ruby could have been a better choice due to its greater syntactical
freedom, IMVHO of course]

Regards,
Johan


Boost-Build list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk