Skip to content

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

@vouillon

Description

@vouillon

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions