AssemblyScript Grant Q1 2021

The AssemblyScript ecosystem has been very valuable for NEAR Organization, since it allows developers familiar with TypeScript to develop NEAR dApps with minimal onboarding and learning. We would like to help the AssemblyScript ecosystem expand and further maturity of the existing components.

In the previous discussion we have brainstormed the projects that could get financial support from NEAR. Based on it we have agreed to allocate: 40k USD and 35k NEAR to support various projects. The grant consists of four parts:

A. Financial support for the AssemblyScript core team without attachments. We will grant 40,000 USD to AssemblyScript over OpenCollective so that they can focus on improving AssemblyScript language, compiler, and standard library following their own roadmap;

B. Financial support in NEAR tokens for the AssemblyScript projects that are not owned/initiated by NEAR to keep them going. NEAR has benefited from these projects and their community a lot in the past, and this is our way to recognize it and help them keep going;

C. Proposals to add/improve features in AssemblyScript projects not owned/initiated by NEAR. We will propose certain improvements to the projects in exchange for NEAR tokens. Anyone can grab them, but project owners have a priority;

D. Proposal to add/improve features in AssemblyScript projects owned/initiated by NEAR. We will assemble a team and fund them through the grant in NEAR tokens.

In general, NEAR does not want to limit its contribution to 40k USD and 35k NEAR in the near future. We just don’t have enough expertise and time to list every single AssemblyScript component and feature request in post. If you find anything in AssemblyScript ecosystem that you would like to build/improve/fix please reply in this thread.

A. Financial support for the AssemblyScript core team

Nothing to explain here :), we are just giving a batch of USD to the AssemblyScript core team without attachments, but with the hope that they will further the stability of the language, compiler, and the standard library.

B. Financial support for projects not owned/initiated by NEAR

NEAR Organization would like to help the following AssemblyScript projects by donating NEAR tokens. If the project decides not to claim the tokens, they will be instead used by NEAR to compensate AssemblyScript developers in section D.

As-pect (paid)

As-pect is the go-to testing framework for AssemblyScript. NEAR protocol is currently using it for writing tests for AssemblyScript contracts.

We would like to recognize the contribution of this project to the NEAR ecosystem and help it keep going, by providing 3000 NEAR tokens.

As-bignum

As-bignum provides implementations for 128 and 256 arithmetics which is popular in the blockchain world. NEAR protocol has been using this library in its contracts.

We would like to recognize the contribution of this project to the NEAR ecosystem and help it keep going, by providing 3000 NEAR tokens.

Assemblyscript-regex (paid)

