5 ms·
Looks like we just got compile-time type safety and higher-kinded polymorphism on the BEAM VM.
by proaralyst 10y ago
Looks like we just got compile-time type safety and higher-kinded polymorphism on the BEAM VM.
- platz 10y agoI'm not sure I understand how static types and existing Erlang OTP patterns are supposed to work together. What is the type of a gen_server? It can literally become anything. What is is the type of become messages? http://joearms.github.io/2013/11/21/My-favorite-erlang-program.html http://joearms.github.io/2013/11/21/My-favorite-erlang-progr...
- wcummings 10y agoYou can do success type-checking w/ dialyzer, so there's already a way to think about this. An instance of a gen_server is a pid, the become message in this example is a tuple of an atom and function. http://erlang.org/doc/reference_manual/typespec.html http://erlang.org/doc/reference_manual/typespec.html
- platz 10y agoof course, but I wouldn't assume success typing (dialyzer) is compatible with static parametric typing, ala purescript
- im_down_w_otp 10y agoI'm not sure I'm seeing the gap. You get parametric types with Dialyzer + type specs. There are also several flags you can enable for Dialyzer to make its checking more strict and exhaustive. Now that the escape hatch from type safety, that was impossible to avoid using Maps, has been mostly closed (and you're under no obligation to use Maps to begin with) it's not at all clear to me what you wouldn't be able to do.
- asolove 10y agoWell, it's complicated. I'm not trying to criticize this work, which is really cool, but it doesn't really tackle the hard part of types in an Erlang-style concurrent system. To learn about the challenges of typing complex concurrent systems and some of the cool approaches for doing it, I highly recommend this talk by Zeeshan Lakhani: https://www.youtube.com/watch?v=-8jLRThHuFQ https://www.youtube.com/watch?v=-8jLRThHuFQ
- brightball 10y agoThanks for linking that.