From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Mike Gran Newsgroups: gmane.lisp.guile.user Subject: [ANN] (potato make) - makefiles in scheme Date: Mon, 15 Feb 2021 09:26:51 -0800 Message-ID: <20210215172651.GA3034884@spikycactus.com> References: <20210215172651.GA3034884.ref@spikycactus.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="683"; mail-complaints-to="usenet@ciao.gmane.io" To: guile-user@gnu.org Original-X-From: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Mon Feb 15 18:27:34 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 1lBhem-000APq-4p for guile-user@m.gmane-mx.org; Mon, 15 Feb 2021 18:27:32 +0100 Original-Received: from localhost ([::1]:47590 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lBhel-000169-5R for guile-user@m.gmane-mx.org; Mon, 15 Feb 2021 12:27:31 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:34942) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lBheL-00015u-CP for guile-user@gnu.org; Mon, 15 Feb 2021 12:27:05 -0500 Original-Received: from sonic316-20.consmr.mail.ne1.yahoo.com ([66.163.187.146]:35630) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lBheJ-0000yG-NE for guile-user@gnu.org; Mon, 15 Feb 2021 12:27:05 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1613410019; bh=vDYQbDtP4Psf7+VLTFgJ+OazZZdOR2K61fN6ebFpnR4=; h=Date:From:To:Subject:References:From:Subject:Reply-To; b=h5WSxnnlUnyGa0VBOEOCiNj4bAQEiQ4UIJTA22WoCCsJUjCzLpJNUqiInUELLmDoeOf43sqJ/93wazvPub21M5PLwV1ceulAWXNw6F1cQFEYTXBDN/TRielzMCGyjuJuSfIVv2hgKxSJLJLaPgM787w2oIHLDZmGMcxU26Ahu2vxteFk77mM8/INY93Zh45MJrE73rpVTnPztdXbqYVc00KV1AVw4V5tkRggoz6UapHsjPvpDWE/T9ArtGhY6XmIYOpFTyl/NDkfg0IzN8s6OKb0gYlfxocoOvF9OxqwirNWw05v0BDkl5YServWfYDJCzREplEp0ZdPRLrWgSTixQ== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1613410019; bh=ywKXJqhrrhutM9KBUSaoXdWMV0Ga3Bi2o/jPkCveOla=; h=X-Sonic-MF:Date:From:To:Subject:From:Subject; b=bpc+LwR+u7jhHDJdE1CjLFCg/yujvGSMTml5bbqThOruTRoZzObTgZLKV4zo54Elck0YwHa3UXOCapRXHx6JW6EhtzfLE6sOovlEDJo747tfiDeIZ8PKcbFMO6GAEWU47PcEXnPGp53iSfC4hMHYDKa9EMIu7uVY93a3ZSpvtrVq/WZBX8SNkjYyS6smEMMFxgRMSzw6xKKYbk1+eNlPNvMhEyoQm8eORmoLbhF5M5b9nRq1xChO5MiILo3SOSnHU9yWcY4gbYtxnwpWYKjt0F2GpKVJQbugwn7aoNWz1M7di2UQgrIeOa/y5IqeMTj2AZzvur6B5DeDoh02o8wpMg== X-YMail-OSG: qq7l3V4VM1ngG7fYTCeKfjty9vzjzsLvuz2OvSY7CfXUvmdWPLQcOVSphxjt3nx gbMuYwcAueft2xe_y38mFL3dR6B6heLSFSXyukpLEsziUknLGqZ6AdudZVIPMegxLUieJcExp_E5 i.hDeXL2se_AVJQUbb.hc9NCYwIwDjHnbrt6WhyZB5pPU5UtW7lwWF92QvX0a9c_N2gJFnnf4gS7 djgpI8UPk7pWb64_zDCtL_X0b5IYf_62aqUlyJatONXgwTB4Lmt1oEnz1N_A8Y2v8EFpyu1f2x0g 9i.dBbGzJYWwK3H.Xss3jqYk4qahPJCyW3Rn_wEAnYQucpdoA8PONie42QVzCJWgnt70hdQZVmTn sWSYe8kIm16NBWrF2qsOyBZDIjVAJVfJLvpf4.eagskP3rV1r7D__5HzZZvSsBHnQvICjQatp2Cl XKf3e.ly03lAaDPJMEPSuQL2Hy09.Qljz_kY79.Vkj5Qer4D.MxdgeKMZsMhDhsTmGqoZdNPbuAm u0FLlOWsr5P0QhsEqhQBhBySderBCKudUHx.lQUgNyy5AgalWiPLTfC9XfNxyD9l2YZF29WFsIq0 IFn_fDtyQnetrjV5pHYv5cXUN6gPHMx5ertK987pPRKGZaL5w.8IGWkxCpgHCTSppBFGhZET7yky BeaYKWeecg9kaA5wDfkXJYDS1PxYZC2NeQlNioOVhG_Vv9Z7AkvVsOhyAGTZ9H4LyrzhefY9kZ3c hYym5RWCcowpAOgG7Kq85etV5sJxJ284b8m.3md4Z.P_93mIo93aHcdiIRjwLmJGcJOuS5kWEU2I 5UpmnOdNK4apu6fCU3eeIgok5cJmkJ48X_UKEG0KOF X-Sonic-MF: Original-Received: from sonic.gate.mail.ne1.yahoo.com by sonic316.consmr.mail.ne1.yahoo.com with HTTP; Mon, 15 Feb 2021 17:26:59 +0000 Original-Received: by smtp405.mail.gq1.yahoo.com (VZM Hermes SMTP Server) with ESMTPA ID ee4c3258d008182d651f37d84dd842aa; Mon, 15 Feb 2021 17:26:57 +0000 (UTC) Content-Disposition: inline X-Mailer: WebService/1.1.17712 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo Apache-HttpAsyncClient/4.1.4 (Java/11.0.9.1) Received-SPF: pass client-ip=66.163.187.146; envelope-from=spk121@yahoo.com; helo=sonic316-20.consmr.mail.ne1.yahoo.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham 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:17251 Archived-At: Hello All- 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) There is quite a bit of flexibility here. You can write your recipes in shell, in scheme, or in scheme that returns a string that gets passed to the shell. I'll probably rename the ':' syntax for the sake of SRFI-119 wisp compatibility. Translated to wisp, this really would look like a dialect of makefile. No official tarball yet. I'll do that soonish after I get better coverage in the test suite. I was just a bit proud of this silly hack, and wanted to show it off. Thanks for reading. Regards, Mike Gran