Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Elixir Design Goals (elixir-lang.org)
145 points by duggieawesome on Aug 12, 2013 | hide | past | favorite | 30 comments


I just started playing with Elixir this weekend, and it was a ton of fun. Ruby syntax + macros + Erlang semantics + UTF-8 strings is a great combination. And the Programming Elixir book from Pragmatic Press was a good introduction, too.

But I especially enjoyed Erlang's concurrency model and OTP. In a few hours, I was able to go from basic message passing, to a simple OTP server, to distributed processes communicating between multiple VMs, and finally to a supervised OTP server with automatic restart on crash. Erlang provides an awful lot out of the box, and Elixir makes it quite friendly-looking.

However, it's not a mature environment yet. The tools are pretty good for a young language, but the ecosystem is still small. Nonetheless, there's some cool stuff out there already:

Experimental web framework: https://github.com/elixir-lang/dynamo Mnesia distributed DB wrapper: https://github.com/meh/amnesia Heroku buildpack: https://github.com/goshakkk/heroku-buildpack-elixir

I'll need to build a larger system in Elixir, but the my initial impressions are good.


Can I ask you, where did you learn OTP? Did you know it from before, did you follow a specific book/tutorial? I've been interested about OTP, and would appreciate a good starting point.


The Learn You Some Erlang tutorial[1] gives a good introduction. There's also Erlang and OTP in Action[2].

[1]: http://learnyousomeerlang.com/content

[2]: http://www.amzn.com/1933988789


Erlang and OTP in Action goes pretty deep into it.


I picked up the _Programming Elixir_ book a few weeks ago, and it had a solid overview on OTP. Definitely not a deep, but enough to get you started.


Oh man, I love BEAM VM's design. Just looking at memory allocators, handling iolists, binary blob referencing, schedulers spread over all the CPUs, async IO threads. Just discovering that I found myself nodding my heading often say "aha, that's a really good way to do it".

It is good to see Elixir work on it alongside Erlang. I don't think everyone will jump ship to Elixir. For example I like Erlang's syntax (I might be in the minority) but meta-programming and ease of access to BEAM for newcomers is great.


Having been a bit of an 'Erlang is quite good enough' purist, I am becoming increasingly tempted to give Elixir a whirl.

I am a long term hater of Javascript (global state, aargh!) and I have been giving coffeescript a whirl (no global state, yay!).

One of the (unexpected) side effects is that I appreciate the readability of coffeescript vs javascript much more than I expected.

Jose Valim is also giving a talk at a conference I am organising next month (http://mostlyfunctional.com), so I am tilting heavily at the moment...


I don't quite understand why people are purists on anything at all...

Even Joe Armstrong likes Elixir!

http://joearms.github.io/2013/05/31/a-week-with-elixir.html

Here's a direct quote: "This is good shit."


I think you meant ClosureScript. CoffeScript is mostly a syntaxic decoration over JavaScript and doesn't remove mutability.


Pretty sure he meant CoffeeScript. It doesn't remove mutability, but it does do away with default-global variables.


So does javascript unless you forget `var` and you refuse to `"use strict"` and lint.


That's not really 'by default' then, eh?


True, it's not the language's default, just the default your environment should have (and the default of any sane IDE).

Which is less work than adding coffeescript to your toolchain.


The 'default' (and I'm not sure how now declaring your variables with var qualifies) depends entirely on what's bound to 'this'.


No I meant Coffeescript


s/ClosureScript/ClojureScript/


I couldn't be more excited about elixir, personally. All the power of erlang plus metaprogramming. To me elixir is the spiritual heir to Ruby


As someone who's just started with Ruby/Rails what are the benefits of switching to Elixir?


If you're going to write websites, stay with Rails. I'm a long time Erlang developer and even today there is no good web framework (sure, a few exists, but none of them make it as pleasant to develop websites as Rails).

If you're going to write a server application, even REST and HTTP, Erlang and Elixir is a superb choice (I would argue better than Ruby with Sinatra, for example) because of the concurrency model and the ability to handle protocols and binary data.

There are also a few nice template libraries for Erlang (for example https://github.com/mojombo/mustache.erl) so if you just need some templating and don't mind writing some glue yourself it could still be a good option.


In terms of frameworks, no, nothing competes with Rails because Rails is simply too big an ecosystem to compete with on even terms for a relatively niche language. Chicago Boss is pretty nice, with a very friendly community, though. It's worth a look.


The Erlang VM. Ruby on Rails is in a different category honestly. Elixir and Erlang are not web frameworks.


elixir doesn't have a mature framework like Rails, but I could easily see using Elixir for things that I would use sinatra for.

Key Advantages: * better performance * easier to write services that stay up thanks to OTP * better memory management

The common strength that elixir shares w/ Ruby is that is also very expressive


Better execution model.

The main loss is a much drearier ecosystem.


To be honest, I got very interested in Elixir myself. However, as I am trying to learn any Lisp, I am surprised LFE (Lisp for Erlang) or Joxa has not taken off, as the one thing missing from a lot of Lisp and Scheme languages seems to be a thread-based concurrency, specifically for multi-core processors having become ubiquitous.


There's always Clojure for that.


"Why do Erlang and Elixir have the same 'semantics'? The reason has to do with the underlying machine. The garbage collection behavior, the non-shared concurrency model, the underlying error handling and code loading mechanism are identical. They must be identical: they run on the same VM. This is also why things like Scala and Akka will never be like Erlang. Scala and Akka run on the JVM so under the covers, things like garbage collection and code loading are fundamentally different." [0]

It goes without being said, but the choices the VM make will ultimately impact what is or is not possible for the languages on top of it. I have never taken the time to investigate JRuby or IronPython, but I have imagined this is a reason why few people love the original and VM-ported editions: one must assume Ruby code becomes less Ruby, Python less Pythonic, once moved to different VM architecture.

[0] http://joearms.github.io/2013/05/31/a-week-with-elixir.html


I've spent the past few weeks writing quite a bit of Elixir, and I have to say that I haven't had this much fun with a programming language in a long time.


Finished writing my first elixir library a few days ago https://github.com/rramsden/scribe

The language source code is incredibly clean and well documented. It's been a joy to work with so far.


Seems like some cool, clean code, and I understand without having examined Elixir too much, less than two or three hours of doc scanning. But I guess familiarity with Ruby does make a difference.

Out of curiosity: if you are doing DB migrations, what are you running on Elixir that requires it? You building web apps or just utilities running on top of a DB?


I'd love to know what James Hague (http://prog21.dadgum.com/) thinks of Elixir. Erlang is one of his stronger languages, and he's written a lot of articles in the past that I really enjoy.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: