It would be nice to have a guide for converting an already written JavaScript/TypeScript codebase to AssemblyScript. AssemblyScript can shine in this regard due to its similar syntax.
Things to cover:
- Setting up the project:
- Setting up your Directories
- Writing build scripts (
asc)
- Setting up the loaders (mostly as-bind loader)
For these asinit can probably help when starting a new project, but when you want to migrate the story is a little different.
- Source code
Note: I would like this guide to include as-bind, which is a better loader for the start. Even in Rust, there is no need to meticulously allocate and release Arrays, Strings, etc. If someone needed more flexibility and something was not covered by as-bind they can switch to the original loader.
In my opinion, the current AssemblyScript book is more like a reference, and having a practical guide is very necessary.
As a reference, there is this JavaScript => TypeScript migration guide here:
https://www.staging-typescript.org/docs/handbook/migrating-from-javascript.html
It would be nice to have a guide for converting an already written JavaScript/TypeScript codebase to AssemblyScript. AssemblyScript can shine in this regard due to its similar syntax.
Things to cover:
asc)For these
asinitcan probably help when starting a new project, but when you want to migrate the story is a little different.How to add types
numberto (i32,f32, etc).number[]) to typed arrays (Float32Array, etc) and static arrays (StaticArray)classsytnax.How to separate or arrange JavaScript calls
Note: I would like this guide to include
as-bind, which is a better loader for the start. Even in Rust, there is no need to meticulously allocate and release Arrays, Strings, etc. If someone needed more flexibility and something was not covered byas-bindthey can switch to the original loader.In my opinion, the current AssemblyScript book is more like a reference, and having a practical guide is very necessary.
As a reference, there is this JavaScript => TypeScript migration guide here:
https://www.staging-typescript.org/docs/handbook/migrating-from-javascript.html