-
-
Notifications
You must be signed in to change notification settings - Fork 670
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
Compile to JavaScript #838
Comments
Hi @MichaelJCole!
let d = data[i * 3];
ret[i * 2] = ret[i * 2] + f[0]; // body[i] use let d = unchecked(data[i * 3]);
unchecked(ret[i * 2] = ret[i * 2] + f[0]); // body[i] This skip runtime range check and potentially could improve speed About compilation to JavaScript. AssemblyScript don't provide this, but AS code mostly compatible with typescript so you could use original |
The compiler also has an option to emit a JS file by adding |
Hey, this is what I came up with. I'll make a PR for the starter project if you're into that :-) This gulpfile creates these files:
/assembly/tsconfig.json
gulpfile
|
@MichaelJCole |
@MaxGraey hey, I'm wrapping up my current adventure in AssemblyScript These two visualizations - 2d w/ canvas and 3d w/ a-frame use the same simulator running in a Web Worker with AssemblyScript to wasm. They even slightly work on mobile. https://michaeljcole.github.io/n-body-wasm-canvas/ The gulpfile has both rollup for the AssemblyScript loader and asc for the typescript compiler. Mmmmm. Build scripts. Fun times! |
@MichaelJCole Does that AssemblyScript to JavaScript code still work? |
Using the starter project, at webassembly.studio, I can compile an AssemblyScript.ts file to wasm.
Question: How can I compile AssemblyScript.ts to JavaScript?
This is what I have so far:
The text was updated successfully, but these errors were encountered: