@Luke Boswell mentioned in https://github.com/roc-lang/roc/pull/8788 that static dispatch potentially obsoletes Encode/Decode. Just wondering how we do that going forward. Do we just put encode/decode methods on whatever type we are serializing?
I think it is more than encode and decode will be implemented via static dispatch and auto derived. So not really absolute. Just not abilities anymore
how does that work? lets say I have type Foo and want to serialize, how does auto derive work? Is it similar to derive macro in rust?
If it is a structural type. Just doing .decode automatically works. For nominal types, you would define a decode implementation but leave it with no body. In both causes, the compiler will automatically generate.
This is compiler magic that is not yet implemented in the new compiler
I seen that Encode landed in new compiler. Stoked :tada: I'm guessing that means Decode is next? :sweat_smile: :smile:
yep, working on it!
https://github.com/roc-lang/roc/pull/8825 :tada:
https://github.com/roc-lang/roc/issues/8853
Last updated: Jun 16 2026 at 16:19 UTC