Replies: 1 comment
-
Hmm, just another idea to put out there: maybe you could import wasm functions using a special const foo = Porffor.importFunction('example', 'foo', (i32, f64) => [ i32, i32 ]);
const [ x, y ] = foo(2, 3.5); So essentially write a "template" function that tells porffor how the import should look like without requiring something like typescript. Even though this is kinda "syntax exploitation", I think this is an okay approach since there are other places where syntax has special meaning (e.g. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
For #131, we likely want to add support for handling external imports and exports. In my mind, any export statements should be exported in Wasm as well.
But, for import statements it's less cut and dry, my main thought was to use a special
wasm:imports
url which could import anything that the host environment defined.Something like this:
But, do we want first class support for any language's files? My immediate thought is C, because of
2c
but shipping a C parser and C preprocessor seems a little much for the project.Also, what should the user interface look like for this? How should someone define Porffor imports? An IDL? Some JS interface? Etc.
Beta Was this translation helpful? Give feedback.
All reactions