Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

The AWK book’s 60-line version of Make

35 views
Skip to first unread message

Ben Hoyt

unread,
Sep 10, 2023, 6:44:16 PM9/10/23
to
For your interest, I just published an article about the minimal version of Make (written in a page of AWK) that's included in the book "The AWK Programming Language":

https://benhoyt.com/writings/awk-make/

It's a neat program, and in the article I describe how it works, as well as porting it to a Python version for comparison.

The Make program is included in the second edition of the book, which is coming out next month!

-Ben

Andrew Schorr

unread,
Sep 11, 2023, 12:08:29 PM9/11/23
to
On Sunday, September 10, 2023 at 6:44:16 PM UTC-4, Ben Hoyt wrote:
> For your interest, I just published an article about the minimal version of Make (written in a page of AWK) that's included in the book "The AWK Programming Language":
>
> https://benhoyt.com/writings/awk-make/

Nice. Just FYI, the gawk filefuncs extension does include a stat() function that would enable you to
eliminate the ages function and age map just as in Python. See "man 3am filefuncs" or the manual:

https://www.gnu.org/software/gawk/manual/html_node/Extension-Sample-File-Functions.html

And of course gawk also has true multi-dimensional arrays, so that could also make things prettier
and more concise.

Regards,
Andy

Ben Hoyt

unread,
Sep 11, 2023, 12:59:34 PM9/11/23
to
> Nice. Just FYI, the gawk filefuncs extension does include a stat() function that would enable you to
> eliminate the ages function and age map just as in Python. See "man 3am filefuncs" or the manual:

Ah, excellent, thanks for the link. Yeah, that's much more direct (and more efficient!) than shelling out to "stat" as I did in my modified AWK version. (Though for the book I'm pretty sure Kernighan et al are trying to stick to standard AWK features.)

-Ben
0 new messages