[Top][All Lists]

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

Re: Using guile as an extension language for GNU make

From: Paul Smith
Subject: Re: Using guile as an extension language for GNU make
Date: Mon, 19 Sep 2011 11:14:34 -0400

On Mon, 2011-09-19 at 02:28 +0200, Thien-Thi Nguyen wrote:
> "Clean" in what way?  Everything depends on what the expected (valid) use
> of this facility would be.  Could you give some examples (w/ failure cases)?

In make, everything is just words: broken up on whitespace.  So for
example, maybe someone writes a Guile function that computes a complex
set of prerequisites for a target:

        target: $(guile (...some Guile program...))

The list of prerequisites is a whitespace-separated list of target
names.  If the Guile program returned a string like "dep1 dep2 dep3"
then that would be fine with what I have.  But it seems like it might be
nice to allow the Guile script to return it as a list instead.  Then I'd
like to convert a list like '(dep1 dep2 dep3) into a string "dep1 dep2
dep3" (not "(dep1 dep2 dep3)" as display would do).

But of course each element of the list could be something more complex,
as well.  So it gets tricky.

>    I could write a function then invoke it with scm_map() (right?) but this
>    seems like it might be work.
> Everything is work.  Even play is work (but hopefully more fun/interesting).

Yes but implementing it in C, with the memory management etc., would be
a lot of (not fun/interesting) work.

Hm.  I guess I could write a little Guile program to do it for me :-).

> I think concomitant w/ this particular hacking it would nice to implement
> some of the make functions (e.g., ‘patsubst’) in Scheme.  Enough of that
> and you will end up {in,con}verting the "embedding" effort to an "extending"
> effort as suggested by Ludo -- YHBW!  :-D

Well, since Guile is not required and I want GNU make to continue to
work as-is on systems where Guile is not available, I won't be rewriting
core features in Guile.   Yet?!?!  :-).

 Paul D. Smith <address@hidden>          Find some GNU make tips at:            
 "Please remain calm...I may be mad, but I am a professional." --Mad Scientist

reply via email to

[Prev in Thread] Current Thread [Next in Thread]