From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Andy Wingo Newsgroups: gmane.lisp.guile.bugs Subject: bug#15602: Compiling several files in the same session [2.0.9] Date: Tue, 21 Jun 2016 13:22:04 +0200 Message-ID: <87twgm23dv.fsf@pobox.com> References: <8761t19t4f.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1466508212 4043 80.91.229.3 (21 Jun 2016 11:23:32 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 21 Jun 2016 11:23:32 +0000 (UTC) Cc: 15602-done@debbugs.gnu.org To: ludo@gnu.org (Ludovic =?UTF-8?Q?Court=C3=A8s?=) Original-X-From: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Tue Jun 21 13:23:18 2016 Return-path: Envelope-to: guile-bugs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1bFJlz-0006Bt-NZ for guile-bugs@m.gmane.org; Tue, 21 Jun 2016 13:23:15 +0200 Original-Received: from localhost ([::1]:50853 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bFJly-0007dP-VT for guile-bugs@m.gmane.org; Tue, 21 Jun 2016 07:23:14 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:40814) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bFJlr-0007Vg-M3 for bug-guile@gnu.org; Tue, 21 Jun 2016 07:23:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bFJlm-0003Cm-PZ for bug-guile@gnu.org; Tue, 21 Jun 2016 07:23:07 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:36298) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bFJlm-0003Ce-M6 for bug-guile@gnu.org; Tue, 21 Jun 2016 07:23:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1bFJlm-00079A-Ff for bug-guile@gnu.org; Tue, 21 Jun 2016 07:23:02 -0400 Resent-From: Andy Wingo Original-Sender: "Debbugs-submit" Resent-To: bug-guile@gnu.org Resent-Date: Tue, 21 Jun 2016 11:23:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: cc-closed 15602 X-GNU-PR-Package: guile X-GNU-PR-Keywords: Mail-Followup-To: 15602@debbugs.gnu.org, wingo@pobox.com, ludo@gnu.org Original-Received: via spool by 15602-done@debbugs.gnu.org id=D15602.146650813527390 (code D ref 15602); Tue, 21 Jun 2016 11:23:02 +0000 Original-Received: (at 15602-done) by debbugs.gnu.org; 21 Jun 2016 11:22:15 +0000 Original-Received: from localhost ([127.0.0.1]:48635 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bFJl1-00077h-5H for submit@debbugs.gnu.org; Tue, 21 Jun 2016 07:22:15 -0400 Original-Received: from pb-sasl1.pobox.com ([64.147.108.66]:51021 helo=sasl.smtp.pobox.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bFJl0-00077a-6E for 15602-done@debbugs.gnu.org; Tue, 21 Jun 2016 07:22:14 -0400 Original-Received: from sasl.smtp.pobox.com (unknown [127.0.0.1]) by pb-sasl1.pobox.com (Postfix) with ESMTP id 92260223CA; Tue, 21 Jun 2016 07:22:12 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type:content-transfer-encoding; s=sasl; bh=YfXCqqEC+qjN 0MQ+J6bI/G+AeSY=; b=PxH9qsmDvZaj1P4zhPwEmPOplBUVcPv4pL8YnErg6DkP jfS7agj0KWxlbhJou0a3ZVOw+gN5ZGSFdrkwDtv/BORksod7Ks1ZG3Aqn87njJZw bOs5caLC4yHwedL3Y3XFLrEg5GosrrFtaCGJKatZwmd1b1Lke4iZeVxPrWknlrs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type:content-transfer-encoding; q=dns; s=sasl; b=GtH0e6 4GFkrgyyTqioAgk670IST8l6rYqQtL17NAdRJ1j23q6INswJseFblV4oI/Or1vsc QJsEnEO+9RAk+XkHMeHZyzcpMl4wNMdcOg1EL5AKrReEUdQYKseyqxCXEKazQE3L f6G10BAn1mZcP3GQjNGx2AywsC3RMTWV6k15c= Original-Received: from pb-sasl1.nyi.icgroup.com (unknown [127.0.0.1]) by pb-sasl1.pobox.com (Postfix) with ESMTP id 880A9223C9; Tue, 21 Jun 2016 07:22:12 -0400 (EDT) Original-Received: from clucks (unknown [88.160.190.192]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by pb-sasl1.pobox.com (Postfix) with ESMTPSA id B76AF223C8; Tue, 21 Jun 2016 07:22:11 -0400 (EDT) In-Reply-To: <8761t19t4f.fsf@gnu.org> ("Ludovic =?UTF-8?Q?Court=C3=A8s?="'s message of "Sun, 13 Oct 2013 15:51:12 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) X-Pobox-Relay-ID: 6635413E-37A2-11E6-B216-C1836462E9F6-02397024!pb-sasl1.pobox.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-guile@gnu.org List-Id: "Bug reports for GUILE, GNU's Ubiquitous Extension Language" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Original-Sender: "bug-guile" Xref: news.gmane.org gmane.lisp.guile.bugs:8075 Archived-At: Hi, On Sun 13 Oct 2013 15:51, ludo@gnu.org (Ludovic Court=C3=A8s) writes: > $ guile --no-auto-compile -L . -c '(use-modules (system base compile)) (f= or-each compile-file (list "one.scm" "two.scm" "three.scm"))' > > $ guile --no-auto-compile -L . -c '(use-modules (system base compile)) (f= or-each compile-file (list "three.scm" "two.scm" "one.scm"))' > > $ guile --no-auto-compile -L . -c '(use-modules (system base compile)) (f= or-each compile-file (list "one.scm" "three.scm" "two.scm"))' > Backtrace: I understand this is now fixed in Guix. You can of course do this for-each compile-file thing, but if modules use each other you need to topologically sort in order to make the run-time bindings visible. Or, as Taylan notes, just load after compiling. > I think the right thing would be to use a separate module hierarchy in > the dynamic extent of =E2=80=98compile-file=E2=80=99, somehow, such that = all module side > effects are isolated. I don't think this is going to happen, for what that's worth :/ > Of course the above can be worked around by running =E2=80=98compile-file= =E2=80=99 in a > child process, but forking alone is more expensive than =E2=80=98compile-= file=E2=80=99, > so that=E2=80=99s not really a solution when there are many files. It's the N^2 expansion that's the problem, not the forking. If you have N files which depend on each other, then compiling each one will require the expansion of approximately all N files, so N*N costs in number of files. Or N log N if you have a tree ordering of your files. Anyway it's badness. Glad to know that Taylan has fixed this one in Guix. However I'm not sure that there's more to do on Guile's side though. Closing; please re-open or file a new bug if you think there is something Guile should do. Andy