From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?utf-8?Q?Ludovic_Court=C3=A8s?= Newsgroups: gmane.lisp.guile.user Subject: Re: [ANN] (potato make) - makefiles in scheme Date: Fri, 26 Feb 2021 18:40:05 +0100 Message-ID: <87tupywwwa.fsf@gnu.org> References: <20210215172651.GA3034884.ref@spikycactus.com> <20210215172651.GA3034884@spikycactus.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="34612"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) To: guile-user@gnu.org Cancel-Lock: sha1:aT95QxdgDPWkXw81WggNd5Ufj44= Original-X-From: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Fri Feb 26 18:45:15 2021 Return-path: Envelope-to: guile-user@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lFhAx-0008rf-Mu for guile-user@m.gmane-mx.org; Fri, 26 Feb 2021 18:45:15 +0100 Original-Received: from localhost ([::1]:44588 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lFhAw-0000pm-OG for guile-user@m.gmane-mx.org; Fri, 26 Feb 2021 12:45:14 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:56254) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lFhAm-0000pU-TU for guile-user@gnu.org; Fri, 26 Feb 2021 12:45:04 -0500 Original-Received: from ciao.gmane.io ([116.202.254.214]:34844) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lFhAl-0006fl-EG for guile-user@gnu.org; Fri, 26 Feb 2021 12:45:04 -0500 Original-Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1lFhAj-0008XK-N3 for guile-user@gnu.org; Fri, 26 Feb 2021 18:45:01 +0100 X-Injected-Via-Gmane: http://gmane.org/ X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 8 =?utf-8?Q?Vent=C3=B4se?= an 229 de la =?utf-8?Q?R?= =?utf-8?Q?=C3=A9volution?= X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Received-SPF: pass client-ip=116.202.254.214; envelope-from=guile-user@m.gmane-mx.org; helo=ciao.gmane.io X-Spam_score_int: -15 X-Spam_score: -1.6 X-Spam_bar: - X-Spam_report: (-1.6 / 5.0 requ) BAYES_00=-1.9, HEADER_FROM_DIFFERENT_DOMAINS=0.25, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Original-Sender: "guile-user" Xref: news.gmane.io gmane.lisp.guile.user:17320 Archived-At: Hi Mike, Mike Gran skribis: > I wrote a pure scheme Guile library (potato make) that lets one write > makefiles in scheme. The code lives at > https://github.com/spk121/potato-make. > > If you are familiar with the cryptic makefile syntax, and with scheme > syntax, you may be able to decipher this makefile written in potato > make. Here ':=' is variable assignment, ':' is a target rule and '->' > is a suffix rule. The '~' syntax is a lazy concatenation operator > that passes its output as a string to the system() procedure. > > #!/usr/bin/env sh > exec guile -s "$0" "$@" > !# > > (use-modules (potato make)) > (initialize) > > (:= CC "gcc") > (:= CFLAGS "-g -O2") > > (: "all" '("foo")) > (: "foo" '("foo.o" "bar.o") > (~ ($ CC) "-o" $@ $^)) > (-> ".c" ".o" > (~ ($ CC) "-c" $<)) > > (execute) Nice! As you may know, Guix is reducing its “binary seeds” (pre-built binaries used to bootstrap the whole distribution) so that everything can be built from source. Part of the strategy revolves around doing more things in Scheme on top of Guile or Mes, and that’s why people wrote Gash (POSIX shell + core utilities). With a makefile parser, (potato make) could be a useful addition! Also, we could imagine adding a Guix backend to (potato make), such that each target is built as a Guix “derivation”. Food for thought… Ludo’.