From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: =?UTF-8?Q?Linus_Bj=C3=B6rnstam?= Newsgroups: gmane.lisp.guile.devel,gmane.lisp.guile.user Subject: Re: Prevent inlining Date: Thu, 13 Feb 2020 14:38:02 +0100 Message-ID: References: <941ae97e-169a-4ab2-991f-f9ecf97e8845@www.fastmail.com> Mime-Version: 1.0 Content-Type: text/plain;charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="21116"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Cyrus-JMAP/3.1.7-802-g7a41c81-fmstable-20200203v1 Cc: Guile User , guile-devel To: "Stefan Israelsson Tampe" Original-X-From: guile-devel-bounces+guile-devel=m.gmane-mx.org@gnu.org Thu Feb 13 14:38:45 2020 Return-path: Envelope-to: guile-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1j2EhZ-0005Mr-47 for guile-devel@m.gmane-mx.org; Thu, 13 Feb 2020 14:38:45 +0100 Original-Received: from localhost ([::1]:52430 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j2EhY-0002Hw-6m for guile-devel@m.gmane-mx.org; Thu, 13 Feb 2020 08:38:44 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:48941) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j2EhH-0002HE-Mg for guile-devel@gnu.org; Thu, 13 Feb 2020 08:38:29 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j2EhG-0005vu-Eu for guile-devel@gnu.org; Thu, 13 Feb 2020 08:38:27 -0500 Original-Received: from wout3-smtp.messagingengine.com ([64.147.123.19]:50517) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1j2EhG-0005vP-0V; Thu, 13 Feb 2020 08:38:26 -0500 Original-Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.west.internal (Postfix) with ESMTP id 895951518; Thu, 13 Feb 2020 08:38:24 -0500 (EST) Original-Received: from imap1 ([10.202.2.51]) by compute3.internal (MEProxy); Thu, 13 Feb 2020 08:38:24 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=veryfast.biz; h= mime-version:message-id:in-reply-to:references:date:from:to:cc :subject:content-type:content-transfer-encoding; s=fm1; bh=RvRjN L8kIf6XSXV1Zo8cCTHgMoaCqY1qRMVGwxcX7B0=; b=DPQlWqrcHhVMYmOJgNDEb eWbskFP7z5tbNAZ7E+3YiUPPMJhEOUFIOfEIkIwDlpkKAfhoFhHjjz7l9uiaRL1T AtifT/7OwWDCkd53puS773sMejYy/uGQNuJcyaV8RvAWgvnf45POeYHhj8r+fdJM sEsjz0BSVBaOnlmN2SPKzXsv09yzZDN3cI69f1dASqsWC90+C0vmO59D4F6kueLp 9gclAzWdrheoCa40CRJPwAf5rIKBmbE1ZU8Td/YA+DSILXkMMgYZ/VowkQuu/sVN 5UBraFXbC+lGJ5g+pLulvw21N3mVkCRbIOeZPG7ww4lHhewHdFH/XP4ZNB/ao/BT A== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; bh=RvRjNL8kIf6XSXV1Zo8cCTHgMoaCqY1qRMVGwxcX7 B0=; b=l9msFsRcDU8hPIL3wdUdYluPn9a1u62Uk8R/13PUdHzhpJcZdUr5KIdst 5+Rkr9vgnpvhflY9Zz0fKojq2ledNTQFhWyLy5egfqS7Zr/+rRRSzxDXrFNIwxXG tO8hIqeZi4U3rw9cWfDl/CwoEXa3cptmOhUtw03GsSnsaMoKJlSdQ+3O94sksrJa V/eCbT0CRyllWqmBuzlQPwClIEi9F1B0pzgBHCnrtA3PJkiUVh0aBkb09RfOOYR3 0cjmXzOuSEJFjDS7sf6RIN5aSIa/LlDH8tbaAGDSe6RLypnE96M1+Tbo+6savT4u zJUzsQlj1wuvyFNHxQQtDz/6Yip4g== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedugedrieekgdehgecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefofgggkfgjfhffhffvufgtgfesthhqredtreerjeenucfhrhhomhepnfhinhhu shgpuehjnphrnhhsthgrmhcuoehlihhnuhhsrdgsjhhorhhnshhtrghmsehvvghrhihfrg hsthdrsghiiieqnecuffhomhgrihhnpehgnhhurdhorhhgnecuvehluhhsthgvrhfuihii vgeptdenucfrrghrrghmpehmrghilhhfrhhomheplhhinhhushdrsghjohhrnhhsthgrmh esvhgvrhihfhgrshhtrdgsihii X-ME-Proxy: Original-Received: by mailuser.nyi.internal (Postfix, from userid 501) id ECF35C200A4; Thu, 13 Feb 2020 08:38:23 -0500 (EST) X-Mailer: MessagingEngine.com Webmail Interface In-Reply-To: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 64.147.123.19 X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.23 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-mx.org@gnu.org Original-Sender: "guile-devel" Xref: news.gmane.io gmane.lisp.guile.devel:20413 gmane.lisp.guile.user:16173 Archived-At: Will it not inline "(not-inline x)" and then peval it to x? What are you= trying to avoid? I am out on very deep water here, now I am just genuin= ely curious :D --=20 Linus Bj=C3=B6rnstam On Thu, 13 Feb 2020, at 08:36, Stefan Israelsson Tampe wrote: > No even if you have cross module inlining you will still be able to=20= > tell i a module will allow inlining or not else you will break quite a= =20 > lot of nice scheme idioms. > This means that this is indeed future proof. >=20 > On Wed, Feb 12, 2020 at 10:50 PM Linus Bj=C3=B6rnstam=20 > wrote: > > If guile ever gets cross-module Inlining in even the simplest form, = this will break. This kind of inlining is probably the most secure one t= o rely on ever (my for loops rely on it, for example). A more future pro= of option is maybe to (set! ...) A variable within the same module, whic= h makes it implicitly boxed. Slow unless guile is able to do unboxing...= > >=20 > > Ludo used the trick here: http://git.savannah.gnu.org/cgit/guile.gi= t/commit/?id=3Dbf1f5422bdb364667d6761dd73454558d6dbf895 > >=20 > > --=20 > > Linus Bj=C3=B6rnstam > >=20 > > On Wed, 12 Feb 2020, at 18:44, Stefan Israelsson Tampe wrote: > > > Hi all, > > >=20 > > > Current guile inlines even variables exposed in the module interf= ace,=20 > > > and I understand that we must live with that and code around it. = So=20 > > > here is a few tips how to mitigate it. > > >=20 > > > The simplest way is to put this definition in a module: > > > ------------------------ > > > (define-module (syntax not-inline) > > > #:export (not-inline)) > > >=20 > > > (cond-expand > > > (guile-3.0 > > > (define (not-inline x) x)) > > > ((or (guile-2.0 guile-2.2) > > > (define-syntax-rule (not-inline x) x))) > > >=20 > > > ------------------------------------- > > > And then in another module do, > > >=20 > > > (use-modules (syntax not-inline)) > > > (define variable (not-inline 12)) > > > (define function (not-inline (lambda () ...))) > > > etc > > >=20 > > > This is also an option (not perfect but you get the gist) > > >=20 > > > -----------------------------------------------------------------= > > > (define-module (syntax define-not-inlinable) > > > #:use-module (syntax not-inline) > > > #:export (inline define lambda define* lambda* define-values) > > > (define inline (lambda (x) x)) > > > (define-syntax define > > > (syntax-rules (inline) > > > ((define (f . x) . code) > > > (define f (not-inline (lambda x . code))) > > > ((define f (inline x)) > > > (define f x)) > > > ((define f x) > > > (define f (not-inlinable x)))) > > > -----------------------------------------------------------------= ----------------- > > > using this module will make all usual define not inlineable and t= o=20 > > > enable inlining you would > > > explicitly ask for it like > > >=20 > > > (define f (inline (lambda (x) (+ x 10)))) > > >=20 > > > If there is a need for this I can write the modules and expose it= on=20 > > > the intertubes. > > >=20 > > > WDYT > > >=20 > > > /Stefan > > >=20 > > >=20 > > >=20 > > >