4 ms·
A precursor to Elixir, Reia, got me interested in Erlang. After having written Erlang for a little while now, I'm not sure of the benefits of a language like E
by waffle_ss 13y ago
A precursor to Elixir, Reia, got me interested in Erlang. After having written Erlang for a little while now, I'm not sure of the benefits of a language like Elixir or Reia anymore (which seem mostly focused on improving syntax). Sure, Erlang syntax is odd starting out, but you get over that very quickly.
I can't help but compare it to CoffeeScript. Sure, CoffeeScript papers over some inconveniences of JavaScript, but at the end of the day I find myself writing JavaScript in a disciplined way instead of reaching for yet another abstraction. I realize it's not a good comparison as CoffeeScript compiles to JS while Elixir and Erlang both compile to a shared VM (BEAM), but I don't think Elixir has added enough new ideas to warrant focusing on it in favor of Erlang, yet (for me at least). That may change in time.
- zimbatm 13y agoIt depends if that newer syntax allows you to handle more things at the same time. Without explicitly measuring and mentioning it that's what these super-set languages are trying to do I think. With CoffeeScript I always end up translating to JavaScript into my head so cognitively it's more effort for me. Another JavaScript super-set might liberate me from thinking of otherwise trivial things and leave more room for planning or "registry" access.
- devinus 13y agoAs a professional Erlang developer who now develops with Elixir, I need to stop this right here. This is NOT just about syntax. Elixir simply is not just a pretty face for Erlang, but enables metaprogramming that is simply NOT possible in Erlang without writing 10x more code. Elixir comes with it's own standard library, HashDict, Reducers, and more and more. I'll have to write another blog post, because this misconception that Elixir is just a prettier syntax is somehow still around.
- klibertp 13y agoSo exactly like Coffee - it enables you to do class-based inheritance and mixins which is NOT possible in JavaScript... without writing 10x more code. Standard library of Elixir should be available to pure Erlang too, right? From what I recall from interoperability docs. Could you post a tiny little example of metaprogramming in Elixir that would appeal to quite experienced Erlang developer who knows about parse transforms? I am NOT dismissing Elixir, I know too little about it and I want to finally learn about some feature that would convince me to learn some Elixir.
- devinus 13y ago1) Do you also think of e.g. Scala as the CoffeeScript of Java? Scala : Java :: Elixir : Erlang 2) Yes, interoperability is there and, just like you can use Scala libraries from Java, you just need the Elixir runtime in your path. 3) My favorite is from the String.Unicode module: defmodule String.Unicode do # ... def upcase(""), do: "" lc { codepoint, upper, _lower, _title } inlist codes, upper && upper != codepoint do def upcase(unquote(codepoint) <> rest) do unquote(upper) <> upcase(rest) end end def upcase(<< char, rest :: binary >>) do << char >> <> upcase(rest) end # ... end
- klibertp 13y agoOk, I'm almost convinced - at least I'll give Elixir a try after I finish with Joxa. Any tips for someone who would like to learn Elixir fast? Is the "Getting Started" on Elixir page OK or should I search somewhere else? As for Scala and CoffeeScript... well, that's a tough one. On some level they are very similar, but the differences are huge. I'd say they both, and Elixir, are in the same class of things with CS being on the lower level than Scala and Elixir.
- devinus 13y agoYes, the Getting Started guide is great. There is also Dave's book[1] and many talks done by José and Yurii[2]. [1]: http://pragprog.com/book/elixir/programming-elixir http://pragprog.com/book/elixir/programming-elixir [2]: http://www.youtube.com/watch?v=m32CGvzixrQ http://www.youtube.com/watch?v=m32CGvzixrQ
- rubyrescue 13y agoIntroducing Elixir by Simon St Laurent is coming out soon. I read a pre-release version and it is exactly what you want.
- waffle_ss 13y agoI apologize for my misconceptions and I would really enjoy reading such a blog post. Do you have an address or RSS feed I could check in at later? At the risk of making another bad estimation, I still feel like (at this point in time anyway) you still need to know Erlang and OTP to understand and appreciate Elixir. As an aside, have you seen Joxa? It's a LISP for the Erlang VM. I'm really not trying to be a downer about this, I think it's great that the Erlang VM is having these new languages pop up and José Valim is one of my favorite Ruby programmers, so I have high hopes for Elixir. I hope after I get better at Erlang I can revisit Elixir and appreciate the things you are talking about.
- devinus 13y agoI'll begin writing it this weekend and publish it to my blog next week: http://devintorr.es/ http://devintorr.es/ (Atom feed: http://devintorr.es/atom.xml http://devintorr.es/atom.xml)
- akkartik 13y agoYou should link to it on your profile: https://news.ycombinator.com/user?id=devinus https://news.ycombinator.com/user?id=devinus
- devinus 13y agoFinished that blog post: https://news.ycombinator.com/item?id=5864434 https://news.ycombinator.com/item?id=5864434
- jeremyjh 13y agoIts all about the macros, man. If you are familiar with Erlang and gen_server, then perhaps looking at the examples in the readme of Exactor (https://github.com/sasa1977/exactor https://github.com/sasa1977/exactor) will be enlightening to you. It presents a very straightforward DSL for defining gen_servers plus function wrappers in a very small amount of code with little boilerplate and repetition. There are other great libraries that make excellent use of macros, I just think this one makes this point really well.