Post #2139006
2026-04-14 22:15 UTC
@RanaldClouston @dif As of now, that is still an unsolved question in general. My own work is essentially trying to show that it is possible to have sound gradual typing that has good performance and other good properties.
But since you qualified your "sound" with "(somewhat)", you may be willing to make compromises. If you want performance and some semblance of soundness, it's usually better to compromise on expressiveness/behavior.
Replies (1)
-
@fabianm@mastodon.acm.org 2026-04-14 22:15
@RanaldClouston @dif The best example of sound and performant gradual typing in practice that I know is Static Python (https://doi.org/10.22152/programming-journal.org/2023/7/2). It's used by Instagram and yielded performance benefits there, but comes with some subtle restrictions on language features. In particular, the dynamic type cannot simply replace other type annotations in all places. This is likely true in any realistic language, but Static Python does it more than most people would want.