There’s a dissertation Rhiger 2001 that has a chapter dictated to a simple combinator style interface to runtime byte code generation for OCaml, although it can be recognized that data types defined under
ocaml/bytecomp are used to actually generate the byte code, the papar didn’t mention how to execute the generated code.
Is there anything I can reference on how to make use of the OCaml compiler to “poke” and execute byte code when running an OCaml program? I guess today we can probably write a
.cmo and load as dynamic library, but I don’t think this feature was present at 2001, is there a more direct approach?
I already noticed the realworldocaml site has some infos on how to understand the byte code instructions, but seems it does not cover much about the compiler infrastructure.