logoalt Hacker News

eben-vrankenyesterday at 7:27 PM1 replyview on HN

Elixir's gradual type system cannot change the asymptotic complexity of your programs. The design explicitly rules out mechanism that causes slowdowns in other gradual type systems (runtime casts at static/dynamic boundaries)

Most gradual type systems insert coercions when values cross the types/untyped boundary (checking every element of a list, wrapping values in typed proxies, etc) but Elixir's team published a "strong arrows" result specifically to achieve soundness without those runtime checks. The bytecode the compiler emits is semantically identical to untyped code.


Replies

dnauticsyesterday at 7:29 PM

i think the design can push people into writing unnecessary matches/guards just to trigger the typechecker.

that said, I'm a fan

show 2 replies