unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
From: Ian Hulin <ian@hulin.org.uk>
To: guile-user@gnu.org
Cc: "Andy Wingo \(Guile Developer\)" <wingo@pobox.com>,
	Han-Wen Nienhuys <hanwenn@gmail.com>
Subject: Generating compiled scm (.go) files as part of LilyPond build
Date: Sat, 27 Nov 2010 17:42:26 +0000	[thread overview]
Message-ID: <4CF14302.1020502@hulin.org.uk> (raw)

Firstly, apologies if there is anywhere obvious I've failed to look such
as guile and/or guile mailing list histories.

LilyPond has a large number of .scm files it used and loads into its own
'lily' module using an initialization scheme script lily.scm.  Lily.scm
is the one that does the heavy lifting loading the .scm files.

Our long-term aim, when we are able to move to using Guile V2.0 as an
infrastructure, is to byte-compile as many of these as possible during
the Lily build using something like.
$ guile-tool compile <scm file>
   --output-file=<compiled-scm-dir><.go file>

(In the following paras, <lilypond-root> is the run-time base directory
being used by LilyPond.)
At the moment, during Lily initialization we prefix the guile path
%load-path with <lilypond-root>/scm as this is where we keep all the
LilyPond-specific scm files. This works fine when interpreting
everything using V1.8.7.  It also works reasonably well with 1.9/2.0 if
we use AUTOCOMPILE, as then guile seems to keep a private cache of
.scm.go files in somewhere like:
/home/<username>/.cache/guile/ccache/2.0-R-LE-4/
  home/<username>//lilypond/scm.

When we ask to load the <lilypond-root>/scm/<file>,scm using
primitive-load-path, Guile does all its file date modification magic,
against the <file>.scm.go file in the cache to decide if it needs to
generate newer compiled file.

OK, here's the question:  if we decide not to rely on AUTOCOMPILE, and
we are able generate our own .go files in, say, <lilypond-root>/out/scm,
how do we get guile to use the compiled version
<lilypond-root>/out/scm/<file>.go in preference to a possibly
non-existent .scm.go file in the cache?  There are some hints of
configure/type variables LOAD_PATH and COMPILED_LOAD_PATH in NEWS, and I
hoped that there might me a %compiled-load-path run-time equivalent to
COMPILED_LOAD_PATH just like %load-path corresponds to LOAD_PATH, but it
doesn't exist as at V1.9.13.  If there was, we could possibly prefix
<lilypond-root>/out/scm to the %compiled-load-path in the same way we
fiddle with %load-path for the interpreter.  Of course, I'm open to any
more elegant solutions.

Thanks in advance for any help and/or suggestions,

Cheers,

Ian Hulin



             reply	other threads:[~2010-11-27 17:42 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-27 17:42 Ian Hulin [this message]
2010-11-28 12:01 ` Generating compiled scm (.go) files as part of LilyPond build Neil Jerram
2010-11-30 18:02   ` Ian Hulin
2010-11-29 21:17 ` Andy Wingo
2010-12-01 21:21   ` Ian Hulin
2010-12-01 22:08     ` Andy Wingo
2010-12-30 11:43       ` Ian Hulin
2011-01-28 16:17         ` Andy Wingo
     [not found]           ` <4D433723.50501@hulin.org.uk>
2011-01-29 11:21             ` Andy Wingo
2011-07-19 13:18               ` Ian Hulin
2011-07-19 14:28                 ` Andy Wingo
2011-07-19 23:08                   ` Ian Hulin
2011-07-20 17:38                     ` Andy Wingo
2011-07-21 12:43                     ` Ludovic Courtès

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4CF14302.1020502@hulin.org.uk \
    --to=ian@hulin.org.uk \
    --cc=guile-user@gnu.org \
    --cc=hanwenn@gmail.com \
    --cc=wingo@pobox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).