lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On Fri, Mar 8, 2013 at 7:08 PM, Spencer Parkin <spencer.parkin@gmail.com> wrote:
Surely there are other build systems out there that I don't know about, but assuming for the moment that they're not any better than the above mentioned build systems, how can we make a build system that just doesn't suck?  The ideal build system to me would have the following key characteristics.

1) Use an appropriate language for the build system.  Don't just make up some dumb language for the new build system.  If you want support for path manipulation, provide that in the form of a library for your language.  The language also doesn't need to have built-in knowledge of the fact that we're building a dep-graph either.  Provide dep-graph construction as an API.
2) Make it simple!  What is a build system?  It's just a darn dependency graph, isn't it?  Why make exposing the use of such a thing complicated?
3) Flexibility.  Maybe this system doesn't even care what a file system is.  Then you could probably use it for anything, not just building a project.  Being this abstract can make things more simple (or complicated), even if it's more work to make your make-file.  (I don't care that the jamfile to makefile line ratio is 1:5 or whatever, I just care that I can easily figure out how to build my projects.  I don't get excited about Perl one-liners if I don't know what the heck they do.)
4) It's got to be fast.  Be able to take advantage of multiple processors.
5) Scalability.  Obviously, being smart in your choice of algorithms is one means to this end.  If it doesn't scale, it sucks, which might mean lumping for c++ projects, but let's forget about that for now, leaving that as a detail needing solving by the user, not the build system.

So now what about implementation?  A few ideas...

1) Use Lua as the make-file language.  By virtual of making this choice, the make-file language, (unlike the actual Makefile language), becomes immediately endowed with all the power of Lua, which is already light-years beyond what the Makefile language itself can do.  Plus, if you already happen to know Lua, (which may be a language of greater worth in learning than some weirdo jam language), then you're already half-way there in the task of learning the build system!  Hurray!
2) Write the dep-graph generator in Lua.  This may be a good choice since all the makefiles are just Lua files.
3) Write the dep-graph cache to disk as a Lua file.  It's just a table with a bunch of targets in it.
4) Write the dep-graph executor in C/C++.  Be as fast as possible!

I'd be surprised if anyone's bothered to read this far.  Sorry for the long e-mail.

Any thoughts?

(I'm so dumb staying up 'til 1 am.)

Forgive me for only skimming the meat of your post but you might be interested in Tundra.

https://github.com/deplinenoise/tundra

Cheers,
Josh.