OCaml runtimes Last updated Feb 11, 2025
Overview
What is a "runtime"?
You can see how the runtimes are linked by passing -verbose
.
The standard distribution comes with the following libraries:
Native
-
libasmrun.a
- the standard runtime library -
libasmrund.a
- debug runtime -
libasmruni.a
- instrumented runtime -
libasmrun_pic.a
- undocumented -
libasmrun_shared.so
- undocumented
Bytecode
-
libcamlrun.a
- the standard runtime library -
libcamlrund.a
- debug runtime -
libcamlruni.a
- instrumented runtime -
libcamlrun_pic.a
- undocumented -
libcamlrun_shared.so
- undocumented
In addition to the runtime libraries listed above, the standard distribution includes similar variations of the VM (interpreter):
I think this just means that the interpreter was linked with one of the libs listed above, but I’m not sure. |
Debug runtime
-
-runtime-variant d
works for all four compilers?
For bytecode executables, running with ocamlrund
has the same effect?
Instrumented runtime
-
-runtime-variant i
Manual:
-
prior to 5.0.0: Runtime tracing with the instrumented runtime (Chapter 23 in Manual version 4.14; chapter numbering may differ in previous versions.)
-
5.0.0 introduced "runtime events" so the chapter title changed: Chapter 25: Runtime tracing with runtime events