From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lj1-x22f.google.com (mail-lj1-x22f.google.com [IPv6:2a00:1450:4864:20::22f]) by sourceware.org (Postfix) with ESMTPS id 05B08385802D for ; Sun, 8 Aug 2021 14:29:44 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 05B08385802D Received: by mail-lj1-x22f.google.com with SMTP id h9so19737849ljq.8 for ; Sun, 08 Aug 2021 07:29:43 -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=WRGG8zTCndq0En5CI2qPV7ynfOAP8Xaukye+/pVbzMU=; b=huZZsfVK49344aoIuyd3w14VUVlzGH7Jjj07GJtkUXyUO3EQYQK//QAFcALJoKZQ2D JD0s0Jc32R2xpP9xPbD6IJGSYe98tdpZSbdRtzlx279dJUI7opmDur7Q1BVJSugcH8Z8 AP9o2bO2K6JaNpbAk4o+HAj66h3LriCfLz1lAL9Kj7zZXufXNqwDy2qGNKgzoaNoWMDn lzsk7TIlWQVH1ZP7bAqtSdyw2CpiM7PvG7zZ9wjHqQ+9+OVNoCWBXzmc1pX9ggpM4zvV 8k6iafna4GEO5xbA65jCKcOIMpHtbMoLQwCr1Nz8PoQSj7FRoADId1asvZOc7WJ7rVKm EKMA== X-Gm-Message-State: AOAM533H2cfFiLOu36PL5yrA+sR8rUumg7jpwe9uDYbX3IuXndTOIeGw 2XeyD4gVWoxkAJp8nmegnhJVDBoATWDt1M1f0Rvk/9xcHqc= X-Google-Smtp-Source: ABdhPJztyP16CqKeaHj+eY1oPhvjzugmAYCqzI1+t9OLBaLzyHvj2w7fsm2IX2c/8scYGF+ksmIPE1SypYtZSEaEauo= X-Received: by 2002:a2e:5352:: with SMTP id t18mr12379850ljd.495.1628432982774; Sun, 08 Aug 2021 07:29:42 -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: <666b9a7d-156b-0ee7-e1a1-9409cf0d376f@bothner.com> From: Arvydas Silanskas Date: Sun, 8 Aug 2021 17:29:32 +0300 Message-ID: Subject: Re: First-class continuations in Kawa To: Per Bothner Cc: kawa mailing list X-Spam-Status: No, score=-1.0 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 14:29:45 -0000 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, by 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 that 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/ >