From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ej1-x632.google.com (mail-ej1-x632.google.com [IPv6:2a00:1450:4864:20::632]) by sourceware.org (Postfix) with ESMTPS id 2EDCB3857423 for ; Sun, 8 Aug 2021 15:54:12 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 2EDCB3857423 Received: by mail-ej1-x632.google.com with SMTP id oz16so8341512ejc.7 for ; Sun, 08 Aug 2021 08:54:12 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=oLjg2zv+I5vmo/Cu2KoDcm4gFx4DKYus0h1qCXXmHOU=; b=fw/oCCjPgZhxtg0LWqqfq1Rntmtdb+LDjPUORRYxye8BOWq5urIxnwbTrdnRu0UjVu LuKFjyy6hpf8chO3CiXDbKVfo1W5y9EASfJoxMeRoTCL9Go70wtwENOjOxGd+wZnJNeJ 8/6daUzR+NrCMKEmbFWfx7U6JrbsRqoqgRDrM6JSWTWClUOE6Ap+dFtf/c7ggxSZH1tx 0UmFWuwCXez6zLJRqjMY71Yy2gOz5ssBdajM/oY56jNgDe9r8QNcHkvm7i0NTDc6kd8F qMoQDK9A8lLg7dNIxi0KmP7Eu6OyDJIHHGC3QiE54gxBTIlmWVrtx5ipVNGVEj+sZOM0 Dj+g== X-Gm-Message-State: AOAM531/hOF5LUQd10JR9UGoPO1M/4j0A2pqkPW0m3ta7oTKeptnFXJI N2tLT3hcXCJKeXTuP8Zn5IAiO6RAmpCKtEUf+3c= X-Google-Smtp-Source: ABdhPJxYNEflANpaTqwj27jwWXev9Jd0OpvdPmA2nE32wOXHEmCO0S1giqlBpWTkjuug3+d8Rmhd4IBe0PpxQ+dQe9c= X-Received: by 2002:a17:906:5fc7:: with SMTP id k7mr18188585ejv.377.1628438050391; Sun, 08 Aug 2021 08:54:10 -0700 (PDT) MIME-Version: 1.0 References: <23585.1619896007@localhost> <11feb74b-49fa-3fbd-213d-7d939dccfb1a@bothner.com> <666b9a7d-156b-0ee7-e1a1-9409cf0d376f@bothner.com> In-Reply-To: From: Andrea Bernardini Date: Sun, 8 Aug 2021 16:53:59 +0100 Message-ID: Subject: Re: First-class continuations in Kawa To: Arvydas Silanskas Cc: Per Bothner , kawa mailing list X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, HTML_MESSAGE, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: kawa@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Kawa mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Aug 2021 15:54:14 -0000 Hi Arvydas, As far as I remember we never took into account interaction of call/cc outside of scheme code. The top level handler is added to the top level ModuleExp when the scheme code is compiled. When you define a class I don't think it's wrapped into a ModuleExp (I'm guessing here you are calling call/cc inside a method in Foo). A practical way to allow that could be to use a delimited continuation as explained here: https://andrebask.github.io/thesis/#other-control-operators-delimited-conti= nuations On Sun, 8 Aug 2021, 3:29 pm Arvydas Silanskas via Kawa, wrote: > I merged and got the original code mostly working (leaving optimization > refactoring for later), but I ran into one major issue when creating > benchmarks. It seems calling kawa from java gets conceptually broken if > kawa classes are used directly. New call/cc requires top level handling > loop, which gets bypassed if I instantiate and use directly, like > > ``` > var foo =3D (FooInterface) Class.forName("Foo").newInstance(); > foo.bar(); > ``` > > where FooInterface is an interface written in java, and Foo is a class > created by `define-simple-class` on kawa side which specifies said > interface as one of its supers. > > * Am I using the recommended approach for java -> kawa interaction? > * If yes to the first question, do we strongly care that this type of > calling gets broken as a compromise? After all the (optionally enabled, b= y > default disabled) full continuations will weaken interop anyway, so maybe > this is not worth trying to save. I'm not certain what a fix would be, > maybe some sort of custom equivalent to Class.forName, which would return= a > proxied class with the handling loop attached to the methods. > * The points about using CPStyle / CALL_WITH_TAILCALLS from what I can > understand are purely regarding optimizations, right? Or do you think tha= t > refactored code using those approaches would also solve the problem above= ? > > > 2021-06-10, kt, 02:27 Per Bothner ra=C5=A1=C4=97: > > > > > > > On 6/9/21 2:04 AM, Arvydas Silanskas wrote: > > > Has anyone taken up on this? If not, I'll give it a try. > > > > As far as I know, nobody has stepped up, or is working in this. > > Great if you want to step up. > > > > Do read my previous message carefully - though note that > > 'usingSPSStyle' should be 'usingCPStyle'. > > -- > > --Per Bothner > > per@bothner.com http://per.bothner.com/ > > > >