From unknown Sat Aug 16 21:15:36 2025 X-Loop: help-debbugs@gnu.org Subject: bug#10132: Help lilypond interleave scheme and lilypond code in guile 2.x Resent-From: Andy Wingo Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-guile@gnu.org Resent-Date: Fri, 25 Nov 2011 11:18:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 10132 X-GNU-PR-Package: guile X-GNU-PR-Keywords: To: 10132@debbugs.gnu.org Cc: Ian Hulin , David Kastrup X-Debbugs-Original-To: bug-guile Received: via spool by submit@debbugs.gnu.org id=B.132221982313317 (code B ref -1); Fri, 25 Nov 2011 11:18:02 +0000 Received: (at submit) by debbugs.gnu.org; 25 Nov 2011 11:17:03 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RTtmA-0003Sj-IV for submit@debbugs.gnu.org; Fri, 25 Nov 2011 06:17:03 -0500 Received: from eggs.gnu.org ([140.186.70.92]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RTtm8-0003SG-HB for submit@debbugs.gnu.org; Fri, 25 Nov 2011 06:17:01 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RTtkZ-0003rD-2p for submit@debbugs.gnu.org; Fri, 25 Nov 2011 06:15:24 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD, T_DKIM_INVALID autolearn=unavailable version=3.3.1 Received: from lists.gnu.org ([140.186.70.17]:49373) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RTtkZ-0003r5-1I for submit@debbugs.gnu.org; Fri, 25 Nov 2011 06:15:23 -0500 Received: from eggs.gnu.org ([140.186.70.92]:49052) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RTtkV-0006Im-2g for bug-guile@gnu.org; Fri, 25 Nov 2011 06:15:23 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RTtkT-0003qn-T2 for bug-guile@gnu.org; Fri, 25 Nov 2011 06:15:19 -0500 Received: from a-pb-sasl-sd.pobox.com ([74.115.168.62]:52095 helo=sasl.smtp.pobox.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RTtkT-0003qj-Ke; Fri, 25 Nov 2011 06:15:17 -0500 Received: from sasl.smtp.pobox.com (unknown [127.0.0.1]) by a-pb-sasl-sd.pobox.com (Postfix) with ESMTP id 813366C99; Fri, 25 Nov 2011 06:15:17 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=from:to:cc :subject:date:message-id:mime-version:content-type; s=sasl; bh=B xQi6jO0cqti4MW58YYGxxYLyQU=; b=sOuaNUnk2W9i++gfnxUulQs4a6u4+Lma1 ilI3hrriUycNZZ0GwtRI5xk48WDX8bsCfPu5Im/ougp0y5Vyu0AmmoBTu07nMsIw DvdcmRVs1bWPNDxkMaYEm9xDTuypz0YKx3Dn4vzsnDgmxfyL71pDojS9uKE9RE1n VRZVjRwuU8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=pobox.com; h=from:to:cc :subject:date:message-id:mime-version:content-type; q=dns; s= sasl; b=OOdiC1j76EXPd8ivRr9xyyjZ1Bvafdrt3ssscQt5jKb2UX5UdegrjAjK 747JxqP8rDsnJFMbaNjQV3E88gICPDAjguRcZF6POdWiE1If7ZP4CXfY7HBksxid DRAyi0vanB0/ZWsVgy2s8Eq3RUuarruOMPYBWItLJvtq1xgYxtE= Received: from a-pb-sasl-sd.pobox.com (unknown [127.0.0.1]) by a-pb-sasl-sd.pobox.com (Postfix) with ESMTP id 7A77B6C98; Fri, 25 Nov 2011 06:15:17 -0500 (EST) Received: from badger (unknown [91.117.99.155]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by a-pb-sasl-sd.pobox.com (Postfix) with ESMTPSA id F1FD46C97; Fri, 25 Nov 2011 06:15:16 -0500 (EST) From: Andy Wingo Date: Fri, 25 Nov 2011 12:15:14 +0100 Message-ID: <87vcq8bghp.fsf@pobox.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Pobox-Relay-ID: C10BDD96-1756-11E1-8597-65B1DE995924-02397024!a-pb-sasl-sd.pobox.com X-detected-operating-system: by eggs.gnu.org: Solaris 10 (beta) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 140.186.70.17 X-Spam-Score: -4.3 (----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -4.6 (----) Hi David, This bug was forked from bug 10099, where David has a longer explanation. On Fri 25 Nov 2011 11:37, David Kastrup writes: > So much for that. The next quote is for a totally different issue, the > availability of local environments and evaluation in them. Lilypond has > an input syntax of its own, and it allows interspersing Scheme code. $ > or # switches to the Scheme interpreter (for one sexp) when in Lilypond > syntax, and #{ ... #} switches to Lilypond inside. Aaah. Thanks for this explanation; I had never seen this code before. Do you use a read-hash-extend reader for #{#} ? What do you use to parse the lilypond code? What does it parse to? I agree that the-environment and local-eval were nice solutions for this. In Guile 2.0 it's not as nice for you, because if you implement another evaluator, you don't get backtraces that are as nice. > As I said: for this particular application, I have coded a rather > inelegant and resource-grabbing workaround that really is not going to > help performance since the intertwined Lilypond interpreter does not > benefit from precompilation of mostly trivial lambda functions when the > actual procedure-environment is unlikely to ever reference more than > five variables. Understood. Let's work to find a good solution in 2.0. Andy -- http://wingolog.org/ From unknown Sat Aug 16 21:15:36 2025 X-Loop: help-debbugs@gnu.org Subject: bug#10132: Help lilypond interleave scheme and lilypond code in guile 2.x Resent-From: David Kastrup Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-guile@gnu.org Resent-Date: Fri, 25 Nov 2011 13:38:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 10132 X-GNU-PR-Package: guile X-GNU-PR-Keywords: To: Andy Wingo Cc: 10132@debbugs.gnu.org, ian@hulin.org.uk X-Debbugs-Original-Cc: bug-guile , Ian Hulin Received: via spool by submit@debbugs.gnu.org id=B.132222826929403 (code B ref -1); Fri, 25 Nov 2011 13:38:01 +0000 Received: (at submit) by debbugs.gnu.org; 25 Nov 2011 13:37:49 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RTvyO-0007eB-Kv for submit@debbugs.gnu.org; Fri, 25 Nov 2011 08:37:49 -0500 Received: from eggs.gnu.org ([140.186.70.92]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RTvyM-0007e5-SP for submit@debbugs.gnu.org; Fri, 25 Nov 2011 08:37:47 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RTvwj-0007iH-OH for submit@debbugs.gnu.org; Fri, 25 Nov 2011 08:36:10 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=5.0 tests=ALL_TRUSTED,BAYES_00, RP_MATCHES_RCVD autolearn=unavailable version=3.3.1 Received: from lists.gnu.org ([140.186.70.17]:33091) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RTvwj-0007iB-IM for submit@debbugs.gnu.org; Fri, 25 Nov 2011 08:36:05 -0500 Received: from eggs.gnu.org ([140.186.70.92]:38755) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RTvwi-0006wG-8o for bug-guile@gnu.org; Fri, 25 Nov 2011 08:36:05 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RTvwc-0007hJ-2H for bug-guile@gnu.org; Fri, 25 Nov 2011 08:36:04 -0500 Received: from fencepost.gnu.org ([140.186.70.10]:58824) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RTvwb-0007hF-VF for bug-guile@gnu.org; Fri, 25 Nov 2011 08:35:58 -0500 Received: from localhost ([127.0.0.1]:55108 helo=lola) by fencepost.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RTvwa-0002vJ-7B; Fri, 25 Nov 2011 08:35:56 -0500 Received: by lola (Postfix, from userid 1000) id 42BDCE050C; Fri, 25 Nov 2011 14:35:28 +0100 (CET) From: David Kastrup References: <87vcq8bghp.fsf@pobox.com> Date: Fri, 25 Nov 2011 14:35:28 +0100 In-Reply-To: <87vcq8bghp.fsf@pobox.com> (Andy Wingo's message of "Fri, 25 Nov 2011 12:15:14 +0100") Message-ID: <871uswqq8v.fsf@fencepost.gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.90 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 140.186.70.17 X-Spam-Score: -6.4 (------) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.4 (------) Andy Wingo writes: > Hi David, > > This bug was forked from bug 10099, where David has a longer > explanation. > > On Fri 25 Nov 2011 11:37, David Kastrup writes: > >> So much for that. The next quote is for a totally different issue, the >> availability of local environments and evaluation in them. Lilypond has >> an input syntax of its own, and it allows interspersing Scheme code. $ >> or # switches to the Scheme interpreter (for one sexp) when in Lilypond >> syntax, and #{ ... #} switches to Lilypond inside. > > Aaah. Thanks for this explanation; I had never seen this code before. > > Do you use a read-hash-extend reader for #{#} ? Yes: This link is likely a bit of a moving target since I have several patches in the queue to make the behavior more predictable (and produce better quality error messages when things go wrong). > What do you use to parse the lilypond code? What does it parse to? Classical Bison/Flex parser/scanner. There is no "what does it parse to" since the Bison rules execute the actions on the fly: it is a classical interpreter. With a number of lexical and semantical tie-ins, it would be non-trivial to actually create an intermediate representation. The file responsible for reading and evaluating embedded Scheme expressions is The proposed robustifying changes currently in the queue are in . The reading is done by the lexer. Evaluation of $ forms is done in the lexer, evaluation of # forms is delayed and happens in the parser in order to avoid timing problems (lookahead tokens should preferably not be evaluated while they are still lookahead since they might depend on the actions of the commands before them). > I agree that the-environment and local-eval were nice solutions for > this. In Guile 2.0 it's not as nice for you, because if you implement > another evaluator, you don't get backtraces that are as nice. We don't really do anything in the line of backtraces. Until the proposed patch gets through, we don't really do anything sensible in the line of error messages either. >> As I said: for this particular application, I have coded a rather >> inelegant and resource-grabbing workaround that really is not going >> to help performance since the intertwined Lilypond interpreter does >> not benefit from precompilation of mostly trivial lambda functions >> when the actual procedure-environment is unlikely to ever reference >> more than five variables. > > Understood. Let's work to find a good solution in 2.0. If you follow the history of parser-ly-from-scheme.scm, you'll see that there has been a flurry of activity recently. Before I had to cater for GuileV2, the code just sweeped up the procedure-environment of a basically empty lambda function and left all rereading and evaluation to runtime. Even earlier than that, there was a complicated interpretation of # and $ where the respective expressions were all evaluated in a let-form at runtime before the Lilypond parser went to work. The current approach of wrapping everything in lambda as compared to the historic implementation of evaluating everything Scheme before starting the Lilypond interpreter has the advantage that the timing of evaluation (if any) is determined by the Lilypond interpreter. The procedure-environment approach was elegant and minimally complex. The question is how feasible it is for the Guile compiler to capture an environment in a form that can be used even after compilation. Like taking the address of a variable in C, the export of such an environment interferes with a number of static optimizations. For our particular application, readonly access to the symbols in the environment should be quite sufficient, but of course I can't vouch for other potential uses. -- David Kastrup From unknown Sat Aug 16 21:15:36 2025 X-Loop: help-debbugs@gnu.org Subject: bug#10132: Help lilypond interleave scheme and lilypond code in guile 2.x Resent-From: Andy Wingo Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-guile@gnu.org Resent-Date: Fri, 25 Nov 2011 14:28:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 10132 X-GNU-PR-Package: guile X-GNU-PR-Keywords: To: David Kastrup Cc: 10132@debbugs.gnu.org, ian@hulin.org.uk X-Debbugs-Original-Cc: bug-guile , Ian Hulin Received: via spool by submit@debbugs.gnu.org id=B.13222312751393 (code B ref -1); Fri, 25 Nov 2011 14:28:02 +0000 Received: (at submit) by debbugs.gnu.org; 25 Nov 2011 14:27:55 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RTwks-0000MP-Md for submit@debbugs.gnu.org; Fri, 25 Nov 2011 09:27:55 -0500 Received: from eggs.gnu.org ([140.186.70.92]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RTwkp-0000MH-74 for submit@debbugs.gnu.org; Fri, 25 Nov 2011 09:27:52 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RTwjE-000102-Nk for submit@debbugs.gnu.org; Fri, 25 Nov 2011 09:26:13 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD, T_DKIM_INVALID autolearn=unavailable version=3.3.1 Received: from lists.gnu.org ([140.186.70.17]:45978) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RTwjE-0000zv-M7 for submit@debbugs.gnu.org; Fri, 25 Nov 2011 09:26:12 -0500 Received: from eggs.gnu.org ([140.186.70.92]:46248) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RTwjD-00081O-4v for bug-guile@gnu.org; Fri, 25 Nov 2011 09:26:12 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RTwjC-0000z7-0m for bug-guile@gnu.org; Fri, 25 Nov 2011 09:26:11 -0500 Received: from a-pb-sasl-sd.pobox.com ([74.115.168.62]:44250 helo=sasl.smtp.pobox.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RTwjB-0000z3-SY; Fri, 25 Nov 2011 09:26:09 -0500 Received: from sasl.smtp.pobox.com (unknown [127.0.0.1]) by a-pb-sasl-sd.pobox.com (Postfix) with ESMTP id 689167AD7; Fri, 25 Nov 2011 09:26:09 -0500 (EST) 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; s=sasl; bh=yuFDRgB0p4n0+WwvupfCpGwY29A=; b=Lj6Iqf 4NtQ7JHeUUaDSdsWvMFkPyPEhuK2Wel3QprxmE8AajJwObNSmYbH+uHPUHAZ60Ok +MGQJVJXtIA+kqdkpxAkX8ipUoo2Fc7QW9KwwAlUnZR/DMUyfgI03SSTMa6RiA4+ A6bR9u5UCBKmbq0LIDMd/lJO6YBBdxcayRX0U= 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; q=dns; s=sasl; b=EWcDAM+Jsge3/vjQoqPdUre5sZdKhavJ vOnjs4Eo6iPneSLpML2Njo9xhgM4DZLedD84NrXL9JavuQ1rAp0HUNPVLu8stW8e VC/e27dJFlnX3NGh2iDNjMMs+kk7149qlgCW28LkNhq0Sh5m9b+rD2jyhP0Bg+wO N5aJRRMHCr8= Received: from a-pb-sasl-sd.pobox.com (unknown [127.0.0.1]) by a-pb-sasl-sd.pobox.com (Postfix) with ESMTP id 5B08C7AD6; Fri, 25 Nov 2011 09:26:09 -0500 (EST) Received: from badger (unknown [91.117.99.155]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by a-pb-sasl-sd.pobox.com (Postfix) with ESMTPSA id A36247AD5; Fri, 25 Nov 2011 09:26:08 -0500 (EST) From: Andy Wingo References: <87vcq8bghp.fsf@pobox.com> <871uswqq8v.fsf@fencepost.gnu.org> Date: Fri, 25 Nov 2011 15:26:00 +0100 In-Reply-To: <871uswqq8v.fsf@fencepost.gnu.org> (David Kastrup's message of "Fri, 25 Nov 2011 14:35:28 +0100") Message-ID: <87lir4b7nr.fsf@pobox.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Pobox-Relay-ID: 6AC6D5BA-1771-11E1-9BCF-65B1DE995924-02397024!a-pb-sasl-sd.pobox.com X-detected-operating-system: by eggs.gnu.org: Solaris 10 (beta) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 140.186.70.17 X-Spam-Score: -4.8 (----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -5.0 (-----) Hi, I am going to be away from the machine for the weekend, but before I headed out, I just wanted to put out one idea: On Fri 25 Nov 2011 14:35, David Kastrup writes: >> What do you use to parse the lilypond code? What does it parse to? > > Classical Bison/Flex parser/scanner. There is no "what does it parse > to" since the Bison rules execute the actions on the fly: it is a > classical interpreter. With a number of lexical and semantical tie-ins, > it would be non-trivial to actually create an intermediate > representation. Have you considered using silex or some other tokenizer in scheme, combined with the lalr parser from (system base lalr)? See "LALR(1) Parsing" in the manual for Guile 2.0. > The procedure-environment approach was elegant and minimally complex. > The question is how feasible it is for the Guile compiler to capture an > environment in a form that can be used even after compilation. Like > taking the address of a variable in C, the export of such an environment > interferes with a number of static optimizations. For our particular > application, readonly access to the symbols in the environment should be > quite sufficient, but of course I can't vouch for other potential uses. If this is the answer, then we can figure out a way to implement it in Guile 2.0.x as well. But if you are amenable to it, implementing the parser in Scheme would be another attractive option -- though, it would be a change, and that has costs. Cheers, Andy -- http://wingolog.org/ From unknown Sat Aug 16 21:15:36 2025 X-Loop: help-debbugs@gnu.org Subject: bug#10132: Help lilypond interleave scheme and lilypond code in guile 2.x Resent-From: David Kastrup Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-guile@gnu.org Resent-Date: Fri, 25 Nov 2011 14:47:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 10132 X-GNU-PR-Package: guile X-GNU-PR-Keywords: To: Andy Wingo Cc: 10132@debbugs.gnu.org, ian@hulin.org.uk X-Debbugs-Original-Cc: bug-guile , Ian Hulin Received: via spool by submit@debbugs.gnu.org id=B.13222323733061 (code B ref -1); Fri, 25 Nov 2011 14:47:01 +0000 Received: (at submit) by debbugs.gnu.org; 25 Nov 2011 14:46:13 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RTx2b-0000nK-EX for submit@debbugs.gnu.org; Fri, 25 Nov 2011 09:46:13 -0500 Received: from eggs.gnu.org ([140.186.70.92]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RTx2Z-0000nC-6M for submit@debbugs.gnu.org; Fri, 25 Nov 2011 09:46:12 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RTx0y-0005if-VD for submit@debbugs.gnu.org; Fri, 25 Nov 2011 09:44:34 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=5.0 tests=ALL_TRUSTED,BAYES_00, RP_MATCHES_RCVD autolearn=unavailable version=3.3.1 Received: from lists.gnu.org ([140.186.70.17]:38774) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RTx0y-0005ia-Ti for submit@debbugs.gnu.org; Fri, 25 Nov 2011 09:44:32 -0500 Received: from eggs.gnu.org ([140.186.70.92]:53595) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RTx0x-0007iy-Re for bug-guile@gnu.org; Fri, 25 Nov 2011 09:44:32 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RTx0w-0005iE-As for bug-guile@gnu.org; Fri, 25 Nov 2011 09:44:31 -0500 Received: from fencepost.gnu.org ([140.186.70.10]:57046) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RTx0w-0005i1-16 for bug-guile@gnu.org; Fri, 25 Nov 2011 09:44:30 -0500 Received: from localhost ([127.0.0.1]:50489 helo=lola) by fencepost.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RTx0u-0007Ip-J4; Fri, 25 Nov 2011 09:44:29 -0500 Received: by lola (Postfix, from userid 1000) id E2072E050C; Fri, 25 Nov 2011 15:44:27 +0100 (CET) From: David Kastrup References: <87vcq8bghp.fsf@pobox.com> <871uswqq8v.fsf@fencepost.gnu.org> <87lir4b7nr.fsf@pobox.com> Date: Fri, 25 Nov 2011 15:44:27 +0100 In-Reply-To: <87lir4b7nr.fsf@pobox.com> (Andy Wingo's message of "Fri, 25 Nov 2011 15:26:00 +0100") Message-ID: <87sjlcp8hg.fsf@fencepost.gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.90 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 140.186.70.17 X-Spam-Score: -6.4 (------) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.4 (------) Andy Wingo writes: > I am going to be away from the machine for the weekend, but before I > headed out, I just wanted to put out one idea: > > On Fri 25 Nov 2011 14:35, David Kastrup writes: > >>> What do you use to parse the lilypond code? What does it parse to? >> >> Classical Bison/Flex parser/scanner. There is no "what does it parse >> to" since the Bison rules execute the actions on the fly: it is a >> classical interpreter. With a number of lexical and semantical tie-ins, >> it would be non-trivial to actually create an intermediate >> representation. > > Have you considered using silex or some other tokenizer in scheme, > combined with the lalr parser from (system base lalr)? See "LALR(1) > Parsing" in the manual for Guile 2.0. Lilypond is not yet capable of running under Guile 2.0 (and needs to stay 1.8-compatible for a considerable time span), so it makes no sense to think about using 2.0 features for core parts of it. The core of Lilypond is quite C++-centric. Parsing takes a non-negligible amount of runtime already. Switching to a different system likely to be slower and less directly interfacing with C++ is not going to be on the agenda anytime soon, and I am less than convinced that this total change of playground would actually make a qualitative difference regarding the implementation of this particular scoping task. >> The procedure-environment approach was elegant and minimally complex. >> The question is how feasible it is for the Guile compiler to capture >> an environment in a form that can be used even after compilation. >> Like taking the address of a variable in C, the export of such an >> environment interferes with a number of static optimizations. For >> our particular application, readonly access to the symbols in the >> environment should be quite sufficient, but of course I can't vouch >> for other potential uses. > > If this is the answer, then we can figure out a way to implement it in > Guile 2.0.x as well. "Readonly access" in this context does not mean "separate copies" but rather "access to the original variables without the need to change them via this access path". If such a closure variable is changed by a function "properly" compiled in the lexical closure (rather than artificially relying on process-environment), we would likely still need to see this change. > But if you are amenable to it, implementing the parser in Scheme would > be another attractive option -- though, it would be a change, and that > has costs. That's not on the table right now in my opinion, and I actually don't see that it would help to a relevant degree since, as I said, lexical and semantic tie-ins require the parser to work _progressively_ instead of being able to compile an intermediate Scheme representation, and without an intermediate representation, I don't see how we could exploit the "natural" implicit implementation of closures in the Scheme compiler. -- David Kastrup From unknown Sat Aug 16 21:15:36 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.428 (Entity 5.428) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Andy Wingo Subject: bug#10132: closed (Re: bug#10132: Help lilypond interleave scheme and lilypond code in guile 2.x) Message-ID: References: <87y5stf8op.fsf@pobox.com> <87vcq8bghp.fsf@pobox.com> X-Gnu-PR-Message: they-closed 10132 X-Gnu-PR-Package: guile Reply-To: 10132@debbugs.gnu.org Date: Fri, 27 Jan 2012 15:50:03 +0000 Content-Type: multipart/mixed; boundary="----------=_1327679403-22602-1" This is a multi-part message in MIME format... ------------=_1327679403-22602-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #10132: Help lilypond interleave scheme and lilypond code in guile 2.x which was filed against the guile package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 10132@debbugs.gnu.org. --=20 10132: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D10132 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1327679403-22602-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 10132-done) by debbugs.gnu.org; 27 Jan 2012 15:49:09 +0000 Received: from localhost ([127.0.0.1]:46920 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Rqo32-0005rM-6S for submit@debbugs.gnu.org; Fri, 27 Jan 2012 10:49:08 -0500 Received: from a-pb-sasl-sd.pobox.com ([74.115.168.62]:49286 helo=sasl.smtp.pobox.com) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Rqo2z-0005rE-Ro for 10132-done@debbugs.gnu.org; Fri, 27 Jan 2012 10:49:06 -0500 Received: from sasl.smtp.pobox.com (unknown [127.0.0.1]) by a-pb-sasl-sd.pobox.com (Postfix) with ESMTP id 51DEE920F; Fri, 27 Jan 2012 10:48:27 -0500 (EST) 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; s=sasl; bh=B5dFFt9s2p6CN6yQvQCVMvpqI3s=; b=SgvT7X Q/+cdbao+GgNingsZYRYPEx8gYOUNuOe1X/+BjBJeVSW03fYDXKCSh3xRHbBDJoV T53Q6R2qdhWMFO9hVNd2L+Dr5mALdIh+DpEpbEOz9nhpVHTotqHvkROLtt+x+8tj vUuWEqZHEGwmMW38v+FgvbWHJuNN1WI3NmaQU= 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; q=dns; s=sasl; b=cdNL4fVQAqowUELndCw0NVQNjAVDllCJ HWX2aseONkNBod4zDdK4kUz6xqP3EEWIZ0n2cIubaCXodwV6ykngkf1C7vGxG36Z tr9dzsfl6RiWKBxlbcASzYvHXZ9BPKVKzx/0HRfny2NLLKtUYGjgjKRmmb/gF6Rt P8eemhDWxfY= Received: from a-pb-sasl-sd.pobox.com (unknown [127.0.0.1]) by a-pb-sasl-sd.pobox.com (Postfix) with ESMTP id 49D80920E; Fri, 27 Jan 2012 10:48:27 -0500 (EST) Received: from badger (unknown [90.164.198.39]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by a-pb-sasl-sd.pobox.com (Postfix) with ESMTPSA id 9ECB2920D; Fri, 27 Jan 2012 10:48:26 -0500 (EST) From: Andy Wingo To: 10132-done@debbugs.gnu.org Subject: Re: bug#10132: Help lilypond interleave scheme and lilypond code in guile 2.x References: <87vcq8bghp.fsf@pobox.com> Date: Fri, 27 Jan 2012 16:48:22 +0100 In-Reply-To: <87vcq8bghp.fsf@pobox.com> (Andy Wingo's message of "Fri, 25 Nov 2011 12:15:14 +0100") Message-ID: <87y5stf8op.fsf@pobox.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Pobox-Relay-ID: 5A148316-48FE-11E1-8CAE-65B1DE995924-02397024!a-pb-sasl-sd.pobox.com X-Spam-Score: -1.9 (-) X-Debbugs-Envelope-To: 10132-done Cc: Ian Hulin , David Kastrup X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.9 (-) Hi Ian and David, On Fri 25 Nov 2011 12:15, Andy Wingo writes: > On Fri 25 Nov 2011 11:37, David Kastrup writes: > >> As I said: for this particular application, I have coded a rather >> inelegant and resource-grabbing workaround that really is not going to >> help performance since the intertwined Lilypond interpreter does not >> benefit from precompilation of mostly trivial lambda functions when the >> actual procedure-environment is unlikely to ever reference more than >> five variables. > > Understood. Let's work to find a good solution in 2.0. 2.0 now has the-environment and local-eval again (though not procedure-environment). Import the (ice-9 local-eval) module to have access to these forms. Hopefully at this point we have solved this issue; please give it a try, and open a new bug if something comes up. Cheers, Andy -- http://wingolog.org/ ------------=_1327679403-22602-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 25 Nov 2011 11:17:03 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RTtmA-0003Sj-IV for submit@debbugs.gnu.org; Fri, 25 Nov 2011 06:17:03 -0500 Received: from eggs.gnu.org ([140.186.70.92]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RTtm8-0003SG-HB for submit@debbugs.gnu.org; Fri, 25 Nov 2011 06:17:01 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RTtkZ-0003rD-2p for submit@debbugs.gnu.org; Fri, 25 Nov 2011 06:15:24 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD, T_DKIM_INVALID autolearn=unavailable version=3.3.1 Received: from lists.gnu.org ([140.186.70.17]:49373) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RTtkZ-0003r5-1I for submit@debbugs.gnu.org; Fri, 25 Nov 2011 06:15:23 -0500 Received: from eggs.gnu.org ([140.186.70.92]:49052) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RTtkV-0006Im-2g for bug-guile@gnu.org; Fri, 25 Nov 2011 06:15:23 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RTtkT-0003qn-T2 for bug-guile@gnu.org; Fri, 25 Nov 2011 06:15:19 -0500 Received: from a-pb-sasl-sd.pobox.com ([74.115.168.62]:52095 helo=sasl.smtp.pobox.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RTtkT-0003qj-Ke; Fri, 25 Nov 2011 06:15:17 -0500 Received: from sasl.smtp.pobox.com (unknown [127.0.0.1]) by a-pb-sasl-sd.pobox.com (Postfix) with ESMTP id 813366C99; Fri, 25 Nov 2011 06:15:17 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=from:to:cc :subject:date:message-id:mime-version:content-type; s=sasl; bh=B xQi6jO0cqti4MW58YYGxxYLyQU=; b=sOuaNUnk2W9i++gfnxUulQs4a6u4+Lma1 ilI3hrriUycNZZ0GwtRI5xk48WDX8bsCfPu5Im/ougp0y5Vyu0AmmoBTu07nMsIw DvdcmRVs1bWPNDxkMaYEm9xDTuypz0YKx3Dn4vzsnDgmxfyL71pDojS9uKE9RE1n VRZVjRwuU8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=pobox.com; h=from:to:cc :subject:date:message-id:mime-version:content-type; q=dns; s= sasl; b=OOdiC1j76EXPd8ivRr9xyyjZ1Bvafdrt3ssscQt5jKb2UX5UdegrjAjK 747JxqP8rDsnJFMbaNjQV3E88gICPDAjguRcZF6POdWiE1If7ZP4CXfY7HBksxid DRAyi0vanB0/ZWsVgy2s8Eq3RUuarruOMPYBWItLJvtq1xgYxtE= Received: from a-pb-sasl-sd.pobox.com (unknown [127.0.0.1]) by a-pb-sasl-sd.pobox.com (Postfix) with ESMTP id 7A77B6C98; Fri, 25 Nov 2011 06:15:17 -0500 (EST) Received: from badger (unknown [91.117.99.155]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by a-pb-sasl-sd.pobox.com (Postfix) with ESMTPSA id F1FD46C97; Fri, 25 Nov 2011 06:15:16 -0500 (EST) From: Andy Wingo To: bug-guile Subject: Help lilypond interleave scheme and lilypond code in guile 2.x Date: Fri, 25 Nov 2011 12:15:14 +0100 Message-ID: <87vcq8bghp.fsf@pobox.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Pobox-Relay-ID: C10BDD96-1756-11E1-8597-65B1DE995924-02397024!a-pb-sasl-sd.pobox.com X-detected-operating-system: by eggs.gnu.org: Solaris 10 (beta) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 140.186.70.17 X-Spam-Score: -4.3 (----) X-Debbugs-Envelope-To: submit Cc: Ian Hulin , David Kastrup X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -4.6 (----) Hi David, This bug was forked from bug 10099, where David has a longer explanation. On Fri 25 Nov 2011 11:37, David Kastrup writes: > So much for that. The next quote is for a totally different issue, the > availability of local environments and evaluation in them. Lilypond has > an input syntax of its own, and it allows interspersing Scheme code. $ > or # switches to the Scheme interpreter (for one sexp) when in Lilypond > syntax, and #{ ... #} switches to Lilypond inside. Aaah. Thanks for this explanation; I had never seen this code before. Do you use a read-hash-extend reader for #{#} ? What do you use to parse the lilypond code? What does it parse to? I agree that the-environment and local-eval were nice solutions for this. In Guile 2.0 it's not as nice for you, because if you implement another evaluator, you don't get backtraces that are as nice. > As I said: for this particular application, I have coded a rather > inelegant and resource-grabbing workaround that really is not going to > help performance since the intertwined Lilypond interpreter does not > benefit from precompilation of mostly trivial lambda functions when the > actual procedure-environment is unlikely to ever reference more than > five variables. Understood. Let's work to find a good solution in 2.0. Andy -- http://wingolog.org/ ------------=_1327679403-22602-1--