I was perusing the V docs and saw a feature I thought looked useful that Roc may not have yet (scroll down a bit past where this link goes): Native deprecation support.
https://github.com/vlang/v/blob/master/doc/docs.md#attributes
I would actually love to have a deprecation system that can do automatic upgrades.
Specifically, when deprecating a function, you’re expected to replace the old body of the function with an implementation suitable for automatically inlining into callers (as an automated refactoring).
Then there’s a command like ‘roc fmt --fix-deprecations’ that identifies any uses of deprecated function and inline them.
Obviously this would have to be more expressive to support more significant API changes.
I assume some automated like that would really need constant folding to work well. Cause if you just inline the body, you probably add a lot of mapping code to go between the two apis. I would assume that in many cases the mapping code would fold way or otherwise not really be wanted
Yeah, definitely. Constant folding and code simplifications can go a long way to clean up the mess - but I would say that having a guaranteed-correct-but-messy migration path is already a huge step up.
Last updated: Jun 16 2026 at 16:19 UTC