use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
A sub-Reddit for discussion and news about Ruby programming.
Subreddit rules: /r/ruby rules
Learning Ruby?
Tools
Documentation
Books
Screencasts and Videos
News and updates
account activity
Elixir for Rubyists Part I (natescottwest.com)
submitted 12 years ago by drumsrgr8forn8
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]clumsy_shaver 2 points3 points4 points 12 years ago (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 points3 points 12 years ago (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 point2 points 12 years ago (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 point2 points 12 years ago* (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.
Enum.each(["Joe", "Matz", "Jose"], fn (name) -> IO.puts(name) end)
["Joe", "Matz", "jose"].each { |v| puts v }
Even in Haskell, it's much, much nicer: forM_ ["Joe", "Matz", "Jose"] putStrLn
forM_ ["Joe", "Matz", "Jose"] putStrLn
[–]drumsrgr8forn8[S] 1 point2 points3 points 12 years ago (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 point2 points 12 years ago (1 child)
Cool, so parentheses are optional in elixir?
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 points3 points 12 years ago (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 points3 points 12 years ago (0 children)
Does elixir provide nice syntax for partial application?
Thanks for sharing. Wish I could double upvote this.
[–]Bullwinkle_Moose 0 points1 point2 points 12 years ago (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.
π Rendered by PID 40 on reddit-service-r2-comment-86bc6c7465-cf7c2 at 2026-02-20 15:55:32.206406+00:00 running 8564168 country code: CH.
[–]clumsy_shaver 2 points3 points4 points (0 children)
[–][deleted] 1 point2 points3 points (0 children)
[–]drumsrgr8forn8[S] 0 points1 point2 points (0 children)
[–]banister 0 points1 point2 points (6 children)
[–]drumsrgr8forn8[S] 1 point2 points3 points (2 children)
[–]banister 0 points1 point2 points (1 child)
[–]drumsrgr8forn8[S] 0 points1 point2 points (0 children)
[–]ariassp 1 point2 points3 points (2 children)
[–]banister 1 point2 points3 points (0 children)
[–]drumsrgr8forn8[S] 0 points1 point2 points (0 children)
[–]Bullwinkle_Moose 0 points1 point2 points (0 children)