-
Notifications
You must be signed in to change notification settings - Fork 268
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(avm): implement serialization for all existing operations (#4338)
This PR implements serialization for all existing operations. It also adds `indirect` and other missing parameters to the operations (but does not use them). It's a big PR but the most interesting changes are * The `serialization/` folder. * Things that are not tests. What I like * Easy to add types and modify existing wire formats. * Very explicit tests that will tell you exactly what we expect (too repetitive? see [DRY vs DAMP in tests](https://abseil.io/resources/swe-book/html/ch12.html#tests_and_code_sharing_dampcomma_not_dr)). * Well-defined interfaces. * Instruction serialization from object is also supported! This made creating bytecode a breeze. What I don't like * ~~Due to limitations of TypeScript, there is more boilerplate in each operation than I would like. Time permitting I will try to simplify things further.~~ Thanks to @Maddiaa0 for coming up with a boilerplate-less version. * Some typing is not as strict (uses of `any`). What's still missing * External calls cannot be added to the instruction set, because they create a dependency cycle. This stems from the context using `decodeFromBytecode` or, to paraphrase, from an instruction using an interpreter (this was not introduced in this PR). It might be fixable but not in this PR. Closes #4218. --------- Co-authored-by: Maddiaa0 <47148561+Maddiaa0@users.noreply.github.com>
- Loading branch information
Showing
36 changed files
with
2,190 additions
and
948 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.