You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: doc/dev/manual/effects.wiki
+11-21Lines changed: 11 additions & 21 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,14 +11,13 @@ The analysis is especially effective on monomorphic code. It is not so effective
11
11
We hope to improve on this by trying alternative compilation
12
12
strategies.
13
13
14
-
An alternative CPS transform is provided under the {{--effects=double-translation}} option. It keeps a direct-style version of the transformed functions in addition to the CPS version. The choice of running the CPS version is delayed to run time. Since CPS code is usually slower, this can avoid degradations. In addition, one can ensure that some code is run in direct style by using {{Jsoo_runtime.Effect.assume_no_perform}}. A caveat is that Dune does not know about {{--effects=double-translation}} yet and may try to link together files built with {{--enable=double-translation}} and files built with only {{--enable=effects}}, which gives an error. A work-around is to disable separate compilation by using the option {{(js_of_ocaml (compilation_mode whole_program))}}.
14
+
An alternative CPS transform is provided under the {{{--effects=double-translation}}} option. It keeps a direct-style version of the transformed functions in addition to the CPS version. The choice of running the CPS version is delayed to run time. Since CPS code is usually slower, this can avoid degradations. In addition, one can ensure that some code is run in direct style by using {{{Jsoo_runtime.Effect.assume_no_perform}}}.
15
15
16
16
=== Dune integration ===
17
17
18
-
We're still working on dune support for compiling js_of_ocaml programs
19
-
with effect handlers enabled.
18
+
Dune is aware of the {{{--enable effects}}} option. So, you can just add it to the Js_of_ocaml flags {{{(js_of_ocaml (flags ...))}}} wherever you want to use it.
20
19
21
-
For now, here are two possible setups.
20
+
We're still working on dune support for the {{{--effects}}} option. For now, here are two possible setups.
22
21
23
22
=== Whole dune workspace setup ===
24
23
@@ -27,8 +26,8 @@ Put the following in a {{{dune}}} (or {{{dune-workspace}}}) file at the root of
0 commit comments