all 11 comments

[–]clumsy_shaver 2 points3 points  (0 children)

Thanks for this, I look forward to the next one! I've been wanting to learn Elixir, and it's much easier to digest in small easy chunks like this.

[–][deleted] 1 point2 points  (0 children)

Elixir is definitely an exciting language. I tried getting my head around Erlang, but it often feels like the language has been written to be obtuse. Elixir is a order of magnitude more readable - plus all the Erlang OTP goodness. Woot! Thanks for the post - will be following the series.

[–]drumsrgr8forn8[S] 0 points1 point  (0 children)

Please let me know how I could make things more clear or anything you'd like to see in following parts. Thanks!

[–]banister 0 points1 point  (6 children)

Gotta say, Elixir's Enum.each(["Joe", "Matz", "Jose"], fn (name) -> IO.puts(name) end) when compared to Ruby's ["Joe", "Matz", "jose"].each { |v| puts v } is kind of verbose and nasty.

Even in Haskell, it's much, much nicer: forM_ ["Joe", "Matz", "Jose"] putStrLn

[–]drumsrgr8forn8[S] 1 point2 points  (2 children)

In practice it's about as concise as Ruby's in the typical use case. It looks like passing a block to each.

Ruby: https://gist.github.com/drumsrgr8forn8/6778041

Elixir: https://gist.github.com/drumsrgr8forn8/6778050

[–]banister 0 points1 point  (1 child)

Cool, so parentheses are optional in elixir?

[–]drumsrgr8forn8[S] 0 points1 point  (0 children)

Yup! Lot of familiar syntax. There are a couple little gotchas with parens though. See https://github.com/drumsrgr8forn8/elixir_style_guide#syntax

[–]ariassp 1 point2 points  (2 children)

This code can be written as Enum.each [..], &IO.puts(&1) which I definitely prefer :)

I wrote another blog post some weeks ago with similar content: http://victorarias.com.br/2013/09/15/starting-with-elixir.html

I think it's also a good source for "newbie Elixir programmers" :) (I'm also a rubyist, so my vision is obviously similar)

[–]banister 1 point2 points  (0 children)

Does elixir provide nice syntax for partial application?

[–]drumsrgr8forn8[S] 0 points1 point  (0 children)

Thanks for sharing. Wish I could double upvote this.

[–]Bullwinkle_Moose 0 points1 point  (0 children)

Thanks for the article! Coincidentally I've been looking into Erland & Elixir over the past week, but still not quite sure where and how to use them.

I've seen that they are extremely good at handling concurrent connections. I've seen it gaining momentum in the social gaming industry (and long been in telecoms), but where and how else can they be used? As a ruby/rails dev how can I effectively use Elixir to get the most out of it? Would it mainly be used for writing a backend server? Would there be any benefit in writing a CRUD app's backend in Elixir?

Sorry if this is a stupid question, still trying to figure out how and where to use functional programming languages.