# AssemblyScript Grant Q1 2021

**URL:** <https://gov.near.org/t/assemblyscript-grant-q1-2021/697>\
**Category:** Development\
**Created:** [February 20, 2021, 2:45am UTC](https://gov.near.org/t/assemblyscript-grant-q1-2021/697 "2021-02-20T02:45:22Z")\
**Posts on this page:** 18\
**Page:** 2

<div class="post-metadata">

**Author:** ![gagdiez](https://dub1.discourse-cdn.com/flex005/user_avatar/gov.near.org/gagdiez/32/4010_2.png) [@gagdiez](https://gov.near.org/u/gagdiez)\
**Post date:** [August 2, 2021, 9:49pm UTC](https://gov.near.org/t/assemblyscript-grant-q1-2021/697/21 "2021-08-02T21:49:27Z")

</div>

Hi @nearmax,

I just posted a proposal in the assemblyscript dao for borsh-as [1], made in collaboration with @willemneal. The project is fully functional, thoroughly tested, and is in the process of being added to the near-sdk.

This borsh implementation is actually part of a larger package called **serial-as** [2], which standardizes serializers in assemblyscript. Thanks to **serial-as** , developers only need to implement a few methods (`encode_number`, `decode_string`, etc), and do not need to worry about implementing a transform. Furthermore, serial-as readily provides a set of tests that both basic (u\*, sting, array, etc) and complex objects (Nullable objects, Nested objects, Inheritance, etc)

Besides borsh, we have also implemented JSON in serial-as. While the current implementation is just a wrapper around assemblyscript-json, the idea for the near future is to use a more memory-efficient implementation. We can achieve this by simplifying the internal representations used while decoding an object (known as Values in assemblyscript-json). While the new implementation is still a work-in-progress (we are still deciding on some aspects with @willemneal), it is already fully functional, completely compatible with as-json, and thoroughly tested (see the feat-standalone-json branch).

serial-as has been in development for the past 3 months, and I plan to keep working on it and maintaining it. Because of this, I would like to ask the committee to consider giving a **grant** for **serial-as** and its upcoming development/maintenance.

Thank you for your time,  
Guillermo

[1] [serial-as/borsh at main · gagdiez/serial-as · GitHub](https://github.com/gagdiez/serial-as/tree/main/borsh)  
[2] [GitHub - gagdiez/serial-as: Building a generalized encoder for assembly script](https://github.com/gagdiez/serial-as)

---

<div class="post-metadata">

**Author:** ![gagdiez](https://dub1.discourse-cdn.com/flex005/user_avatar/gov.near.org/gagdiez/32/4010_2.png) [@gagdiez](https://gov.near.org/u/gagdiez)\
**Post date:** [August 2, 2021, 9:53pm UTC](https://gov.near.org/t/assemblyscript-grant-q1-2021/697/22 "2021-08-02T21:53:12Z")

</div>

Interesting, if you need there is a whole set of tests [here](https://github.com/gagdiez/serial-as/blob/main/json/assembly/tests/jvalue.spec.ts) which you can easily adapt for your package. They should save you time writing tests and help to make sure that everything is correct.

Looking forward to see the comparison!

---

<div class="post-metadata">

**Author:** ![JairusSW](https://dub1.discourse-cdn.com/flex005/user_avatar/gov.near.org/jairussw/32/39595_2.png) [@JairusSW](https://gov.near.org/u/JairusSW)\
**Post date:** [August 3, 2021, 5:21pm UTC](https://gov.near.org/t/assemblyscript-grant-q1-2021/697/23 "2021-08-03T17:21:33Z")

</div>

Awesome! Thanks for the tests!

---

<div class="post-metadata">

**Author:** ![nearmax](https://dub1.discourse-cdn.com/flex005/user_avatar/gov.near.org/nearmax/32/13344_2.png) [@nearmax](https://gov.near.org/u/nearmax)\
**Post date:** [August 4, 2021, 4:48pm UTC](https://gov.near.org/t/assemblyscript-grant-q1-2021/697/24 "2021-08-04T16:48:36Z")

</div>

For the record, I have changed ownership of this grant and the post itself to @jim .

---

<div class="post-metadata">

**Author:** ![gagdiez](https://dub1.discourse-cdn.com/flex005/user_avatar/gov.near.org/gagdiez/32/4010_2.png) [@gagdiez](https://gov.near.org/u/gagdiez)\
**Post date:** [August 7, 2021, 10:53am UTC](https://gov.near.org/t/assemblyscript-grant-q1-2021/697/25 "2021-08-07T10:53:36Z")

</div>

Hi @jim, when you have time please have a look at my message above related to AS grants. Thanks!

---

<div class="post-metadata">

**Author:** ![jim](https://avatars.discourse-cdn.com/v4/letter/j/ac91a4/32.png) [@jim](https://gov.near.org/u/jim)\
**Post date:** [August 9, 2021, 1:57pm UTC](https://gov.near.org/t/assemblyscript-grant-q1-2021/697/26 "2021-08-09T13:57:50Z")

</div>

Hey @gagdiez. @willemneal and I will synch on this today. Thanks for all the info. We’ll review shortly.

---

<div class="post-metadata">

**Author:** ![jim](https://avatars.discourse-cdn.com/v4/letter/j/ac91a4/32.png) [@jim](https://gov.near.org/u/jim)\
**Post date:** [August 12, 2021, 8:44pm UTC](https://gov.near.org/t/assemblyscript-grant-q1-2021/697/27 "2021-08-12T20:44:17Z")

</div>

[3000 NEAR claimed](https://www.sputnik.fund/#/dao/assemblyscript.sputnikdao.near/proposals/16) by @gagdiez

---

<div class="post-metadata">

**Author:** ![jim](https://avatars.discourse-cdn.com/v4/letter/j/ac91a4/32.png) [@jim](https://gov.near.org/u/jim)\
**Post date:** [August 31, 2021, 12:00am UTC](https://gov.near.org/t/assemblyscript-grant-q1-2021/697/28 "2021-08-31T00:00:05Z")

</div>

[3000 NEAR claimed](http://gov.near.org/t/assemblyscript-grant-q1-2021/697) by @ashutoshvarma

---

<div class="post-metadata">

**Author:** ![ashutoshvarma](https://dub1.discourse-cdn.com/flex005/user_avatar/gov.near.org/ashutoshvarma/32/823_2.png) [@ashutoshvarma](https://gov.near.org/u/ashutoshvarma)\
**Post date:** [October 19, 2021, 7:12pm UTC](https://gov.near.org/t/assemblyscript-grant-q1-2021/697/29 "2021-10-19T19:12:30Z")

</div>

Hi @jim, Hope you are doing fine!  
I have been working on `near-sdk-as` simulation bounty.  
As the last remaining part of [Finish near-sdk-as simulation test framework](http://gov.near.org/t/assemblyscript-grant-q1-2021/697#finish-near-sdk-as-simulation-test-framework-20), I created the PR ([feat: Update simulator tests for new `near-runner` API by ashutoshvarma · Pull Request #648 · near/near-sdk-as · GitHub](https://github.com/near/near-sdk-as/pull/648)) and it was merged.  
But I don’t know why my proposal failed [SputnikDAO](https://www.sputnik.fund/#/dao/assemblyscript.sputnikdao.near/proposals/19)  
Let me know when you are ready, I will make the proposal for the same again.  
Thanks

---

<div class="post-metadata">

**Author:** ![ashutoshvarma](https://dub1.discourse-cdn.com/flex005/user_avatar/gov.near.org/ashutoshvarma/32/823_2.png) [@ashutoshvarma](https://gov.near.org/u/ashutoshvarma)\
**Post date:** [October 26, 2021, 2:57pm UTC](https://gov.near.org/t/assemblyscript-grant-q1-2021/697/30 "2021-10-26T14:57:20Z")

</div>

Hi @jim, when you have time please have a look at my message above for AS grants.  
Thanks

---

<div class="post-metadata">

**Author:** ![jberrytech](https://dub1.discourse-cdn.com/flex005/user_avatar/gov.near.org/jberrytech/32/3216_2.png) [@jberrytech](https://gov.near.org/u/jberrytech)\
**Post date:** [October 26, 2021, 4:25pm UTC](https://gov.near.org/t/assemblyscript-grant-q1-2021/697/31 "2021-10-26T16:25:44Z")

</div>

Hey @ashutoshvarma! Sorry about the delay here. Please resubmit and I’ll get this taken care of soon 🙂

---

<div class="post-metadata">

**Author:** ![ashutoshvarma](https://dub1.discourse-cdn.com/flex005/user_avatar/gov.near.org/ashutoshvarma/32/823_2.png) [@ashutoshvarma](https://gov.near.org/u/ashutoshvarma)\
**Post date:** [October 27, 2021, 10:06am UTC](https://gov.near.org/t/assemblyscript-grant-q1-2021/697/32 "2021-10-27T10:06:30Z")

</div>

Hi @jim @jberrytech , please find the new proposal  
[https://www.sputnik.fund/#/dao/assemblyscript.sputnikdao.near/proposals/20](https://www.sputnik.fund/#/dao/assemblyscript.sputnikdao.near/proposals/20)

---

<div class="post-metadata">

**Author:** ![ashutoshvarma](https://dub1.discourse-cdn.com/flex005/user_avatar/gov.near.org/ashutoshvarma/32/823_2.png) [@ashutoshvarma](https://gov.near.org/u/ashutoshvarma)\
**Post date:** [November 1, 2021, 1:59pm UTC](https://gov.near.org/t/assemblyscript-grant-q1-2021/697/33 "2021-11-01T13:59:34Z")

</div>

Hi @jim,@jberrytech, this proposal is also going to expire soon. Kindly make time for this.

---

<div class="post-metadata">

**Author:** ![ashutoshvarma](https://dub1.discourse-cdn.com/flex005/user_avatar/gov.near.org/ashutoshvarma/32/823_2.png) [@ashutoshvarma](https://gov.near.org/u/ashutoshvarma)\
**Post date:** [November 4, 2021, 4:38pm UTC](https://gov.near.org/t/assemblyscript-grant-q1-2021/697/34 "2021-11-04T16:38:15Z")

</div>

Hi @jim @nearmax,

I have been trying to connect with you guys for a long time. I’ve completed the work as per the grant and all the PRs are merged.  
I have made proposals many times but they eventually expire. Kindly respect my time and the work that I have done for the NEAR community.

Best  
Ashutosh

---

<div class="post-metadata">

**Author:** ![jberrytech](https://dub1.discourse-cdn.com/flex005/user_avatar/gov.near.org/jberrytech/32/3216_2.png) [@jberrytech](https://gov.near.org/u/jberrytech)\
**Post date:** [November 20, 2021, 4:37pm UTC](https://gov.near.org/t/assemblyscript-grant-q1-2021/697/35 "2021-11-20T16:37:36Z")

</div>

[1200 NEAR claimed 6](https://www.sputnik.fund/#/dao/assemblyscript.sputnikdao.near/proposals/22) by @ashutoshvarma

---

<div class="post-metadata">

**Author:** ![rom](https://dub1.discourse-cdn.com/flex005/user_avatar/gov.near.org/rom/32/16216_2.png) [@rom](https://gov.near.org/u/rom)\
**Post date:** [February 5, 2022, 1:32am UTC](https://gov.near.org/t/assemblyscript-grant-q1-2021/697/36 "2022-02-05T01:32:23Z")

</div>

Hey, I’m interested in applying for the as-bignum muldiv grant. However, I’m confused on the exact requirements involved. I have the following questions:

- as-bignum apparently already has muldiv for u128. Do I just have to implement muldiv for u256?
- I’d like to know more about the faster u128 division algorithm. Is it required for the grant, and may I have some sources (academic papers, wikipedia pages) about the algorithm to implement?

---

<div class="post-metadata">

**Author:** ![jim](https://avatars.discourse-cdn.com/v4/letter/j/ac91a4/32.png) [@jim](https://gov.near.org/u/jim)\
**Post date:** [February 6, 2022, 10:59pm UTC](https://gov.near.org/t/assemblyscript-grant-q1-2021/697/37 "2022-02-06T22:59:18Z")

</div>

Hey @rom. This is great that you are interested in this problem. @vlad, could you take a look at this and provide some guidance?

---

<div class="post-metadata">

**Author:** ![rom](https://dub1.discourse-cdn.com/flex005/user_avatar/gov.near.org/rom/32/16216_2.png) [@rom](https://gov.near.org/u/rom)\
**Post date:** [February 6, 2022, 11:24pm UTC](https://gov.near.org/t/assemblyscript-grant-q1-2021/697/38 "2022-02-06T23:24:06Z")

</div>

Thanks for the response. I’ve already shot an email at @nearmax about this, but I’d just like to note here that implementing both an optimized implementation of muldiv (which requires optimized mulmod, multiply, and divide operations for u256) and I’m assuming some fast paths for u128 division would take hundreds upon hundreds of lines of heavily tested code. I’ve already finished an unoptimized implementation [here](https://github.com/MaxGraey/as-bignum/pull/72) that takes up 500 lines and took entire days to make. In my opinion, relative to the sizes of other grants, the difficulty doesn’t match the reward. I’d be happy to optimize my existing code and merge into the as-bignum repository for a higher grant, if that’s possible.

[Previous page](https://gov.near.org/t/assemblyscript-grant-q1-2021/697.md?page=1)
