From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: wolf Newsgroups: gmane.lisp.guile.user Subject: Re: Recommended project structure Date: Fri, 9 Jun 2023 14:55:42 +0200 Message-ID: References: <87fs71e2ck.fsf@laura> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="2+mY4Mxj+O2RuG+r" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="8678"; mail-complaints-to="usenet@ciao.gmane.io" Cc: guile-user@gnu.org To: Olivier Dion Original-X-From: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Fri Jun 09 16:37:52 2023 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 1q7dFM-0001rg-Im for guile-user@m.gmane-mx.org; Fri, 09 Jun 2023 16:37:49 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q7bej-0004F8-Pk; Fri, 09 Jun 2023 08:55:54 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q7beh-0004E4-SZ for guile-user@gnu.org; Fri, 09 Jun 2023 08:55:51 -0400 Original-Received: from wolfsden.cz ([37.205.8.62]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q7bef-0004Zl-6i for guile-user@gnu.org; Fri, 09 Jun 2023 08:55:51 -0400 Original-Received: by wolfsden.cz (Postfix, from userid 104) id 223EB23A6BF; Fri, 9 Jun 2023 12:55:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=wolfsden.cz; s=mail; t=1686315345; bh=+7QLECg6NK7BHxrYKd2IDZVjPICvXithAkyBt+Aqit8=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=XJXgVnP6wQzX68Y2YHIDFfVdi01Tpp3gWfNRRHDZsR5iTjowy4BfMl9eXXgeUqJ0W mA1l2RPe0hDmgv2ohWaKsnWtZBt1F1p6gIoeSd0d5ZDAmtBD/sp+ppYFJLt0I7lkm8 kJpzVMvfcJjrVDqe824OSzKA3RBrvpWGQfThu/sHoRYN/PlAUJoBg+ydkSay8Hq+hv tZQC8fuMGpgM93jekr/Pnq2X80jJHmFIMwxh9ezjnPqIozdOAcD6tuhM17luufeMio mpx9UEdO3yMn6dpz5EgsRU8bf980f84AcamN/UaEobaLqFtKu2f+cgexYLo6vz0fck DqTjkQjrChzF3kgDG+W1peIWlhqrqTRRkbOZU6+f9PKhFjwFYXN53iATtseRfiMcUz PfX90EB89N/DwU84c+9ZdSw7coXGmva5bRZ9TXvfVRV3K1S+2zYpDfDees9aEFoy18 HhGVHcBdLla0AtbuxbnC9YraXUJsE0kBLd10bZhJGI0XeFoFGECRcrMW420yb+9tqs U4oUMMxMC9saCMLMFg3kVxq+AbGvpCLrLC3gK1hEwuJmZZTHk5EloDi31KZQdbIUYs kXc/TDTKJpGR18UpQzL1G3uuvaM9HJXuewb4DbE6tSXaxN14jZ3atknL43LtSlm725 Q6/eXSioy2NcgF6+PBzMLcOg= Original-Received: from localhost (unknown [128.0.188.242]) by wolfsden.cz (Postfix) with ESMTPSA id D7D6F239CBB; Fri, 9 Jun 2023 12:55:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=wolfsden.cz; s=mail; t=1686315343; bh=+7QLECg6NK7BHxrYKd2IDZVjPICvXithAkyBt+Aqit8=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=YWIqQo/zB7pApzkU5H0+7b5snffbNLtDhIfKZggyJU884WZ4lIh1faQ5+PqSEKxa/ vlKNN90ZP98XYr8hBQXHBsfiezPzxi19YDO6G/H/ufegR6pe6WK3qWKVA9ZxnPONiT gNZ3PE+OatGBUwJ2gSVaQtzm2HAUjt0zb4DS8pgKpkZzzVqplYGHZOkDPySK7AMtbV Z4dKXmyVrj1BH3yEwPYSegjQcg7I4iTxFfZ+hXKRL/DAimrn/9FguxJqHYG3yu7pBN yfCQnaWdvVwsTEyJKgtZ0892Q/csh8zVDX6/Eq5D1ErYObvdsvNY4QWg7SYYOs/Gqc GkT1fBs9jMx9SXul/V78QeyZtZbRwtAoIeZTGfUjpQMDXfVSFoCmXj8xl66hYa76Lz rcOnyZZn9wm7B43YuQMJnZPVPqGX8B4kifnOQ28cbx8IVEOUsj7CAc/gLswzsw5Rzm uO6xTEhlgIRPZF5VbHb/OPPmg0f0VIQsA9Vj6f5AjQ4YatkyLZRNm3EmM6OvOn4a8u LXoRk0CB6w7HT8G6B4jo01rw8W/5BPXw0MMkF5eUrlGE3W9JEE0OLsM2uUGiwSARce anUTbapyxgV7VUyzTcBvrG+aSDpIphRusm+jVy1Kg7iRR+0VYhxEX8sxJmmpl0ARua 64FwL7f4zXKWCOzd/AE1Vqd4= Original-Received: from localhost (localhost [local]) by localhost (OpenSMTPD) with ESMTPA id 7d9590e0; Fri, 9 Jun 2023 12:55:42 +0000 (UTC) Mail-Followup-To: Olivier Dion , guile-user@gnu.org Content-Disposition: inline In-Reply-To: <87fs71e2ck.fsf@laura> Received-SPF: none client-ip=37.205.8.62; envelope-from=ws@wolfsnet.cz; helo=wolfsden.cz X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.25, SPF_HELO_PASS=-0.001, SPF_NONE=0.001, T_SCC_BODY_TEXT_LINE=-0.01, UNPARSEABLE_RELAY=0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.29 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-bounces+guile-user=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.lisp.guile.user:19024 Archived-At: --2+mY4Mxj+O2RuG+r Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 2023-06-08 23:33:47 -0400, Olivier Dion wrote: > On Fri, 09 Jun 2023, wolf wrote: > > Greetings, > > > > I am starting a small, personal project and I want to write it in GNU G= uile, > > since I really like it so far. However, since one of the major goals i= s for > > this to be a learning experience and doing it "the right way", I wanted= to ask > > about recommended/standard project structure for Guile projects. I fou= nd > > this[0] tutorial, but it is from 2017, which is quite some time back (I= feel > > old). >=20 > Actually, what I like about Guile, there is no "the right way" like in > Python. Whatever is best for the developers is the right way, not some > weird standard made by people with their view of the world. >=20 > Anyhow, if you're looking for a common structure, it is actually > simple. The root of your project acts like a load path. So say you > have two modules. (foo) and (foo fuz), then you will have foo.scm for > (foo) and foo/fuz.scm for (foo fuz). >=20 > If you don't like having source files in the root directory > (i.e. foo.scm), then simply consider a sub-directory of your project as > the load path for Guile. For example you could have everything under > src/. Therefore, src/foo.scm for (foo) and src/foo/fuz.scm for (foo > fuz). However, this kind of break the magic for me. >=20 > Following this, you can then easily configure Geiser in Emacs to add > the root of your project (or sub-directory) to Guile load path. > Everything is natural that way. >=20 > What is nice about this structure is that you can have helper modules > that are not meant for user. I have for example a scripts/, tests/ and > tools/ directories in my projects. That way I can start a REPL and > use-module my tools/ (debugging, plotting, etc.) or execute a scripts/ > (running tests, benchmarks, etc.). Everything can be done in the REPL! >=20 > Note that this structure require a little more work when you're doing > out of tree build, e.g. with autotools. But for a small Guile project, > that should not be a problem. Ah, thank you for the write up. It is very useful to know how someone actu= ally does it in practice. Especially the ease of using REPL in this setup. In general like autotools, so I will probably try to incorporate them someh= ow. >=20 > > So I wanted to ask, does the tutorial describe best practices even in 2= 023? If > > not, what would be a good reading on this topic? >=20 > I do not see any link in your message so I can not say. That is pretty embarrassing mistake on my part, the link is: https://www.erikedrosa.com/2017/10/29/guile-projects-with-autotools.html . >=20 > --=20 > Olivier Dion > oldiob.dev W. --=20 There are only two hard things in Computer Science: cache invalidation, naming things and off-by-one errors. --2+mY4Mxj+O2RuG+r Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEt4NJs4wUfTYpiGikL7/ufbZ/wakFAmSDIU4ACgkQL7/ufbZ/ wakebg/7BYXq9Oce8b8fcVUFus5KhZZlXXBIaES/NEkZRn7b/1yhrEY26jVCaX0w g0FljyQlXSYFGOvChQBD1F0UI5sGXPnt8ZsDXYrjJDE5u2KI8rq24VIUBbdfb1XB yOzggMtqelfI0X1sLjeIjJ5mCXVpA4Y++LcfR6bJLUovwB05Qe4iNFc7qoO+CVOT VO3Mb01SDc1maa0Tii4sRl0gcljItGuLSbeKkSu/TKMKit+t0bE8sRpeq3HN6HZ+ 9bVZLjTKDc9HbJBdwMp7uHdBEPMIvjZsJf9EPGVBT8MrnotgT5MH0kRmIHgxrqWR 3sfHe9wgHOJqLEE2I2WjY0VrZiq/AF40wx1nKVPoKNYNzzPkg0YtiU/xKz0GhFfm pu1PIPs0ENjy9u3HPeXn9QhOz89wEgFpZFFsBbtyn8cSxmbBlJE5tHfhXAhM4RPe McaNI+LcQhx2B9EiAwA+RJDN7IMEx4YhripCCHUc24bNV6MwGXS5lAZlnHlH7+Ql VByX7SjwMDhb9YFWQtkFJCGNHJBflUoIvQpENaJLcq8I5yAbirEiFci1slwhz34b BzAcAYAt6LZKAMd3xvsKwW/CK2EJCwAR9TJ3EHmhIjpFYkHYH9yhIWscIjwQwx3k lpd632ZHKXr0EjR1jVLE953mUhif/iO2al8zKyO6ntMZ8s/7VME= =I6Ji -----END PGP SIGNATURE----- --2+mY4Mxj+O2RuG+r--