Every 6-12 months, NEAR revisits the degree of its support and integration of AssemblyScript. Since last time we revisited it in Feb 2020, it is time to revisit it again.
Current support and integration
Currently, NEAR supports AssemblyScript project in the following ways:
-
It is the top financial contributor to the core AssemblyScript team, with monthly donations of 2k USD;
-
@willemneal runs monthly AssemblyScript Community Group meeting;
-
@willemneal is also an active contributor to as-pect and the core AssemblyScript code;
-
@willemneal occasionally posts bounties for AssemblyScript community see: near-sdk-as
Overall, @willemneal spends only a fraction of his work time on AssemblyScript.
AssemblyScript is currently integrated with NEAR tech stack in the following way:
-
NEAR has near-sdk-as. After it reached more or less parity with near-sdk-rs it’s further development was P2;
-
AssemblyScript is the main language in NEAR documentation, e.g. see https://docs.near.org/
-
create-near-app defaults to AssemblyScript.
Updates since Feb 2020
-
AssemblyScript compiler evolved from version 0.9 to 0.17;
-
near-sdk-as functionality has improved to be close to near-sdk-rs functionality and have similar DevX;
-
We have started AssemblyScript Community Group which meets monthly;
-
We have contract testing infrastructure in Rust that can test Wasm contracts independently on which language they are written in;
-
NEAR Studio was removed and replaced with http://examples.near.org/
-
Fastly announced more openly their support of AssemblyScript as an edge computing language;
-
Shopify announced more openly its support of AssemblyScript;
-
We stumbled upon a pretty critical bug in AssemblyScript STD which also showed that our near-sdk-as was probably not that much used, otherwise people would’ve noticed it sooner;
-
@corwinharrell and @amgando did a user study on AssemblyScript. Given the choice of Rust vs AssemblyScript. 3 out of 7 people said they would use Rust, 3 said they would use AssemblyScript, 1 person said they don’t care as long as it works;
-
@nearmax did a user study on JS, TypeScript, AssemblyScript, Rust. 249 people voted, the survey was not shared with any language-specific community).
Decision framework
We will choose one of the options below and commit to it for the next 6 months. Anyone in the thread can propose alternative options or express their preferences towards one or another option. Since in the past discussions of AssemblyScript lasted longer than several months we will time box this discussion and set a deadline for the decision to be January 15th, 2021. We will follow DACI decision making framework. Since the topic of AssemblyScript involves not one but many teams in NEAR Organization, @nearmax is going to be the Driver and the Approver. The following people are going to be contributors of the technical knowledge: @olonho , @willemneal , @nearmax, @evgenykuzyakov , @mikedotexe , @chadoh . And the following people are going to be contributors of the product knowledge: @olonho, @willemneal , @amgando , @thisisjoshford, @corwinharrell , @vgrichina , @mattlockyer , @mikedotexe, @nearmax. Anyone else joining this conversation can be either Contributor or Informed depending on the depth of their knowledge of the subject.
Option 1 (same support, more ownership, less integration)
Support:
- Continue the same financial support of the core AssemblyScript team;
- Continue running AssemblyScript CG;
- Get a dedicated person to own near-sdk-as, contribute to as-pect, and create AS bounties;
Integration:
- Switch create-near-app to default to Rust;
- Switch examples in docs.near.org to use Rust;
Explanation. We believe in the future of AssemblyScript and are willing to support it, but are cautious about vouching for its stability, given that compiler is not 1.0 and there are some bugs (@mikedotexe @thisisjoshford can provide more informations on issues that we encountered with AssemblyScript and near-sdk-as). Given that users are completely comfortable using Rust for the contracts, according to the surveys, we are switching docs and create-near-app to Rust.
Pros:
- We are not losing moment with AssemblyScript;
- We are getting more clear ownership of our own AssemblyScript components;
- We do not risk users starting using AssemblyScript for their contracts just to later rewrite them to Rust, because something does not work (happened to RainbowBridge and several hackathon projects);
Cons:
- We expand the scope of the horizontal teams: Berrypickers, DevRelations, and maybe Product. They now have to worry about Rust and AssemblyScript dev-tools.
Option 2 (same support, freeze integration)
Support:
- Continue the same financial support of the core AssemblyScript team;
- Continue running AssemblyScript CG;
- Freeze development of near-sdk-as and contributions to as-pect;
Integration:
- Switch create-near-app to default to Rust;
- Switch examples in docs.near.org to use Rust;
Explanation. We believe in the future of AssemblyScript and are willing to support it, but want to completely focus on a single “happy path” in our developer journey, which is Rust.
Pros:
- All pros from Option 1;
- Allows us to focus all effort on one language;
Cons:
- Having AssemblyScript support as a first-class language in NEAR is postponed by at least 6 more months.
Option 3 (external ownership without attribution without NEAR Inc/NEAR Foundation taking responsibility for it)
Support:
- Continue the same financial support of the core AssemblyScript team;
- Continue running AssemblyScript CG;
- Get a third-party to develop near-sdk-as, as-pect, and help with release of AssemblyScript 1.0, e.g. through a grant;
Integration:
- Remove AssemblyScript from our docs and tools entirely, allow third-party to develop their set of docs and tools;
- Do not vouch for the quality of the AssemblyScript dev tools as NEAR Foundation or NEAR Inc.
Explanation. We allow someone else to develop it faster, however we don’t have control over their quality and so we cannot vouch for it.
Pros:
- We are moving even faster with AssemblyScript support;
- There is no scope increase for horizontal teams like Berrypickers, DevRelations, and Product, since AssemblyScript dev-tools are now done by someone else;
- For NEAR Inc and NEAR Foundation there is less code surface that it needs to vouch for.
Cons:
- AssemblyScript devtools become disjoint from other dev-tools and documentation.
Option 4 (replace AssemblyScript with another popular language)
Support:
- Stop supporting AssemblyScript and instead support Wasm compiler for another language from the top-10 most popular languages list;
Integration:
- Remove AssemblyScript from all our tools and docs.
Explanation. As the survey has shown users prefer the idea of a more generally known language for contracts than AssemblyScript, which is what we actually care about — we want to provide an alternative that is less niche than Rust.
Pros:
- We have a more popular language for smart contracts. Some general purpose languages, like C# have stable Wasm compiler supported by large organizations like Microsoft;
Cons:
- It is unclear whether AssemblyScript->Wasm is more efficient and stable than C#(or other general purpose language)->Wasm. @olonho needs to weigh-in on it;
- There is a sunk cost of stopping AssemblyScript support.
Update 1: Removed “Rust>>JS>>TypeScript>>AssemblyScript” to not confuse people. As @vgrichina pointed out.