Answer the question
In order to leave comments, you need to log in
Continuations and coroutines in Scala
My question is about these two concepts (well, so that there are no misunderstandings): continuation and coroutine .
I'm aware of scala's limited continuation plugin, but it may be out of date by 2.11, and is now out of support for over a year and has unfixed bugs. In scala-internals, Martin Odersky suggested that you should consider implementing continuations with macros, as right now they don't have the resources to support the plugin, and indeed it has fundamental flaws.
Meanwhile, these two concepts are highly desired by the community. And for example jetty or netty (I don't remember) uses apache's java continuation implementation that works with bytecode. And there are tests that show a 10x performance gain over a non-continued implementation.
In this regard, I wonder if any work is being done in this direction? Maybe someone heard. Or something already implemented in some libraries.
The thing is, I have ideas on how to implement bounded continuations and coroutines in scala using macros. Moreover, in terms of ease of use, coroutines will not be inferior to analogues from python or php.
The problem is that I haven't learned enough about macros yet. Therefore, implementation may take several months. And by that time it may turn out that "everything has already been done before us."
In general, this question is about the appropriateness of this work as a whole and about the possibility of discussing the concepts with someone, so that in the future it would be possible to propose a similar implementation for inclusion in the scala standard library, since my competence may not be enough to meet the standards accepted in scala itself.
ps: I forgot to say that, in theory, with the help of continuations, it will be possible to make restarts by type, as in ruby
Answer the question
In order to leave comments, you need to log in
There is also http://docs.scala-lang.org/sips/pending/async.html (and, accordingly, https://github.com/scala/async ). You probably saw it, you just didn't mention it in the question. These are not exactly continuations, but as far as I understand, the transformation performed by this macro can also be used as the basis for them.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question