From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qk1-x736.google.com (mail-qk1-x736.google.com [IPv6:2607:f8b0:4864:20::736]) by sourceware.org (Postfix) with ESMTPS id D1AC8384B801 for ; Sat, 1 May 2021 18:46:06 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org D1AC8384B801 Received: by mail-qk1-x736.google.com with SMTP id q127so1485240qkb.1 for ; Sat, 01 May 2021 11:46:06 -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=fy9Q6G5646f/K3hukLc5uWySx2dzS0fu6tHcGk3l0Po=; b=CsY10MINfW2u6PwvO2SRd+flgcwP9RWhzjU48xl3uXdE+U1ooFRoq6EtsFRUCpTLB6 9t/TLpaRViLvZrodutGU/8qmad87Zuq8Osj5Nv6fAZOMxYfT3darutvW2CvPll7Iy8nQ g8lxaBHy+nyj/PtvnJwIz3k3cUlXO3BlDKf4WyvDHb/IN4yZYqFBQ4E65YEI6XkYjaeK 3E+iCLTGJJ9PADWZX8++eKRwR1XtQ3W88uwZSwmUmt1LKlNm1g1wxHTAQB6Zsa5ZSmpZ hxlPUY7esm45oLuPbpdyni+pcYr7/XpIFsLENmKlO5oiOS0aVxeH8zcVJF+YM7JVSkTP h/8Q== X-Gm-Message-State: AOAM532aiyh6Bca+xAeNw1tHriHmR6+02x8PcrIebaecm2zdxl2G7hZX GOkttD/Zimzm1shfKuu0Y6oiUFHnc3RA/fARD+w= X-Google-Smtp-Source: ABdhPJwRklUg73GDHJm+j7UNUIeTwAShr/ISD2jp4th7OAe0imW7qqkaLDJW6J7xTh/yM8Cfoc8wNqvPAPHmGxdaO2o= X-Received: by 2002:a05:620a:1233:: with SMTP id v19mr11501632qkj.418.1619894766394; Sat, 01 May 2021 11:46:06 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Arvydas Silanskas Date: Sat, 1 May 2021 21:45:59 +0300 Message-ID: Subject: Re: First-class continuations in Kawa To: Duncan Mak Cc: Andrea Bernardini , 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.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) 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: Sat, 01 May 2021 18:46:09 -0000 After skimming through the code, I don't see why not? If full continuations are optional and hidden behind a flag, it won't impact the software that cares about performance and has it turned off, and on flip side it will allow more portable r7rs code to be ran on kawa when desired and understanding the cost. Loom looks interesting, but (unless I missed it) doesn't give any sense of when we can expect it to be part of jvm distribution. Arvydas 2021-05-01, =C5=A1t, 20:20 Duncan Mak via Kawa ra=C5= =A1=C4=97: > Hello all, > > I thought of this work last night and was reminded that the PR is still > left hanging after 3 years. > > I wonder if it makes any sense to try to get this merged into the master > branch after all this time. > > There's also the ongoing work from Project Loom at the JDK level: > http://cr.openjdk.java.net/~rpressler/loom/loom/sol1_part1.html and I > wonder how that influences how continuations will be represented in Kawa = in > the future. > > Thoughts? > > > Duncan. > > On Wed, Feb 21, 2018 at 7:37 PM Duncan Mak wrote: > > > Hello Per, > > > > https://gitlab.com/kashell/Kawa/merge_requests/22 should be ready for > > review now. > > > > You mentioned in your first reply that we should "test, evaluate, and > > benchmark it. If it's useful, it should be merged in." - do you have > > any suggestions for how I should proceed to get this merged in? > > > > You also mentioned that there's an idea on an alternative > > implementation technique based on switch statements - could we post > > the notes on https://gitlab.com/kashell/Kawa/issues, and perhaps > > someone else could tackle that? > > > > > > Duncan. > > > > On Tue, Feb 20, 2018 at 7:21 PM, Andrea Bernardini > > wrote: > > > Hi All, > > > Regarding delimited continuations, you can see the needed changes her= e > > > > > > https://gitlab.com/andrebask/Kawa/compare/callcc...delimited-continuation= s > > > > > > Let me know if you are interested in this at all, shouldn't be > > > difficult to add this once Duncan's pull request is merged in. > > > > > > In the same fork there's also a branch with the debugger > > > implementation, however I'm not sure how useful that could be, it was > > > quite experimental > > > > > > Thanks, > > > Andrea > > > > > > On 20 January 2018 at 23:20, Andrea Bernardini > > wrote: > > >> Yep, that's it. The whole work was originally submitted as patch. > > >> > > >> It is also my fault If this was never merged into master. I remember > > >> that I started working on a switch-based variant of my work after > > >> getting some high level suggestions from Per. That turned out to be = a > > >> fair amount of work and I didn't have much time, so I didn't manage = to > > >> put together anything working. > > >> > > >> I also have some working code that I mentioned in my thesis but didn= 't > > >> end up in that patch, as it wasn't well tested. This was mainly for > > >> delimited continuations and for the debugger. I'll share this soon i= n > > >> a GitLab fork so it doesn't get lost. > > >> > > >> Andrea > > >> > > >> On 20 January 2018 at 16:06, Duncan Mak wrote: > > >>> Looks interesting. > > >>> > > >>> Is the work contained in only these two commits? > > >>> > > >>> > > > https://gitlab.com/kashell/Kawa/commit/a8e678ebf7216e9fad9238e0b1c2442ea3= 71c63c > > >>> > > > https://gitlab.com/kashell/Kawa/commit/f4228b57936de5a84dba0afcfac54196be= c86fa4 > > >>> > > >>> > > >>> Duncan. > > >>> > > >>> > > >>> On Sat, Jan 20, 2018 at 1:46 AM, Per Bothner > wrote: > > >>>> On 01/19/2018 04:48 PM, Duncan Mak wrote: > > >>>>> > > >>>>> Hello, > > >>>>> > > >>>>> I came across Andrea Bernardini's thesis called First-Class > > >>>>> Continuations on the Java Virtual Machine: An Implementation with= in > > >>>>> the Kawa Scheme Compiler just the other day. > > >>>>> > > >>>>> > > >>>>> > > > https://www.politesi.polimi.it/bitstream/10589/108685/3/2015_07_Bernardin= i.pdf > > >>>>> > > >>>>> What happened to that work, was it integrated into the mainline > > release of > > >>>>> Kawa? > > >>>> > > >>>> > > >>>> Sorry, no. Andrea's work is available in the 'callcc' branch, but = it > > has not > > >>>> been merged into master. Worse, updates to master have not been > > merged > > >>>> into the callcc branch. > > >>>> > > >>>> It would be useful to at least update the callcc branch with recen= t > > changes, > > >>>> and then test, evaluate, and benchmark it. If it is useful, it > should > > be > > >>>> merged in. > > >>>> Even if it is slow, as long as it doesn't hurt the default behavio= r. > > It is > > >>>> my fault > > >>>> that hasn't been done, but there were always other things to do. > > >>>> > > >>>> Long time ago, I started on another implementation of continuation= s > > based on > > >>>> switch statements. (Each continuation point would be associated > with > > an > > >>>> index, > > >>>> and each function would start with a switch statement with jumps t= o > > the > > >>>> continuation points. Capturing a continuation would essentially be > > saving > > >>>> the > > >>>> corresponding switch index.) Some of that code is still in Kawa, > but > > >>>> commented out. Following up on that idea might be more efficient. > > Which > > >>>> isn't really a good excuse for not merging in Andrea's work. > > >>>> > > >>>> If someone is interested in following up on this work, that would = be > > great. > > >>>> -- > > >>>> --Per Bothner > > >>>> per@bothner.com http://per.bothner.com/ > > >>> > > >>> > > >>> > > >>> -- > > >>> Duncan. > > > > > > > > -- > > Duncan. > > > > > -- > Duncan. >