Common Move Strategy
Shared Restrictions
Allowed in the first Move-compatible IR:- booleans
- unsigned integers
- addresses
- byte vectors
- structs with concrete fields
- simple enums lowered to tags
- first-order functions
- explicit entrypoints
- explicit abort codes
- target capabilities for events, resources, and objects
- higher-order runtime functions
- arbitrary Lean closures
- arbitrary recursion
- Lean heap objects
- raw IO
- dynamic reflection
- target syscalls not represented as capabilities
Sui
Sui uses an object-centric model. Persistent state maps to objects withUID.
Example generated object:
| Portable concept | Sui mapping |
|---|---|
| Contract state | object with UID |
| Entry method | public entry fun |
| Caller | TxContext.sender(ctx) |
| Native assets | Coin<T> |
| Events | sui::event::emit |
| Maps | table or dynamic fields |
| Deployment | Move package publish |
Counterobject.init(ctx: &mut TxContext).increment(counter: &mut Counter).value(counter: &Counter): u64.- Move unit tests.
Aptos
Aptos is closer to account-scoped resources. Example generated resource:| Portable concept | Aptos mapping |
|---|---|
| Contract state | account resource with key |
| Entry method | public entry fun |
| Caller | &signer |
| Native assets | Aptos Coin or fungible asset APIs |
| Events | framework event APIs |
| Maps | table resources |
| Deployment | Move package publish |
init(account: &signer).increment(account: &signer) acquires Counter.value(addr: address): u64 acquires Counter.- Move unit tests.
acquires clauses.
Codegen must understand resource access, not patch strings after the fact.
Portable IR Requirements For Move
The IR must encode:- which structs are persistent resources or objects
- ownership mode
- entrypoint mutability
- abort codes
- access paths
- event definitions
- ability requirements
- target-specific package address/module names
Sui vs Aptos First
Aptos is probably easier for the first generated package because account resources are closer to a traditional storage cell. Sui is strategically more important for testing the abstraction because its object model is further from EVM. Suggested sequence:- Aptos counter resource POC.
- Sui counter object POC.
- Compare the IR deltas.
- Promote the cleaner path to the first experimental Move target.
Open Questions
- Should Move package generation be implemented in Lean, Zig, or a small standalone generator?
- Should generated Move expose public view functions, entry functions, or both?
- How should generic assets map to
Coin<T>on Sui and Aptos? - How much of Move’s ability system should be modeled in the portable IR?
- Should source generation preserve comments back to Lean definitions?