Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[fl_dynload] Allow overriding low-level module loader #81

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Commits on Sep 27, 2024

  1. [fl_dynload] Allow overriding low-level module loader

    Before this patch, `Fl_dynload.load_packages` will unconditionally
    call `Dynlink.loadfile` to load each particular compilation unit.
    
    This works fine in almost all our scenarios, however when compiling
    Web Workers with JSOO, we have found that `Dynlink.loadfile` takes a
    very long time as it will compile `.cma` files to `.js`.
    
    In the case of jsCoq and `coq-lsp` this compilation process is too
    heavy. Prior to us using `findlib`, we used to trap all calls from Coq
    to `Dynlink.loadfile`, and we used a pre-compiled `.js` version which
    was much much faster.
    
    This patch makes it possible for users of `Fl_dynload.load_packages`
    to override the call to `Dynlink.loadfile` as to for example implement
    the above cache setup, or to do other kinds of instrumentations.
    ejgallego committed Sep 27, 2024
    Configuration menu
    Copy the full SHA
    bd9cb3a View commit details
    Browse the repository at this point in the history