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

[FEATURE REQUEST] Use more precise types to eliminate some casts #114

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

[FEATURE REQUEST] Use more precise types to eliminate some casts #114

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

Comments

@vouillon
Copy link
Collaborator

Since we are using a uniform representation for values, we are making a lot of casts to recover a more precise type.

We should use a more precise type for the function environments to avoid some of these casts. The return type of functions could be refined as well.

Binaryen is probably refining the type of global variables already, so there is probably not much to gain there.

One could give a more precise type to runtime primitives. Wasm_of_ocaml would parse the runtime and insert appropriate casts in the generated code when needed. For instance:

(func (export "caml_array_append") (param $a1 (ref $block)) (param $a2 (ref $block)) (result (ref $block)))

It should be possible to refine the type of the parameters of some functions, when all their call sites are known.

@vouillon vouillon added the enhancement New feature or request label Oct 24, 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