Hacker News new | ask | show | jobs
by nilkn 3660 days ago
Dialyzer is indeed nice, but as you say, it's completely optional, it's not Hindley-Milner, and it relies entirely on thorough, correct type annotations from the developer.

Elixir also follows the Ruby philosophy of hiding as much behind the syntax as possible, whereas Elm tends to be very explicit. So I stand by my point that Elixir is a very different language in practice from Elm.

2 comments

> Elixir also follows the Ruby philosophy of hiding as much behind the syntax as possible, whereas Elm tends to be very explicit.

This is not true. While Elixir may not make things as explicit as Elm (I don't know Elm well enough to assert or refute such a statement), the author of Elixir has stated in various occasions that Elixir prefers explicit to implicit.

For instance, in Elixir, unless one explicitly defines a String.Chars protocol for a data structure, string interpolation of that data structure will not compile. In contrast, pretty much everything can be implicitly interpolated in Ruby.

Another example is function calls. In Elixir, if f is not a named function but a variable bound to an anonymous function, you cannot call it by writing something like f(x). Instead, you must put a dot after f and write f.(x) to state clearly that you are calling an anonymous function.

I use Erlang and I like it a bit more than Elixir in general exactly because it is more explicit. It involves slightly more syntax but there is less hidden magic stuff happening behind the scene.