3 ms·
regarding point 3: In 2018, for an actor model on the BEAM, it is really easy to justify not being statically type. For a single simple reason. No one knows ho
by di4na 8y ago
regarding point 3: In 2018, for an actor model on the BEAM, it is really easy to justify not being statically type. For a single simple reason.
No one knows how to do it. It is an open research problem and we are far from a solution still.
- sidkshatriya 8y agoThat is true. But some other models of concurrency (e.g. golang channels) _do admit_ static typing. This is a weakness of actor model adopted in BEAM. Its a tradeoff -- do you go with untyped BEAM concurrency or typed concurrency like in golang.
- digitalzombie 8y agoIn Erlang you only care about cases that you care about. The let it crash mentality. Pattern matching is also good here too. In Go you have to write code to catch unwanted error and figure out what can go wrong. So there are many things in Erlang where it soften this no type weakness.
- erszcz 8y agohttps://github.com/josefs/Gradualizer https://github.com/josefs/Gradualizer already introduced above by Zalastax is one project which shows how to do it. It implements the gradual typing model, which merges static typing a'la ML/Haskell, with dynamic typing of Erlang. Other real-world examples of gradually typed languages are Facebook's Hack and TypeScript. Erlang already has a dual nature: - the sequential part, which strives to be a pure and mostly side-effect free functional language - the concurrent part, i.e. send, receive, process preemption, message delivery semantics, etc, which is inherently stateful due to interactions between stateful processes Gradual typing fits this model well, because it provides soundness to the sequential part of the language, while leaves the message passing parts which _no one knows how to_ type dynamically typed. BTW, I've spent a while to integrate Gradualizer with Vim - https://github.com/neomake/neomake/pull/2115 https://github.com/neomake/neomake/pull/2115
- di4na 8y agoSo basically what i said. We do not know how to statically type it, just try to provide some false safety.