[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Build systems suck. Can Lua be the basis for a better build system?
- From: William Ahern <william@...>
- Date: Fri, 8 Mar 2013 10:55:03 -0800
On Fri, Mar 08, 2013 at 06:18:56PM +0000, Zé wrote:
> On 03/08/2013 09:14 AM, Miles Bader wrote:
> >The thing is, that_everybody_ realizes this, and_almost_ everybody's
> >attempted solve it (at least since I've been aware of such things
> >since the mid-80s). "A better build system" is one of the classic
> >programs most good programmers write at some point.
> >
> >Unfortunately here we are in 2012, with most make alternatives being
> >only slightly less horrible, and usually having their own problems.
> >
> >The lesson I draw from this that it's a harder problem than people
> >realize... :]
> >
> >Having a nice elegant small language like Lua as_part_ of a build
> >system would of course be better than a grotty horrible language
> >(cmake, etc), or a huge bloated one (python), but ... I'm not sure the
> >language used is really the main issue...
>
> I really doubt that. Lua wouldn't be the first scripting language used
> for this stuff (it was already pointed out that it is in fact already
> used) and it certainly won't be the last.
>
I love regular make syntax. But for complicated target and dependency
generation, GNU make extensions do quickly become unwieldy. The
idiosyncratic functional style calls, list comprehensions, word splicing,
and recursive macro substitutions can quickly become confusing, to say the
least.
I've always envisioned hacking up GNU make to embed Lua, and then adding
qmake-style blocks which execute Lua code. The trick is defining the input
and output semantics of the Lua block (i.e. how to make the consumption and
generation of lists of targets intuitive and seamless.)
Also, critically GNU make needs more support for handling path management.
For example, even today when you include a Makefile there's no way of
knowing the location of the included Makefile. You have to pass the
directory explicitly, and then explicitly modify your rulesets to prefix the
path. Using $(lastword $(MAKEFILE_LIST)) is problematic because it changes
the moment you include something else. Make needs some macro scoping
support.