Skip to content

Linking #84

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

Closed
jcampbell05 opened this issue Apr 25, 2018 · 2 comments
Closed

Linking #84

jcampbell05 opened this issue Apr 25, 2018 · 2 comments
Labels

Comments

@jcampbell05
Copy link

I want to use this to link it against a C program, is there a way to do this so a function in my C code can be called from the WASM ?

@dcodeIO
Copy link
Member

dcodeIO commented Apr 25, 2018

At this point you could use a tool like Binaryen's wasm-merge. It essentially resolves the imports of one module to the exports of another. In case plain merging doesn't work, for example because two memory managers get into each other's way, something similar can be achieved by simply using two wasm files, providing the exports of the first as the imports of the second.

There'll be additional choices in the future, for example once DynamicLinking matures. There's also the pending idea to use a module compiled using another toolchain as the "base image" of an AssemblyScript module, basically appending AS-generated code to the base module while using a .d.ts to describe the functionality provided by it (not yet implemented, though, but shouldn't be too hard to get this going).

@dcodeIO
Copy link
Member

dcodeIO commented Jul 10, 2018

Closing this issue for now as it hasn't received any replies recently. Feel free to reopen it if necessary!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants