Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
hhugo committed Feb 3, 2025
1 parent cc49021 commit 850c2c4
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 33 deletions.
2 changes: 1 addition & 1 deletion manual/effects.wiki
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Js_of_ocaml supports effect handlers with the {{{--enable=effects}}}
flag. This is based on partially transforming the program to
continuation-passing style.
As a consequence, [[tailcall|tail calls]] are also fully optimized.
As a consequence, [[tailcall|tail calls]] could be fully optimized (if CPS transformed).
This is not the default for now since the generated code can be slower,
larger and less readable.
The transformation is based on an analysis to detect parts of the code that cannot involves effects and keep it in direct style.
Expand Down
2 changes: 1 addition & 1 deletion manual/linker.wiki
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,6 @@ function primitive_name(..){
the returned value of the primitive; when no annotation is provided,
the linker assumes that the primitive may have side-effects.
* **{{{//Requires}}}** is used if other primitives need to be loaded first
* **version_constraint** looks like "{{{< 4.12.0}}}"
* **version_constraint** looks like {{{< 4.12.0}}}
* **{{{//Version}}}** is optional and is rarely used
All JavaScript code following a **{{{//Provides}}}** annotation is associated to this annotation, until the next **{{{//Provides}}}** annotation.
56 changes: 28 additions & 28 deletions manual/options.wiki
Original file line number Diff line number Diff line change
@@ -1,36 +1,36 @@
= Main Command-Line options

|= Option name |= Description |
| --version | Display the version of the compiler |
| -o <file> | Set the output filename to <file> |
| --source-map | Generate sourcemap |
| --opt {1,2,3} | Set the compilation profile
(default 1). See **Optimization**
section below. |
| --pretty | Pretty print javascript output |
| --target-env | Build javascript for the requested
environment (default "isomorphic").
Isomorphic javascript runs in both the
browser & nodejs. "nodejs" & "browser"
options bundle less javascript, but
drop support for APIs incompatible with
the selected runtime. |
| --no-inline | Disable code inlining |
| --debug-info | Output debug information |
| -I dir | Add <dir> to the list of
include directories |
| --file file[:target] | Register <file> to the pseudo filesystem
and choose the destination <target>. The
<target> can be a directory or a file
(default /static/) |
| --enable <option> | Enable option <option> |
| --disable <option> | Disable option <option> |
|= Option name |= Description |
| {{{--version}}} | Display the version of the compiler |
| {{{-o <file>}}} | Set the output filename to <file> |
| {{{--source-map}}} | Generate sourcemap |
| {{{--opt {1,2,3} }}} | Set the compilation profile
(default 1). See **Optimization**
section below. |
| {{{--pretty}}} | Pretty print javascript output |
| {{{--target-env}}} | Build javascript for the requested
environment (default {{{isomorphic}}}).
Isomorphic javascript runs in both the
browser & nodejs. {{{nodejs}}} & {{{browser}}}
options bundle less javascript, but
drop support for APIs incompatible with
the selected runtime. |
| {{{--no-inline}}} | Disable code inlining |
| {{{--debug-info}}} | Output debug information |
| {{{-I dir}}} | Add <dir> to the list of
include directories |
| {{{--file file[:target]}}} | Register <file> to the pseudo filesystem
and choose the destination <target>. The
<target> can be a directory or a file
(default /static/) |
| {{{--enable <option>}}} | Enable option <option> |
| {{{--disable <option>}}} | Disable option <option> |

=Optimizations
* For Debugging: "--pretty --no-inline --debug-info" + eventually "--disable staticeval --disable share"
* For Production: "--opt 3". It minimize the generated javascript by applying
* For Debugging: {{{--pretty --no-inline --debug-info}}} + eventually {{{--disable staticeval --disable share}}}
* For Production: {{{--opt 3}}}. It minimize the generated javascript by applying
various optimizations until a fix-point is reached
==List of option to "--disable" or "--enable"
==List of option to {{{--disable}}} or {{{--enable}}}

|= Option name |= Default |= Description |
| pretty | false | Pretty print the javascript output |
Expand Down
6 changes: 3 additions & 3 deletions manual/separate-compilation.wiki
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ separate compilation with some differences.

The general idea is generate one JavaScript file containing the
JavaScript runtime and JavaScript files for every compilation unit (or
library) needed to run the program. One can then link (or
"concatenate") all individual JavaScript files together, respecting
the order induced by dependencies, into a single JavaScript file.
library) needed to run the program. One can then link all individual
JavaScript files together, respecting the order induced by
dependencies, into a single JavaScript file.

=== 1. Build the runtime

Expand Down

0 comments on commit 850c2c4

Please sign in to comment.