From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Mike Gran Newsgroups: gmane.lisp.guile.devel Subject: Re: Where to start Date: Fri, 1 Mar 2019 03:32:06 -0800 Message-ID: <20190301113206.GA2442@spikycactus-com.attlocal.net> References: <2098616274f21adf2d924a54a8a13587@posteo.net> <4d78ff7e640b2f12cc7b40408eb9398b@posteo.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="73051"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Mutt/1.11.3 (2019-02-01) Cc: guile-devel , guile-devel@gnu.org To: brettg@posteo.net Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Fri Mar 01 12:32:59 2019 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gzgPS-000IpL-3b for guile-devel@m.gmane.org; Fri, 01 Mar 2019 12:32:58 +0100 Original-Received: from localhost ([127.0.0.1]:35948 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gzgPR-0005g6-3n for guile-devel@m.gmane.org; Fri, 01 Mar 2019 06:32:57 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:35615) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gzgOr-0005Z7-T5 for guile-devel@gnu.org; Fri, 01 Mar 2019 06:32:22 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gzgOq-0003s0-Or for guile-devel@gnu.org; Fri, 01 Mar 2019 06:32:21 -0500 Original-Received: from sonic307-10.consmr.mail.ne1.yahoo.com ([66.163.190.33]:45291) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gzgOp-0003p0-SS for guile-devel@gnu.org; Fri, 01 Mar 2019 06:32:20 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1551439937; bh=Z6ieRiSYv/LTovCddNSPcPduc9Hx1POteYlQV/y3y1Q=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From:Subject; b=kl9X76DpoiHvDQMV3aMO8Bykuz/JRpcufAg0uQ3NljN5z1v7H+GONvwrjrPM7wUoCWORN0yVtldVo2UnVIsa4GQjTlN5z/PI7UP2zz3xOxjkiy9QIo+gaZ628WNO2bDEdpOYc0QlAHHk69tI4t7edVtkB5csdMe2uMMPkacyEp7u5tpHuEEiaWf1ki2AnajH0QFCeYxupX0matbwywjbpJCwv6foZThvFmKU1x+gZ2uClpTpE/iyU89e1ADKoa1azZW1WWOKHle1Ip6CZg+oVirGu8lAfUW8ywCGklpTpkgHPw3osYuFeJJTMaulqK2+kNRkTXucZZRenrhF+G9v1w== X-YMail-OSG: MQ.CBtUVM1kT6BBb5R_fB8Mqlxn3xVNPTY9FmZ70w2B33M3rd2CsiwEC9VnXFRw SjDIP4F6XK8DI09Bdf.H2RxEDGC0L646Du6_eRkbAvKcrhUBkVuQP1RYnHOolq1vW9ka5xrcBXHb AymZdMhor_UCXd9aPNdjNWTf0jCF9LlT3ls7rRxVpg.rL_aGkXUNyoU8vyuIiNimbtrECO0nqAkY U3hcBAhlCjwR3aY1lSGzfSRsPu6FHvU_2VlH_m6Hhe3sS62d6z24296vGGYrBoE9BuX9vzHzjyqh TEdTZbHcQ_jKUsfLYrOJcjh3la8OZ4IUqiMhEAQvlePjbdCNRU2zVPy1xV.EntEO5XJvlpq_J7BF 5_ZYHZRAUtg5FZs8RQBrSTs7YA5dFuGwPMCPE6GL2YImedL5S8BRGko6Ol4dEfMfr6cetQ4AYxsk 6UZ0rZQ6JNDEwpL81gvlisovFW0Z4OlktPuoJE9xv_qz_MVRP4zbujvTyB6AEBjYL3.wRMln7lP6 PEWZ7oDvECFtAAW5bfeGAiTi5Qjgx8Pfp5rNF8bif76OVwlOdROBJY7eLAY1z2WpFcDbZFGuRONN XZHsArjf1eupy0HWIBhxSRB7s68PvX3ltxuK8cbXgCmhnp4Lp.XJ6iNkGcj.s36buc0HIHZLbCFG 6zxK3NODlRmYEo.o5XQYQfNSmQvKmnGlHHyPQQOHKxIy3OeP1WM_WRbrU9C4CLisA0nalUkAdrz5 ZfdUTI1MaugX2NAZzoAN1C1qL63oGXBkERdK8bSm8vae2q94RjoGh6fUkjFfVq6jcvhFRy3Byar5 hAsN7_hP2z6o3LRwmNMY.X.C08XV7JeXcFiMrpL5KS Original-Received: from sonic.gate.mail.ne1.yahoo.com by sonic307.consmr.mail.ne1.yahoo.com with HTTP; Fri, 1 Mar 2019 11:32:17 +0000 Original-Received: from 75-54-112-187.lightspeed.irvnca.sbcglobal.net (EHLO spikycactus-com.attlocal.net) ([75.54.112.187]) by smtp422.mail.ne1.yahoo.com (Oath Hermes SMTP Server) with ESMTPA ID 30b7d88bff04ebe9fb47029ead074d18; Fri, 01 Mar 2019 11:32:15 +0000 (UTC) Content-Disposition: inline In-Reply-To: <4d78ff7e640b2f12cc7b40408eb9398b@posteo.net> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 66.163.190.33 X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Original-Sender: "guile-devel" Xref: news.gmane.org gmane.lisp.guile.devel:19855 Archived-At: On Wed, Feb 27, 2019 at 05:38:23AM +0100, brettg@posteo.net wrote: > I guess, on some level I am asking how to go about familiarizing myself with > the code. How to approach understanding the logic behind each directory. Is > there a map that designates the differences between /lib and /libguile? So > on. > > On 27.02.2019 02:22, brettg@posteo.net wrote: > > Hi there. I think some of you already know me from the Guix mailing > > lists. I come from a biosciences background, and am transitioning into > > a career in computer science. I plan on starting my masters this year. > > A large part of my interest has been in LISPs, and particularly Guile > > and other implementations of Scheme. > > > > I know that Guile 3 is right around the corner, and i'd like to be > > able to lend a hand in getting it ready for that. I have experience in > > both Scheme and C. This would be my first contribution to a C project > > though. I am curious if there is some resource that explains where I > > may focus my efforts? I know the bug tracker is available for this, > > but where else may I focus my attention? > > > > I imagine most of what we need for Guile 3 is in a feature-freeze more > > or less, so I just want to get my cards in order before I start > > throwing any patches out. > > > > Best, > > Brett Gilio > Hello Brett, Nobody has replied, so I will make an attempt an answering your question. Basically, when you look at the directory tree, everything starts with autotools. All the various configure.ac, Makefile.am, *.m4, build-aux/*, m4/* files make up the source code used to generate a configure script. The autogen.sh script in the main directory creates the configure script from these files. Then when you run the configure script, it generates the various Makefiles, as well as a handful of shell scripts. Basically anything in the directory tree with the file extension *.in will be converted into another file by the configure script. Most of the configure tests are for the C compatibility library, which is gnulib, which is what lives in the /lib directory. The Guile maintainers don't modify anything in the lib directory, but, rather just get that code from the gnulib project. Every year or so, someone updates the code in the lib directory to the newest code from gnulib. Gnulib is a project that attempts to correct inconsistency among the various implementations of the C library, and Guile uses Gnulib to help keep it running on the various operating systems. Next up in the build it to make the Guile C library, libguile.so or libguile.dll, which mostly happens in the libguile directory. This library contains all the C code that goes into the guile interpreter. Many of the low-level Guile procedures are written in C. There is a complete virtual machine structure in libguile. And there is a complete scheme parser in there as well. Most of the research of Guile v3 is to make a better virtual machine. Once libguile.so or libguile.dll is built, it is linked to the 'guile' or 'guile.exe' executable. This also happens in the libguile directory. This guile executable is a complete guile interpreter, but, at this point, if you did try to run it, it will be incredibly slow. Because at this point, none of the scheme files have been preprocessed into byte code to make startup speedier. Now begins the most painful part of the build to watch. This guile interpreter is used to compile the scheme files that make up the higher-level layers of Guile into bytecode. The scheme files are *.scm; the compiled bytecode files are *.go. Each time the guile interpreter runs at this point, first it must load up all of the *.scm files that make up the higher-level layers of guile without the benefit of having *.go files, so it is very slow. But, step by step, the scheme files that make up the higher-level layers are compiled, so each attempt to compile a scheme file at this part of the build gets faster and faster. Most of the important scheme files that make up the higher levels of the Guile interpreter are in the modules/ directory, with modules/system/base and modules/ice-9 being of particular importance. The absolute slowest part of the build is the compilation of psyntax. Psyntax holds the syntax and grammar of some parts of the scheme compiler. To help try to fix the slowness of the build, there may be a bootstrap/ directory, which contains pre-compiled versions of some core scheme files. But this trick only works if you haven't modified the compiler in a way that invalidates these pre-compiled scheme files. In the test-suite directory are a bunch of tests. Some are in C and require compilation. Most are scheme scripts in the test-suite/tests directory. In the meta directory are scripts that help you run guile from the build tree without a proper install. So looks like I mentioned lib/, libguile/, meta/, test-suite/, and modules, so that's the bulk of things that go into the build. Regards, Mike Gran