Skip to content

dos65/scala3-coroutines

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Coroutines in Scala 3

This repo is a fork of scala 3 repo: original readme

This is an ongoing research project with the goal to test the limits of continuation-passing style programming in Scala 3 and check the feasibility of developing libraries that are using coroutines, generators, monadic reflection, and other similar constructs.

Status of the implementation

  • Possibility to define own executors
  • Reentrant coroutine state - #5
  • Calling one coroutine from the body of the other - #8
  • Inlining one coroutine in the body of the other
  • Handling of exceptions thrown in coroutine body - #16
  • Opaque coroutine state
  • Composition of coroutine of different kind
  • Execution plan

Syntax elements working correctly inside of coroutines:

  • calls
  • assingments
  • block expressions
  • inlined calls
  • val definitions
  • simple def definitions
  • nested def definitions
  • type definitions
  • lazy val definitions
  • loops - #10
  • ifs - #11
  • match expressions - #12
  • try/catch - #13
  • early return statements - #14
  • throw statements - #15

How to try it

The project can be compiled and tested in the same way as dotty: instructions here.

Examples of executors definitions and coroutines can be found in the continuations directory of run tests. Primitives are located in the standard library and they can be imported from anywhere. Executor definitions must be, on the other hand, pasted into the sources or repl.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages

  • Scala 97.2%
  • Java 1.3%
  • Other 1.5%