Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace fork with transforms #74

Open
MaksymZavershynskyi opened this issue Sep 24, 2019 · 3 comments
Open

Replace fork with transforms #74

MaksymZavershynskyi opened this issue Sep 24, 2019 · 3 comments
Assignees

Comments

@MaksymZavershynskyi
Copy link

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:

  • Implement transforms that inject our code and delete the fork;
  • Find an example of the code that we want to inject that cannot be injected with transforms.
@bowenwang1996
Copy link

Right now it all depends on AssemblyScript#866

@willemneal
Copy link

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
Copy link
Author

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants