Discussion:
First-class continuations in Kawa
Duncan Mak
2018-01-20 00:48:27 UTC
Permalink
Hello,

I came across Andrea Bernardini's thesis called First-Class
Continuations on the Java Virtual Machine: An Implementation within
the Kawa Scheme Compiler just the other day.

https://www.politesi.polimi.it/bitstream/10589/108685/3/2015_07_Bernardini.pdf

What happened to that work, was it integrated into the mainline release of Kawa?

Thanks!
--
Duncan.
Per Bothner
2018-01-20 06:46:49 UTC
Permalink
Post by Duncan Mak
Hello,
I came across Andrea Bernardini's thesis called First-Class
Continuations on the Java Virtual Machine: An Implementation within
the Kawa Scheme Compiler just the other day.
https://www.politesi.polimi.it/bitstream/10589/108685/3/2015_07_Bernardini.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 recent 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 behavior. 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 continuations based on
switch statements. (Each continuation point would be associated with an index,
and each function would start with a switch statement with jumps to 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
***@bothner.com http://per.bothner.com/
Duncan Mak
2018-01-20 16:06:16 UTC
Permalink
Looks interesting.

Is the work contained in only these two commits?

https://gitlab.com/kashell/Kawa/commit/a8e678ebf7216e9fad9238e0b1c2442ea371c63c
https://gitlab.com/kashell/Kawa/commit/f4228b57936de5a84dba0afcfac54196bec86fa4


Duncan.
Post by Per Bothner
Post by Duncan Mak
Hello,
I came across Andrea Bernardini's thesis called First-Class
Continuations on the Java Virtual Machine: An Implementation within
the Kawa Scheme Compiler just the other day.
https://www.politesi.polimi.it/bitstream/10589/108685/3/2015_07_Bernardini.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 recent 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 behavior. 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 continuations based on
switch statements. (Each continuation point would be associated with an index,
and each function would start with a switch statement with jumps to 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
--
Duncan.
Andrea Bernardini
2018-01-20 23:20:52 UTC
Permalink
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 in
a GitLab fork so it doesn't get lost.

Andrea
Post by Duncan Mak
Looks interesting.
Is the work contained in only these two commits?
https://gitlab.com/kashell/Kawa/commit/a8e678ebf7216e9fad9238e0b1c2442ea371c63c
https://gitlab.com/kashell/Kawa/commit/f4228b57936de5a84dba0afcfac54196bec86fa4
Duncan.
Post by Per Bothner
Post by Duncan Mak
Hello,
I came across Andrea Bernardini's thesis called First-Class
Continuations on the Java Virtual Machine: An Implementation within
the Kawa Scheme Compiler just the other day.
https://www.politesi.polimi.it/bitstream/10589/108685/3/2015_07_Bernardini.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 recent 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 behavior. 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 continuations based on
switch statements. (Each continuation point would be associated with an index,
and each function would start with a switch statement with jumps to 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
--
Duncan.
Andrea Bernardini
2018-02-21 00:21:23 UTC
Permalink
Hi All,
Regarding delimited continuations, you can see the needed changes here
https://gitlab.com/andrebask/Kawa/compare/callcc...delimited-continuations

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
Post by Andrea Bernardini
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 in
a GitLab fork so it doesn't get lost.
Andrea
Post by Duncan Mak
Looks interesting.
Is the work contained in only these two commits?
https://gitlab.com/kashell/Kawa/commit/a8e678ebf7216e9fad9238e0b1c2442ea371c63c
https://gitlab.com/kashell/Kawa/commit/f4228b57936de5a84dba0afcfac54196bec86fa4
Duncan.
Post by Per Bothner
Post by Duncan Mak
Hello,
I came across Andrea Bernardini's thesis called First-Class
Continuations on the Java Virtual Machine: An Implementation within
the Kawa Scheme Compiler just the other day.
https://www.politesi.polimi.it/bitstream/10589/108685/3/2015_07_Bernardini.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 recent 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 behavior. 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 continuations based on
switch statements. (Each continuation point would be associated with an index,
and each function would start with a switch statement with jumps to 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
--
Duncan.
Duncan Mak
2018-02-22 00:37:27 UTC
Permalink
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.
Post by Andrea Bernardini
Hi All,
Regarding delimited continuations, you can see the needed changes here
https://gitlab.com/andrebask/Kawa/compare/callcc...delimited-continuations
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
Post by Andrea Bernardini
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 in
a GitLab fork so it doesn't get lost.
Andrea
Post by Duncan Mak
Looks interesting.
Is the work contained in only these two commits?
https://gitlab.com/kashell/Kawa/commit/a8e678ebf7216e9fad9238e0b1c2442ea371c63c
https://gitlab.com/kashell/Kawa/commit/f4228b57936de5a84dba0afcfac54196bec86fa4
Duncan.
Post by Per Bothner
Post by Duncan Mak
Hello,
I came across Andrea Bernardini's thesis called First-Class
Continuations on the Java Virtual Machine: An Implementation within
the Kawa Scheme Compiler just the other day.
https://www.politesi.polimi.it/bitstream/10589/108685/3/2015_07_Bernardini.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 recent 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 behavior. 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 continuations based on
switch statements. (Each continuation point would be associated with an index,
and each function would start with a switch statement with jumps to 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
--
Duncan.
--
Duncan.
Loading...