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

Separate compilation: generate and use cross module information regarding function arity #92

Open
vouillon opened this issue Oct 4, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@vouillon
Copy link
Collaborator

vouillon commented Oct 4, 2024

We could improve the code generated when compiling cmo files if we knew the arity of the functions exported by each module. This would allow to call functions directly rather than going through an helper function which manages currying. When the function is known, one could also export the corresponding Wasm function so that it can be directly accessed without going through the toplevel module and the closure.

In order for this to work with submodules and functors, we need to know which blocks are immutable (see #91). Alternatively, in the case of functors, it might be possible to refine the escape analysis to recognize that a fresh block returned by a function cannot be mutated by other callers.

This is wasm_of_ocaml counterpart to ocsigen/js_of_ocaml/issues/550. @hhugo has written a draft implementation for js_of_ocaml in ocsigen/js_of_ocaml#1594.

@vouillon vouillon added the enhancement New feature or request label Oct 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant