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

Add 'Loader' example #1247

Closed
wants to merge 6 commits into from
Closed

Add 'Loader' example #1247

wants to merge 6 commits into from

Conversation

dcodeIO
Copy link
Member

@dcodeIO dcodeIO commented May 1, 2020

As promised on the Discord, I've made an example covering the very basics of utilizing the loader.

  • Example 1: Passing a string from WebAssembly to JavaScript.
  • Example 2: Passing a string from JavaScript to WebAssembly.
  • Example 3: Calling JavaScript imports with WebAssembly strings.
  • Example 4: Passing an array from WebAssembly to JavaScript.
  • Example 5: Passing an array from JavaScript to WebAssembly.
  • Example 6: WebAssembly arrays of WebAssembly strings.
  • Example 7: Using custom classes.

This should give everyone interested a quick start with recipes to perform the most common tasks. As usual, my perspective might be a little trees in the woods here, so let me know where I am assuming something that isn't trivial :)

@MaxGraey
Copy link
Member

MaxGraey commented May 1, 2020

I guess will be great also add 7th example which demonstrate how do something like this:

class Complex {
   re: f64
   im: f64
};

export function getComplexMatrix(): Complex[][] {
  ...
}

@dcodeIO
Copy link
Member Author

dcodeIO commented May 1, 2020

Initially considered making another example like "Loader Advanced", but I think you are right and I should just add it here, as there aren't a lot of advanced custom classes scenarios anyway.

@dcodeIO dcodeIO changed the title Add 'Loader Basics' example Add 'Loader' example May 1, 2020
@MaxGraey
Copy link
Member

MaxGraey commented May 3, 2020

Do you think move it to AssemblyScript/examples repo?

@dcodeIO
Copy link
Member Author

dcodeIO commented May 3, 2020

Yeah, figured that a separate repo makes sense with increasing example count. Loader example is here: https://github.com/AssemblyScript/examples/tree/master/loader

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

Successfully merging this pull request may close these issues.

2 participants