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.
Interesting, if you need there is a whole set of tests here which you can easily adapt for your package. They should save you time writing tests and help to make sure that everything is correct.
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.
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?
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 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.