Skip to content

Commit d4039d9

Browse files
committed
Add docs for chez-exe
1 parent 0fec867 commit d4039d9

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

docs/source/backends/chez.rst

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,3 +71,32 @@ Chez Directives
7171
::
7272

7373
$ idris2 --codegen chez --directive extraRuntime=/path/to/extensions.scm -o main Main.idr
74+
75+
Making a freestanding executable
76+
================================
77+
78+
It's possible to embed the Chez Scheme system and the built Idris2 program into a freestanding executable with `chez-exe <https://github.com/gwatt/chez-exe>`.
79+
80+
* Build and install the ``compile-chez-program-tool`` by running the
81+
configuration script and then make:
82+
83+
::
84+
85+
$ scheme --script gen-config.ss --bootpath <bootpath>
86+
87+
where ``<bootpath`` is the path to where the Chez Scheme bootfiles (``petite.boot`` and ``scheme.boot``) and ``scheme.h`` are. More
88+
configuration is described in the chez-exe installation instructions.
89+
90+
* Invoke ``compile-chez-program``:
91+
92+
::
93+
94+
$ compile-chez-program --optimize-level 3 build/exec/my_idris_prog_app/my_idris_prog.ss
95+
96+
Note that it can only use the ``.ss``-file and not the ``.so``-file. To
97+
embed the full Chez Scheme system including the compiler add the ``--full-chez`` option.
98+
99+
* The finished executable still requires the libidris_support shared
100+
library. It's possible to also eliminate that dependency by linking with
101+
it statically.
102+

0 commit comments

Comments
 (0)