Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/pedrouid/assemblyscript-demo
Assemblyscript Demo
https://github.com/pedrouid/assemblyscript-demo
Last synced: 13 days ago
JSON representation
Assemblyscript Demo
- Host: GitHub
- URL: https://github.com/pedrouid/assemblyscript-demo
- Owner: pedrouid
- Created: 2018-10-23T03:46:46.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2018-10-23T04:49:07.000Z (about 6 years ago)
- Last Synced: 2024-10-29T02:21:14.370Z (2 months ago)
- Language: TypeScript
- Homepage: https://assemblyscript-demo.netlify.com/
- Size: 25.4 KB
- Stars: 4
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Assemblyscript Demo
This demo was built from following this [article](https://medium.com/@BenedekGagyi/the-simplest-way-to-get-started-with-webassembly-1f92f6f90d24), which shows how easy it is to use WebAssembly on a browser.
Using Assemblyscript we compile Typescript to WebAssembly, which can then be used on the browser.
In this example, we write a function that returns us a Fibonacci number for an integer. Check out [fib.ts](/src/fib.ts)
Then we run the command from our package.json to compile it
```bash
npm run compile# OR
asc src/fib.ts -o dist/fib.wasm
```We get a WebAssembly file, [fib.wasm](/dist/fib.wasm), that we can later load in our browser and use it with Javascript, [index.html](/dist/index.html).
Check out the live demo at [https://assemblyscript-demo.netlify.com](https://assemblyscript-demo.netlify.com)