gen_js_api aims at simplifying the creation of OCaml bindings for
compiler, although other ways
the same binding definitions (for instance,
or direct embedding of a JS engine in a native OCaml application).
gen_js_api is based on the following ideas:
and the tool generates the actual binding code with a combination
of implicit conventions and explicit annotations.
The generated binding code takes care of translating values between
All syntactic processing is done by authors of bindings: the client
code is normal OCaml code and does not depend on custom syntax nor
on JS-specific types.
gen_js_api can be used in two complementary ways:
Generating .ml implementations from annotated .mli interfaces,
in order to create the code for stub libraries.
As a ppx preprocessor on implementations to define local
libraries created with gen_js_api:
Some ad hoc test to exercise various features.
An example of a self-contained program, a simple
calculator, implementing local .bindings
js_of_ocaml: The compiler
and runtime system on which gen_js_api relies. (Note: gen_js_api
doesn't depend on js_of_ocaml's OCaml library, nor on its language
goji: A DSL to describe OCaml
gen_js_api has been created by LexiFi for porting a web application
This gen_js_api package is licensed by LexiFi under the terms of the
See see Changelog