[Assemblyscript-regex](https://github.com/ColinEberhardt/assemblyscript-regex) is simply a regex engine for AssemblyScript. Potentially, NEAR contract developers might find it useful to have regex-based validation (e.g. checking whether input is an email address or a URL).

We would like to recognize the contribution of this project to the NEAR ecosystem and help it keep going, by providing 3000 NEAR tokens.

As-bind

As-bind allows passing high-level data-structures between AssemblyScript and JavaScript. While NEAR is not using this library at the moment, NEAR is in general highly interested in having a high-level interface with Wasm contracts. If we could run the same AssemblyScript on blockchain, as part of the webpage, and as a standalone node.js CLI without modifying the contract, it could potentially allow various interesting use cases.

We would like to recognize the contribution of this project to the NEAR ecosystem and help it keep going, by providing 1000 NEAR tokens.

Node

Node.js to WASI adapters for AssemblyScript are in their early days. NEAR protocol is not using this project directly, however, it’s implementation will likely further maturity AssemblyScript ecosystem.

We would like to recognize the contribution of this project to the NEAR ecosystem and help it keep going, by providing 1000 NEAR tokens.

Glas (paid)

Glas is a WebGL engine in AssemblyScript. While it cannot be used directly in a NEAR contract, there is great potential for hybrid game dApps that are written mostly in AssemblyScript, including the browser part. Additionally, Glas has to implements various math primitives that can be potentially later extracted into separate libraries that might be potentially useful for some contracts.

We would like to recognize the contribution of this project to the NEAR ecosystem and help it keep going, by providing 1000 NEAR tokens.

C. Proposals to add/improve projects not owned/initiated by NEAR

NEAR Organization is interested in certain improvements/fixes to the projects in section B. However, the NEAR Organization understands that owners might not be interested in implementing them themselves. Therefore, each improvement has an independent reward in NEAR tokens and anyone can implement it but owners have a priority to claim the reward.

As-pect

Add coverage

We would like to add functionality to measure coverage of the given tests. Coverage can be measured in the similar way we do gas counting at NEAR. As-pect would need to inject a host-function call into every Wasm block and then while executing tests on the Wasm module it would count the percentage of blocks that were reached by the execution.

NEAR offers anyone who does it 3000 NEAR tokens.

As-bignum

Implement safe and unsafe versions of u256, i128, i256

256 and 128 math is important for blockchain applications.

NEAR offers anyone who implements it 1000 NEAR tokens, this includes covering these primitives with tests.

Division

Currently as-bignum is missing muldiv. Additionally there is a potential for implementing a faster division algorithm for u128.

NEAR offers anyone who implements it 1000 NEAR tokens, this includes covering these primitives with tests.

Corner case test coverage

It would be great to cover all corner cases with tests.

NEAR offers anyone who implements it 2000 NEAR tokens.

Introduce semver

We need to know when backward and non-backward compatible changes are introduced to the library. For that we need to introduce semver and add the changelog.

NEAR offers anyone who implements it 200 NEAR tokens.

D. Projects owned/initiated by NEAR

Near-sdk-as

MVP Active Record Interface for Contract State

We would like someone to offer a design of Active Record Pattern and implement it for operating with the state from the contracts. The design does not need to be sophisticated, but it needs to support read/write/delete/lookup operations for the state.

NEAR offers anyone who implements it 2000 NEAR tokens.

Finish near-sdk-as simulation test framework

near-sdk-as simulation test framework requires a lot of polish. Additionally, we would like have full documentation and test coverage for it, as well as all examples that cover various use cases in NEAR. This grant requires some high-level knowledge of writing contracts in NEAR.

NEAR offers anyone who implements it 4000 NEAR tokens.

As part of this project you would also need to do the following small work items:

Merge wasm_mock_vm on near-sdk-rs side

This project requires some Rust knowledge. We need to merge a year old PR, publish Wasm module, and switch dependency here to not depend on github branch.

Switch to release build

We need to switch the script here to use release instead of debug build mode here.

Extract mock-vm

near-mock-vm needs to be extracted into a separate AssemblyScript package.

Remove simulator

simulator is no longer needed, and it needs to be removed from the repository.

Assemblyscript-json (paid)

JSON Spec Test Suite

We would like to use [JSONTestSuite](https://github.com/nst/JSONTestSuite) to exercise AssemblyScript JSON implementation.

NEAR offers anyone who implements it 500 NEAR tokens.

Asbuild (paid)

Asbuild tries to mimic Rust Cargo functionality, by being an all-in-one tool for building, testing, formatting, etc AssemblyScript projects. Right now however it has only very basic functionality.

NEAR offers anyone who implements it 2000 NEAR tokens.

asb fmt

We would like `asb fmt` command to invoke eslint with AssemblyScript-friendly configuration on a given AssemblyScript project.

asb test

We would like `asb test` command to find and execute as-pect tests on a given AssemblyScript project.

asb init

We would like `asb init` to create scaffolding for an AssemblyScript project, with tiny program that prints Hello World and tiny example of as-pect test. Similar to `cargo init` in Rust.

Visitor-as

AssemblyScript rewrite

Visitor-as is an important library necessary for functionality of near-sdk-as since it allows macros-like code injections. Currently it is mostly written in TypeScript, since AssemblyScript compiler front-end is still mostly written in JavaScript. We would like to rewrite visitor-as into AssemblyScript to make it more self-hosted which should contribute to the autonomy of the AssemblyScript ecosystem, and help with the quality of visitor-as.

NEAR offers anyone who implements it 1000 NEAR tokens.

Borsh.io

Borsh.io is a security and performance focused binary serialization format. NEAR protocol is using it both in the core implementation of the protocol and in the contracts. We would like to have a standalone AssemblyScript implementation of borsh.io library.

NEAR offers anyone who implements it 3000 NEAR tokens.

Datetime library (paid)

AssemblyScript ecosystem is currently lacking Date/Time implementation. NEAR contracts would also greatly benefit from this functionality since contracts are frequently time-aware. It would also make sense for AssemblyScript implementation to match the interface and behavior of JavaScript Date Object as close as possible, with UTC timezone support only.

NEAR offers anyone who implements it 3000 NEAR tokens.

How to claim rewards?

A. Financial support for the AssemblyScript core team

We will just transfer 40,000 USD to AssemblyScript core team OpenCollective once we have time.

B. Financial support for projects not owned/initiated by NEAR

If you are one of the project owners, please reach out to max@near.org.

C. Proposals to add/improve projects not owned/initiated by NEAR

If you want to implement one of the proposed changes reach out to max@near.org. If you are not a project owner, then we will contact the project owner first to get an agreement from them that they are okay with the code change. Also, the project owner might use the right to claim the reward and implement it themselves.

D. Projects owned/initiated by NEAR

@potatodepaulo will be assembling a team to work on these projects. Please reach out to him: peter@near.org . He might be even okay with you starting to work on the project before he assembles a team.

Anything that we missed?

Do you have an idea a project or feature/improvement that we haven’t covered in this list and you want it to be funded by NEAR and might be viewed as beneficial to NEAR? Apply through https://grants.near.org/ or leave a comment in this thread.

5 Likes

For the record, 3k NEAR was claimed by jtenner through assemblyscript.sputnikdao.near

1 Like

I remembered few things we should add to AssemblyScript grant list:

Wow, thank you all for approving a grant for glas! :pray:

2 Likes

Hi @nearmax @potatodepaulo,
Though I’m still new to NEAR but would love to contribute to the NEAR ecosystem.
By going through OP, I can find few tasks in section D that I can help with.
Are “JSON Spec Test Suite” and " Datetime library" from Section D still open?

1 Like

@willemneal Could you please discuss with @ashutoshvarma which project from section D he can start working on?

For the record, @ashutoshvarma claimed 500 NEAR.

1000 NEAR claimed by @trusktr .

3000 NEAR claimed by @ashutoshvarma

I would like to submit a grant proposal for an AssemblyScript data storage format designed to serialize object references with a very small footprint.

I propose ASON - AssemblyScript Object Notation which is a data oriented algorithm designed from the ground up to be fast by default, and avoid cache misses wherever possible to increase algorithm speed.

There is a minimal testing suite using as-pect that tests if the serialize and deserialize methods properly store and restore entire object trees in a very performant way.

So far this project has been 80 hours of work for me, and 15 hours for my friend @RedDwarfian on github.

With this funding, I can do more performance testing, and investigate ways of reducing serialized buffer size to help reduce smart contract storage costs. This library will also support the AssemblyScript ecosystem as a whole, enabling developers to send binary messages across networks, store data on the blockchain, and send messages across processes.

3000 NEAR claimed by @ashutoshvarma

Comparing this project to borsh.io , and since you have already spent 95 hours, I think it qualifies for 2000 NEAR grant for the work that was already done and to support the future development of the project. Please submit an application here: SputnikDAO

2000 NEAR claimed by @jtenner for the development of ASON.