nearprotocol / assemblyscript

A TypeScript to WebAssembly compiler 🚀
https://assemblyscript.org
Apache License 2.0
8 stars 1 forks source link

Replace fork with transforms #74

Open MaksymZavershynskyi opened 5 years ago

MaksymZavershynskyi commented 5 years ago

AssemblyScript fork requires constant maintenance and periodic fires in our system. Interestingly, the only purpose of the fork is to be able to inject the code into our system by wrapping methods into JSON serialization and deserialization code.

Luckily, AssemblyScript supports transforms https://docs.assemblyscript.org/details/peculiarities#transforms which can alter AssemblyScript before and after parsing on AST level. Upon reading the small bits of documentation I do not see the reason why it cannot be used to achieve our goal without forking the compiler. (For instance, in Rust we are using procedural macros to generate the very same JSON serialization/deserialization wrapping code, and procedural macros work on AST level).

We should either:

bowenwang1996 commented 5 years ago

Right now it all depends on https://github.com/AssemblyScript/assemblyscript/pull/866

willemneal commented 5 years ago

Yeah there are still a few other sticking points that we need to keep the fork. For example, I've added a check to make sure floating point numbers are not used. I think the major issue has been the lack of versioning on our side and AS's side, which meant changes to master affected everything.

MaksymZavershynskyi commented 5 years ago

If the floating point check is the only things that prevents us from getting rid of the fork then let's remove this check. We already check for floating points before contract execution. Anything else that prevents us from getting rid of the fork?