bug-make
[Top][All Lists]
Advanced

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

Re: Tail call elimination


From: Tim Murphy
Subject: Re: Tail call elimination
Date: Wed, 20 May 2020 17:17:17 +0000



On Wed, 20 May 2020 at 15:47, Daniel Herring <address@hidden> wrote:
Hi Pete,

My objections to GMP:

- major added dependency (Make needs to be widely portable, and it is
often part of a boot-strapping procedure.  The core functionality needs to
be trim.  Heavy lifting needs to be separable.)

- slow (native int32 is much faster)

64 please! Files > 4GB are common now.  If it's 64 bit then it's tolerable to not use GMP.
 
- massive YAGNI (Make is a build system, not a general-purpose computing
platform)


One could almost say that right now as here we are after many years and we've survived without it.  It's the quality of that survival I suppose that has been unsatisfactory.

It might help to put down some use cases so that we have an idea of what is wanted. I will try to start:

In a project long ago ...
1. I needed to process lists of targets during parsing but calling $(shell) on each one was very slow so I waited till I had an arbitrary number and ran the shell command on all of them.  I had to count to the arbitrary number using 'x x x x x x x x' as my number format. Ultimately I got it to work but it was horrible. 
Needed: increment/decrement and then either string or numeric equality.

2. I needed to create targets which could not be guaranteed to be unique based on the source filenames because they were being built with different options and variations and amongst other ways of doing this a simple counter would have been useful. This means that one must be able to update a variable that exists in the context of the parse job of the current makefile at least.
Needed: addition.

3. Again when generating rules to control the length of the commandline in e.g. a "clean:" rule it was necessary to generate "rm" commands with limited numbers of files in the commandline so as not to exceed commandline length limits on the platform. I used a hokey rule of thumb that N files were never longer than the commandline but it would have been better to keep checking the length and only starting a new line when a filename spilled over some limit:
Needed: addition, greater-than

That's really it. Can anyone add to this?

So if guile is a good language which does math in postfix notation (+ 1 1) then I don't see why make can't be the same and since this is roughly the way make operations work now you can avoid inventing a lot of rules about what you "might need" in future.

Regards,

Tim


reply via email to

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