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: Seeking Advice on syntax/macros in separate files Date: Tue, 02 Mar 2021 09:23:33 +0100 Message-ID: <87tupuneuy.fsf@gnu.org> References: <20210301180357.GN265215@embecosm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="15416"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) Cc: guile-user@gnu.org To: Andrew Burgess Original-X-From: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Tue Mar 02 09:23:56 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 1lH0Jw-0003uF-3U for guile-user@m.gmane-mx.org; Tue, 02 Mar 2021 09:23:56 +0100 Original-Received: from localhost ([::1]:33780 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lH0Jv-0001o9-1e for guile-user@m.gmane-mx.org; Tue, 02 Mar 2021 03:23:55 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:46512) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lH0Jf-0001me-KJ for guile-user@gnu.org; Tue, 02 Mar 2021 03:23:39 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:35751) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lH0Jc-0006q2-Nz; Tue, 02 Mar 2021 03:23:39 -0500 Original-Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=34730 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1lH0Jc-0006f4-7v; Tue, 02 Mar 2021 03:23:36 -0500 X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 12 =?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 In-Reply-To: <20210301180357.GN265215@embecosm.com> (Andrew Burgess's message of "Mon, 1 Mar 2021 18:03:57 +0000") 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:17333 Archived-At: Hi Andrew, Andrew Burgess skribis: > My concerns are based on this page of the guile manual: > > https://www.gnu.org/software/guile/manual/html_node/Compilation.html#Co= mpilation > > specifically this: > > "... Guile does not yet do proper dependency tracking, so that if > file a.scm uses macros from b.scm, and b.scm changes, a.scm would > not be automatically recompiled." Yes. Concretely, that means you can either use Makefiles or similar (like with most other languages) or turn off auto-compilation (with =E2=80=98--no-auto-compile=E2=80=99 or with =E2=80=98GUILE_AUTO_COMPILE=3D0= =E2=80=99). > So, my current thinking is to wrap the invocation of the guile script > in a shell script, which _always_ forces recompilation. But, if I'm > doing that, I may as well just disable compilation completely. But > this doesn't seem right. > > So, I'm sure I must be missing something here. How do others deal > with this situation? Common practice is to have makefiles or similar as part of your software. When you run =E2=80=9Cmake=E2=80=9D, it runs =E2=80=98guild comp= ile=E2=80=99 to compile all your Scheme source; upon =E2=80=9Cmake install=E2=80=9D, both .scm and .go = files are installed. Here=E2=80=99s an example that does that using the GNU autotools: https://notabug.org/cwebber/guile-gcrypt For a pure Guile project, Guile Hall helps get started: https://gitlab.com/a-sassmannshausen/guile-hall > - Am I missing an obvious solution for working with syntax/macros and > multiple files? > > - Am I wrong to think that syntax/macros are such a big part of the > language? Should I be limiting syntax/macro usage to small scopes, > i.e. within a single file, and only true defines should be exposed > outside of a file? Macros are very useful and a salient point of Scheme, but there are many other things in the language. :-) > - Maybe Guile just isn't designed for writing large, multi-file > projects? There are large projects written in Guile, such as Guix. > - Maybe Guile projects are only ever shipped to users who are happy > managing the compile cache themselves, e.g. more power users, and > not really for general users? Like I wrote, non-trivial projects often install .go files alongside .scm files such that things never go through ~/.cache/guile. HTH! Ludo=E2=80=99.