PythonFrontend.FFI
This file is about translating Python3.8 code
objects into an OCaml representation. Some interesting readings:
module Error : sig ... end
module Constant : sig ... end
module Code : sig ... end
module Instruction : sig ... end
val from_string :
source:string ->
filename:string ->
(Code.t, Error.t) IStdlib.IStd.result
Compiles the python program describes by source
into a Code.t
object
val from_file :
is_binary:bool ->
string ->
(Code.t, Error.t) IStdlib.IStd.result
Generates a Code.t
object from a file. If the file is a source file, the builtin compile
from Python is called to generate the bytecode. If the file is already a bytecode file, it is used right away using the Python module Marshal