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

Take Flambda2 as input #97

Open
vouillon opened this issue Oct 4, 2024 · 0 comments
Open

Take Flambda2 as input #97

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 should investigate whether we can take the Flambda2 intermediate code as input, beside bytecode.

This seems complicated with js_of_ocaml. Indeed, Flambda2 has explicit closures which may be accessed from outside the function body, due to inlining. But maybe it is possible to eliminate most of these closures, turning them into regular JavaScript functions. This should not be a problem with wasm_of_ocaml, which emits explicit closures at the end anyway. But can we then avoid too much code duplication, or having wasm_of_ocaml diverge from js_of_ocaml?

There will be some issues with unboxed types. We currently use arrays for heap-allocated OCaml values. If we always knew the exact shape of the values when accessing them, we may be able to use structs instead. But I’m not sure this information is still available.

@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