You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Build Cadence compiler and VM to enable execution of Cadence code as efficiently as possible (as close to the native machine code of the used execution node architecture as practical), to achieve the maximum transaction throughput on the execution node.
Phase 2 goal:
Complete Cadence compiler & VM using custom bytecode. This is middle-ground between current execution using Cadence Interpreter and the end-goal with compilation + VM to native machine code.
Replace the Cadence interpreter with concurrent on-chain compilation of contracts + transactions and their execution by custom-bytecode VM. The custom bytecode is designed to achieve this goal with minimal complexity, mapping as closely as possible to the existing Cadence language functionality/operations, which makes it possible to partially reuse existing interpreter code in the custom VM.
Phase 2 goal Outcomes:
Build the foundation for the next phase - gradual targeted compiler + VM optimizations to move the execution stack to lower-level / native code.
Custom bytecode provides new abstraction layer in the execution stack, which improves our ability to add new features into the language without braking promise of backwards-compatible runtime.
Reduce the execution stack complexity
Metering can be performed at the bytecode level, which is much easier than the current approach with instrumentation of interpreter functionality which is much larger surface to cover.
We are not expecting significant performance improvement in this phase, the goal is to achieve correctness parity & comparable performance with the existing Cadence interpreter.
Phase 2 timeline:
Q1 2025 - brake down and estimate remaining Cadence interpreter operations to be implemented, discuss & plan the integration of concurrent compilation & VM into the execution node stack. Provide estimation of remaining effort for compiler phase 2 before the end of Q1 2025. Start implementation.
The content you are editing has changed. Please copy your edits and refresh the page.
Cadence compiler project end-goal (Long-term):
Build Cadence compiler and VM to enable execution of Cadence code as efficiently as possible (as close to the native machine code of the used execution node architecture as practical), to achieve the maximum transaction throughput on the execution node.
Phase 2 goal:
Complete Cadence compiler & VM using custom bytecode. This is middle-ground between current execution using Cadence Interpreter and the end-goal with compilation + VM to native machine code.
Replace the Cadence interpreter with concurrent on-chain compilation of contracts + transactions and their execution by custom-bytecode VM. The custom bytecode is designed to achieve this goal with minimal complexity, mapping as closely as possible to the existing Cadence language functionality/operations, which makes it possible to partially reuse existing interpreter code in the custom VM.
Phase 2 goal Outcomes:
Phase 2 timeline:
Q1 2025 - brake down and estimate remaining Cadence interpreter operations to be implemented, discuss & plan the integration of concurrent compilation & VM into the execution node stack. Provide estimation of remaining effort for compiler phase 2 before the end of Q1 2025. Start implementation.
Main Tasks (WIP)
Stretch-goals
StaticType
tosema.Type
during runtime sub-type checking #3691Notes
Based on internal notes: https://www.notion.so/flowfoundation/Compilation-Discussion-1441aee1232480c897aed36c8f763e30
Phase 1 outcomes (completed):
The text was updated successfully, but these errors were encountered: