Client side calldata encoding and decoding is the minimum effort required to remove our accidental centralization of aepps. Developers can always compile contracts and deploy them ahead of time and users can verify the bytecode against the contract source.
The most critical part would be to finish the library started in [PROPOSAL]: Javascript contract calldata encoding or do it with PureScript.
Yesterday in my free time I did an initial investigation of PureScript:
- The lack of binary pattern matching will make some translations not straightforward
- The purerl backend has different type mappings than the JS backend - this means that when changing the backend we should at least change the Algebraic Data Types used
- Algebraic data types in Purescript map really easy to JS objects - it is really easy to integrate PureScript code with JS code
- Being a strongly typed language it is well suited for porting compiler related stuff
- Support for quickcheck! This means that our existing models can be used to test the encoder
As a POC that this approach is feasible I will port in my free time aebytecode/aeb_fate_encoding.erl at master · aeternity/aebytecode · GitHub to Purescript.