Hi! Paul Smith <psm...@gnu.org> skribis:
> On Sun, 2011-09-18 at 14:10 +0200, Ludovic Courts wrote: >> Ideally, when Guile support is enabled, GNU make would be turned into >> a Guile extension (a shared library and its companion Scheme module >> that loads it with ‘load-extension’) that would expose make’s >> functionality. [...] > A technically acceptable option would be to build GNU make in two forms: > first a standalone application that worked as now, and second a > "library" that could be linked as a Guile extension. Yes. > However, from what I've read of Guile that would be an immense amount of > work: GNU make was created over 20 years ago and has a lot of > not-completely-clean features and implementation details which rely on > it being a stand-alone program. There's massive amounts of global > memory usage, not even a nod to threading capabilities or locking, and > features like automatically re-exec'ing itself in some situations. Yeah, widespread use of global variables and such is likely to make a hypothetical ‘make’ library much less useful. > Finally, while it's a cool idea I'm not sure there's a compelling need > for this. Here’s an example: DMake [0] is concerned with makefile task scheduling on distributed architectures. To do that, it needs to know the DAG of tasks defined in a makefile. To achieve that, it ends up parsing the output of ‘make -ptq’; it works, but it’s fragile (has to use the C locale, is sensitive to formatting changes, etc.), and suboptimal. Imagine if this could be achieved simply by having DMake directly call make’s library functions to get the data it needs. [0] http://dmake.ligforge.imag.fr/ Another example: many projects have make-like functionality built-in. For instance, Java compilers (ahem...) have dependency tracking built-in; Rubber [1] automatically infers dependencies from LaTeX source files and runs the right actions in the right order; Guile’s auto-compilation feature is a simple .scm → .go rule; and so on. [1] https://launchpad.net/rubber I could probably come up with others if you’re curious. ;-) > My main purpose is to add some kind of scripting capability to GNU make > to augment the current functions capability. And this is a worthy goal too! Thanks, Ludo’.