From debbugs-submit-bounces@debbugs.gnu.org Sun Jan 05 18:44:26 2014 Received: (at submit) by debbugs.gnu.org; 5 Jan 2014 23:44:26 +0000 Received: from localhost ([127.0.0.1]:37211 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VzxMn-0004zX-Ff for submit@debbugs.gnu.org; Sun, 05 Jan 2014 18:44:25 -0500 Received: from eggs.gnu.org ([208.118.235.92]:47307) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VzwxK-0004Fg-M1 for submit@debbugs.gnu.org; Sun, 05 Jan 2014 18:18:07 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VzwxJ-00053I-HM for submit@debbugs.gnu.org; Sun, 05 Jan 2014 18:18:06 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50 autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:48183) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VzwxJ-00053E-ER for submit@debbugs.gnu.org; Sun, 05 Jan 2014 18:18:05 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49027) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VzwxI-0008Ml-FW for bug-guile@gnu.org; Sun, 05 Jan 2014 18:18:05 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VzwxH-000530-A2 for bug-guile@gnu.org; Sun, 05 Jan 2014 18:18:04 -0500 Received: from river.fysh.org ([2001:41d0:8:d47f::2]:52401) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VzwxH-00052w-3l for bug-guile@gnu.org; Sun, 05 Jan 2014 18:18:03 -0500 Received: from zefram by river.fysh.org with local (Exim 4.80 #2 (Debian)) id 1VzwxD-0000o2-KG; Sun, 05 Jan 2014 23:17:59 +0000 Date: Sun, 5 Jan 2014 23:17:59 +0000 From: Zefram To: bug-guile@gnu.org Subject: interactive use subject to compiler limitations Message-ID: <20140105231759.GH30283@fysh.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.0 (----) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Sun, 05 Jan 2014 18:44:19 -0500 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.0 (----) guile-2.0.9's compiler has some inconvenient restrictions, relative to its interpreter. Where the compiler is automatically applied to scripts, the restrictions aren't a serious problem, because if compilation fails then guile falls back to interpreting the script. But in an interactive REPL session, by default each form entered by the user is passed through the compiler, and if compilation fails then the error is signalled, with no fallback to interpretation. As a test case, consider a form in which a procedure object appears. The compiler can't handle forms that directly reference a wide variety of object types, including procedures (both primitive and user-defined) and GOOPS objects. In the interpreter these objects simply self-evaluate, and it can be useful to reference them without the usual indirection through a named variable. Here I'll show what happens to such a form in a script and interactively, in guile 1.8 and 2.0: $ cat t2 (cond-expand (guile-2 (eval-when (compile load eval) (fluid-set! read-eval? #t))) (else (fluid-set! read-eval? #t))) (define (p x y) (#.+ x y)) (write (p 2 3)) (newline) $ guile-1.8 t2 5 $ guile-2.0 --no-auto-compile t2 5 $ guile-2.0 t2 ;;; note: auto-compilation is enabled, set GUILE_AUTO_COMPILE=0 ;;; or pass the --no-auto-compile argument to disable. ;;; compiling /home/zefram/usr/guile/t2 ;;; WARNING: compilation of /home/zefram/usr/guile/t2 failed: ;;; ERROR: build-constant-store: unrecognized object # 5 $ guile-1.8 guile> (fluid-set! read-eval? #t) guile> (define (p x y) (#.+ x y)) guile> (p 2 3) 5 guile> ^D $ guile-2.0 GNU Guile 2.0.9-deb+1-1 Copyright (C) 1995-2013 Free Software Foundation, Inc. Guile comes with ABSOLUTELY NO WARRANTY; for details type `,show w'. This program is free software, and you are welcome to redistribute it under certain conditions; type `,show c' for details. Enter `,help' for help. scheme@(guile-user)> (fluid-set! read-eval? #t) scheme@(guile-user)> (define (p x y) (#.+ x y)) While compiling expression: ERROR: build-constant-store: unrecognized object # scheme@(guile-user)> (p 2 3) :3:0: In procedure #:3:0 ()>: :3:0: In procedure #:3:0 ()>: Unbound variable: p There is a workaround for this problem: the REPL's "interp" option controls whether forms go through the compiler or the interpreter. Hence: scheme@(guile-user)> (fluid-set! read-eval? #t) scheme@(guile-user)> (#.+ 2 3) While compiling expression: ERROR: build-constant-store: unrecognized object # scheme@(guile-user)> ,o interp #t scheme@(guile-user)> (#.+ 2 3) $1 = 5 So the problem is merely that the REPL is broken *by default*. It should either default to the working mechanism, or fall back to it when compilation fails (as the file auto-compilation does). Debian incarnation of this bug report: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=734108 -zefram From debbugs-submit-bounces@debbugs.gnu.org Wed Jan 15 15:05:53 2014 Received: (at 16363) by debbugs.gnu.org; 15 Jan 2014 20:05:53 +0000 Received: from localhost ([127.0.0.1]:52384 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1W3Win-000502-8x for submit@debbugs.gnu.org; Wed, 15 Jan 2014 15:05:53 -0500 Received: from world.peace.net ([96.39.62.75]:50083) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1W3Wil-0004zo-Ik; Wed, 15 Jan 2014 15:05:51 -0500 Received: from 209-6-91-212.c3-0.smr-ubr1.sbo-smr.ma.cable.rcn.com ([209.6.91.212] helo=yeeloong) by world.peace.net with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.72) (envelope-from ) id 1W3Wif-0004Hi-FB; Wed, 15 Jan 2014 15:05:45 -0500 From: Mark H Weaver To: Zefram Subject: Re: bug#16363: interactive use subject to compiler limitations References: <20140105231759.GH30283@fysh.org> Date: Wed, 15 Jan 2014 15:03:29 -0500 In-Reply-To: <20140105231759.GH30283@fysh.org> (zefram@fysh.org's message of "Sun, 5 Jan 2014 23:17:59 +0000") Message-ID: <87ppntt3la.fsf@netris.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 16363 Cc: 16363@debbugs.gnu.org, request@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) tags 16363 notabug thanks Zefram writes: > guile-2.0.9's compiler has some inconvenient restrictions, relative to > its interpreter. Where the compiler is automatically applied to scripts, > the restrictions aren't a serious problem, because if compilation fails > then guile falls back to interpreting the script. But in an interactive > REPL session, by default each form entered by the user is passed through > the compiler, and if compilation fails then the error is signalled, > with no fallback to interpretation. > > As a test case, consider a form in which a procedure object appears. > The compiler can't handle forms that directly reference a wide variety of > object types, including procedures (both primitive and user-defined) and > GOOPS objects. In the interpreter these objects simply self-evaluate, > and it can be useful to reference them without the usual indirection > through a named variable. Scheme does not allow arbitrary user objects to be embedded directly into the source code. It worked by accident in Guile 1.8, but in a system with ahead-of-time compilation to object files, which requires that all code and literals be serialized, there's no sane way to support the semantics you seem to want. Regards, Mark From debbugs-submit-bounces@debbugs.gnu.org Wed Jan 15 16:26:36 2014 Received: (at 16363) by debbugs.gnu.org; 15 Jan 2014 21:26:36 +0000 Received: from localhost ([127.0.0.1]:52501 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1W3Xyt-0002Qe-TX for submit@debbugs.gnu.org; Wed, 15 Jan 2014 16:26:36 -0500 Received: from river.fysh.org ([5.135.154.127]:45191) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1W3Xyq-0002QV-Lp for 16363@debbugs.gnu.org; Wed, 15 Jan 2014 16:26:33 -0500 Received: from zefram by river.fysh.org with local (Exim 4.80 #2 (Debian)) id 1W3Xyn-0004vT-4G; Wed, 15 Jan 2014 21:26:29 +0000 Date: Wed, 15 Jan 2014 21:26:29 +0000 From: Zefram To: Mark H Weaver Subject: Re: bug#16363: interactive use subject to compiler limitations Message-ID: <20140115212629.GZ21945@fysh.org> References: <20140105231759.GH30283@fysh.org> <87ppntt3la.fsf@netris.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87ppntt3la.fsf@netris.org> X-Spam-Score: -0.3 (/) X-Debbugs-Envelope-To: 16363 Cc: 16363@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.3 (/) Mark H Weaver wrote: >that all code and literals be serialized, there's no sane way to support >the semantics you seem to want. We've addressed the semantics themselves on the other ticket, #16362. Accepting that the compiler semantics are preferred, there's still a problem in the scope of my intent for this ticket #16363: that interactive behaviour doesn't match the behaviour of a script. The mismatch is a problem for development regardless of which set of semantics is correct. As I mentioned in passing on the other ticket, you could fix this by enforcing the compiler restrictions in interpreting situations. A start on this would be for read-eval to refuse to accept any object without a readable print form, such as the procedure in my example on this ticket. For objects that do have a readable print form, such as the pair in #16362, it could break the referential identity by copying the object, as if by printing it to characters and reading it back. If, on the other hand, you actually intend for the compiler and interpreter to have visibly different semantics, there's still the problem that the REPL approaches that difference in a different way from script execution. In that case, either the REPL should perform the same fallback that script execution does (as I originally suggested on this ticket), or script execution should not perform the fallback. -zefram From debbugs-submit-bounces@debbugs.gnu.org Wed Jun 02 10:45:28 2021 Received: (at 16363) by debbugs.gnu.org; 2 Jun 2021 14:45:28 +0000 Received: from localhost ([127.0.0.1]:41071 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1loS7c-0005cL-86 for submit@debbugs.gnu.org; Wed, 02 Jun 2021 10:45:28 -0400 Received: from mx1.riseup.net ([198.252.153.129]:59050) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1loLQ0-0007n7-OO for 16363@debbugs.gnu.org; Wed, 02 Jun 2021 03:36:01 -0400 Received: from fews2.riseup.net (fews2-pn.riseup.net [10.0.1.84]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client CN "*.riseup.net", Issuer "Sectigo RSA Domain Validation Secure Server CA" (not verified)) by mx1.riseup.net (Postfix) with ESMTPS id 4Fw16M28YxzDqXR for <16363@debbugs.gnu.org>; Wed, 2 Jun 2021 00:35:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=riseup.net; s=squak; t=1622619355; bh=rfC84ds0zd2m5ZtbLd1Jw3FUt9zG7KYQUEOQXoJTpBU=; h=Subject:From:Reply-To:To:Date:From; b=UM2vTzyhcTcJ9ucVXJXj7JrA0L/9TEPJQnexlFB/ar9tFp71Xe3GCHpsWaKZZd3XM WGyXtKiNQszM41qFa6SNtjyqriISIIrz3UZwdMp3mBPBmQiXVIYkfbF4BAJdlvs8o3 6X5f/ltdDBqa9VW+GgNm5/86HTS7+F+6fIMqoETg= X-Riseup-User-ID: C7D0B232FB41D0059235208C230ABDB00C75EF316680F99A330A15F03936C088 Received: from [127.0.0.1] (localhost [127.0.0.1]) by fews2.riseup.net (Postfix) with ESMTPSA id 4Fw16L32Byz1y6h for <16363@debbugs.gnu.org>; Wed, 2 Jun 2021 00:35:54 -0700 (PDT) Message-ID: <242ca4660754e60bce751021b5125c3cc453c05b.camel@riseup.net> Subject: is this still current ? From: Adriano Peluso To: 16363@debbugs.gnu.org Date: Wed, 02 Jun 2021 09:35:51 +0200 Content-Type: text/plain MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 16363 X-Mailman-Approved-At: Wed, 02 Jun 2021 10:45:26 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: randomlooser@riseup.net Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Can this issue be closed ?