A comparison of how computational effects and handlers are implemented in various programming languages.
Shell
147
80 commits
updated Mar 29, 2019
A collection of examples demonstrating programming with effects and handlers in various programming languages.
Each example instance should be self-contained.
Each example should demonstrate one aspect of effectful programming. This does not mean it has to be simple.
In the naming of making comparisons possible, different implementations of a single example should do the same thing as far as that is possible. For instance, if there are two ways to implement an effect, e.g., state using the usual monad and state using parametrized effects, then there should be two examples which are identical, except for the implementation. If you feel that the implementation is unnatural, please comment on this, but still do it.
Do not print things out in examples that do not call for printing. Instead, just compute whatever needs to be computed and store the results in top-level values. Many languages will show the values anyhow, and that is as good as printing.
All folder names are in lower case, with words separated by dashes, e.g.,
cooperative-threads, multicore-ocaml, algol-68.
The repository contains examples in the examples folder, with a subfolder
examples/example-x for each "Example X", and further containing:
README.md contains a general description of the example
language-y contains the example implemented in "Language Y", which further
contains:
README.md contains further comments on the language
implementation of the example,Makefile whose target all runs all the source codeTo add a new programming language My Language, follow these steps:
my-language.my-language as
the section name. Please provide links to the language home page and
installation instructions.To add a completely new example, follow these steps:
example-x.examples/example-x that will contain the example
and put in it README.md with a general description of the example. Please
follow the format of existing example descriptions.To implement an example instance of example-x in language-y, create
examples/example-x/language-y and populate it, following the repository
structure guidelines.
You may show several variants of the example. We recommend that you put them in
separate files, comment on them on the README.md file, and clearly mark one of
the examples as the main one. The main example is the one that people should
look at first.
If something cannot be naturally implemented in your language, we want to know
about it! Create the folder examples/example-x/language-y and put in it
README.md which explains what the problem is.
You may add a partial, simplified, or modified implementation, in which
case you should explicitly describe the changes you made in README.md.
Yes, we strongly encourage sharing and cooperation.
An alphabetically ordered list of the languages used in the examples. The section name must match the folder name used for that language.
effThe Eff programming language can be installed through OPAM, compiled from source code, or run in a browser.
To run Eff code contained in a file example.eff, run from the command line:
eff example.eff
You can also run make in the example directory and it will run all examples for you.
frankInstall Frank from the Frank GitHub repository. To run
a Frank program contained in a file example.fk, run from the command line:
frank example.fk
koka
Koka (meaning "effective" in Japanese) can be installed from the Koka Github repository. It is best to clone the repository next to the rosetta repository as the make files assume the Koka binary is located there, e.g. from the same directory do:
> git clone https://github.com/effect-handlers/effects-rosetta-stone.git
> git clone https://github.com/koka-lang/koka.git
multicore-ocamlMulticore OCaml can be installed through OPAM:
$ opam remote add multicore https://github.com/ocamllabs/multicore-opam.git
$ opam switch 4.06.1+multicore
The participants of Dagstuhl seminar Algebraic effect handlers go mainstream have initiated this repository of examples that show how to program with algebraic effects and handlers in various languages.
Shell
96.8%
Makefile
3.2%
A comparison of how computational effects and handlers are implemented in various programming languages.
Shell
147
80 commits
updated Mar 29, 2019
A collection of examples demonstrating programming with effects and handlers in various programming languages.
Each example instance should be self-contained.
Each example should demonstrate one aspect of effectful programming. This does not mean it has to be simple.
In the naming of making comparisons possible, different implementations of a single example should do the same thing as far as that is possible. For instance, if there are two ways to implement an effect, e.g., state using the usual monad and state using parametrized effects, then there should be two examples which are identical, except for the implementation. If you feel that the implementation is unnatural, please comment on this, but still do it.
Do not print things out in examples that do not call for printing. Instead, just compute whatever needs to be computed and store the results in top-level values. Many languages will show the values anyhow, and that is as good as printing.
All folder names are in lower case, with words separated by dashes, e.g.,
cooperative-threads, multicore-ocaml, algol-68.
The repository contains examples in the examples folder, with a subfolder
examples/example-x for each "Example X", and further containing:
README.md contains a general description of the example
language-y contains the example implemented in "Language Y", which further
contains:
README.md contains further comments on the language
implementation of the example,Makefile whose target all runs all the source codeTo add a new programming language My Language, follow these steps:
my-language.my-language as
the section name. Please provide links to the language home page and
installation instructions.To add a completely new example, follow these steps:
example-x.examples/example-x that will contain the example
and put in it README.md with a general description of the example. Please
follow the format of existing example descriptions.To implement an example instance of example-x in language-y, create
examples/example-x/language-y and populate it, following the repository
structure guidelines.
You may show several variants of the example. We recommend that you put them in
separate files, comment on them on the README.md file, and clearly mark one of
the examples as the main one. The main example is the one that people should
look at first.
If something cannot be naturally implemented in your language, we want to know
about it! Create the folder examples/example-x/language-y and put in it
README.md which explains what the problem is.
You may add a partial, simplified, or modified implementation, in which
case you should explicitly describe the changes you made in README.md.
Yes, we strongly encourage sharing and cooperation.
An alphabetically ordered list of the languages used in the examples. The section name must match the folder name used for that language.
effThe Eff programming language can be installed through OPAM, compiled from source code, or run in a browser.
To run Eff code contained in a file example.eff, run from the command line:
eff example.eff
You can also run make in the example directory and it will run all examples for you.
frankInstall Frank from the Frank GitHub repository. To run
a Frank program contained in a file example.fk, run from the command line:
frank example.fk
koka
Koka (meaning "effective" in Japanese) can be installed from the Koka Github repository. It is best to clone the repository next to the rosetta repository as the make files assume the Koka binary is located there, e.g. from the same directory do:
> git clone https://github.com/effect-handlers/effects-rosetta-stone.git
> git clone https://github.com/koka-lang/koka.git
multicore-ocamlMulticore OCaml can be installed through OPAM:
$ opam remote add multicore https://github.com/ocamllabs/multicore-opam.git
$ opam switch 4.06.1+multicore
The participants of Dagstuhl seminar Algebraic effect handlers go mainstream have initiated this repository of examples that show how to program with algebraic effects and handlers in various languages.
Shell
96.8%
Makefile
3.2%