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: manual/effects.wiki
+6-10Lines changed: 6 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,20 +1,16 @@
1
1
== Effect handlers ==
2
2
3
3
Js_of_ocaml supports effect handlers with the {{{--enable=effects}}}
4
-
flag. This is based on transformation of the whole program to
4
+
flag. This is based on partially transforming the program to
5
5
continuation-passing style.
6
6
As a consequence, [[tailcall|tail calls]] are also fully optimized.
7
-
This is not the default for now since the generated code is slower,
7
+
This is not the default for now since the generated code can be slower,
8
8
larger and less readable.
9
-
The [[performances|performance impact]] is especially large for code
10
-
that involves a lot of function calls without allocation, since the
11
-
transformation introduces many intermediate continuation
12
-
functions.
13
-
We hope to improve on this by transforming the code only partially to
14
-
continuation-passing style, and by trying alternative compilation
9
+
The transformation is based on an analysis to detect parts of the code that cannot involves effects and keep it in direct style.
10
+
The analysis is especially effective on monomorphic code. It is not so effective when higher-order functions are heavily used ({{{Lwt}}}, {{{Async}}}, {{{incremental}}}).
11
+
We hope to improve on this by trying alternative compilation
15
12
strategies.
16
13
17
-
18
14
=== Dune integration ===
19
15
20
16
We're still working on dune support for compiling js_of_ocaml programs
@@ -63,4 +59,4 @@ Trying to use separate compilation would result in a error while attempting to l
63
59
js_of_ocaml: Error: Incompatible build info detected while linking.
Copy file name to clipboardExpand all lines: manual/overview.wiki
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -79,7 +79,7 @@ functions are optimized:
79
79
* trampolines are used otherwise.
80
80
<<a_manual chapter="tailcall" |More about tail call optimization>>.
81
81
82
-
Effect handlers are fully supported with the {{{--enable=effects}}} flag. This is not the default for now since the generated code is slower, larger and less readable.
82
+
Effect handlers are fully supported with the {{{--enable=effects}}} flag. This is not the default for now since effects are not widely used at the moment and the generated code can be slower, larger and less readable.
83
83
84
84
Data representation differs from the usual one. Most notably,
85
85
integers are 32 bits (rather than 31 bits or 63 bits), which is their
0 commit comments