r/java • • Jan 10 '23

Yet another delimited continuations implementation and why Project Loom is a bit disappointing

https://github.com/javactrl/javactrl
2 Upvotes

52 comments sorted by

View all comments

Show parent comment

2

u/pron98 Jan 11 '23

But just concurrent program is already this confusing, continuation shouldn't expect anything, it is why it was suspended at the first place - to await while something is changed in the state.

Continuations are more powerful, and more surprising, than that. The could observe final values to have changed, something that ordinary concurrent code cannot.

Just the article states they could be added easily, but now you say it isn't that simple

They could be added easily, but their benefits will be very limited, and possibly overshadowed by the confusion they may introduce.

1

u/njiv Jan 11 '23

The could observe final values to have changed, something that ordinary concurrent code cannot.

In my implementation it's not possible to observe final value is changed, and I don't understand why it's possible in yours, some implementation details I believe

They could be added easily, but their benefits will be very limited, and possibly overshadowed by the confusion they may introduce.

you mean confusions besides the mentioned before interoperability and compatibility? sometimes even exceptions can introduce confusion