Closed TyOverby closed 1 year ago
Last time I looked into this [some quite time ago] compiler-libs API was still hard to use to embed the compiler so you could produce a .cmo
which can then be translated. [on the file .cmo to .js did work fine and we used this to load Coq's plugins in jsCoq]
I think @gasche mentioned that work was underway to improve the use of "ocamlc as a library", but I'm not sure what the current status is.
@TyOverby, have you made any discovery ? Have you looked at https://github.com/ocaml-sf/learn-ocaml ?
I haven't tried in a very long time; @pmwhite did some experimentation a big ago though, did you use the toplevel, or did you find a way to get it to compile files like normal?
@TyOverby I was indeed using the toplevel, sadly. I believe I was doing this experimentation around the time this issue was originally created, so it seems likely that it was motivated by what I was doing.
reopen if still needed
@hhugo I would be very interested in being able to use something like this - especially if it was along the lines of using something like irmin as a repository, compiling ocaml -> javascript, and finally being able to launch html in the browser using the repository. An added benefit is that the repo could be exported. irmin-indexeddb is available!
The examples for the jsoo_toplevel are very compelling! However, for an application that I'm developing, I'm not interested in a top-like interface, but rather that behaves more like a regular on-disk compilation:
However, some aspects of the toplevel experience are nice, like the guarantee that the code being run uses the same libraries as the code running it.
Is this style of interaction with jsoo possible/easy? Where would one look for the APIs to make such a program posible?