Skip to content

ENV module aliasing #943

@guybedford

Description

@guybedford

I'm interested in compiling C to WASM in a way that allows me to alias the 'ENV' import for external functions ((import "env" "external_func"...) output in wast).

The natural thing I'd like to be able to do is to supply a function attribute in C that associates the external function with an import module name in WASM - something like:

void custom_logger(int val) __attribute__ ((import, name ("./custom-logger.wasm")));

This repo seems to define the "env" as being the default import, along with an importMap system, although I couldn't tell how that could be configured.

Does something similar to this already exist, or does work along these lines sound like a worthwhile effort to pursue through the toolchain?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions