I'm really glad to have recently picked up Elixir. For anyone just starting, a few tips from someone similarly new:<p>a. After launching the "iex" shell, press Tab. You'll get the list of all built-in commands.<p>b. The help feature is also very handy for when you're wondering what an operator does. Type "h <command>" for a definition.<p><pre><code> h !/1
</code></pre>
c. Try the pipe operator. Your code will closely follow the transformations of your data.<p>Instead of this:<p><pre><code> m1 = "moo"
m2 = String.replace(m1, "m", "z")
m3 = String.upcase(m2)
</code></pre>
Or this:<p><pre><code> String.upcase(String.replace("moo", "m", "z"))
</code></pre>
Try this:<p><pre><code> "moo" |> String.replace("m", "z") |> String.upcase()
</code></pre>
The result of each command will be passed as the first argument to the subsequent command.<p>d. You get seamless interoperability with Erlang libraries.<p><pre><code> :crypto.hash(:md5, "bob") |> Base.encode64
</code></pre>
e. Try the Observer tool in iex to visualize various aspects of your running application, including the supervision tree, details on each running OTP process, and much more. Seriously very handy stuff.<p><pre><code> :observer.start()
</code></pre>
f. If you're using EC2 like I am, Amazon images have a too-old version of Erlang, but it's trivial to compile things yourself:<p><pre><code> sudo yum install gcc glibc-devel make ncurses-devel openssl-devel autoconf
wget https://www2.erlang.org/download/otp_src_18.0.tar.gz
tar xvzf otp_src_18.0.tar.gz
cd otp_src_18.0
./configure && make && sudo make install
sudo ln -s /usr/local/bin/escript /usr/bin/escript
sudo ln -s /usr/local/bin/erl /usr/bin/erl</code></pre>
Some random thoughts and impressions:<p>I had not even heard of Elixir till the Phoenix framework hit 1.0 about a month ago, and right now I'm very seriously considering Elixir/Phoenix for my next startup and have been slowly learning/hacking in it.<p>I come from C/C++ background, so the syntax was different as it is more Ruby-ish, but still very easy to grok. I've been looking at golang as my next language, but I think Elixir is even more simpler that it. Of all the functional languages that I've tried to get into in the past, this has the most approachable syntax, and I can see things like pattern matching helping a lot with code maintainability.<p>The performance, from whatever I've seen and the limited benchmarks that are out there, it compares extremely well with JVM, Node and Go. Erlang/OTP brings fault tolerance, Phoenix/Ecto etc. have been very productive, community is awesome and helpful. Erlang tooling, such as observer, is awesome and I don't think we have anything similar in golang, though I could be wrong. Dializer helps with type checking.<p>The one thing missing is lack of a enterprise sponsor, and also number of potential hires which can be risky for startups, but on the other hand people interested in working in elixir could be an interesting hiring filter ;)
Very much a personal opinion from someone coding for 15 years+. I'm new to Elixir but I found it to be a joyful language to work with so far. Java is a language you code in to pay the bills. Go is not bad at all but while I've heard people remark Go is fun, it hasn't been that fun for me. A bit of ugly syntax here and there. Python is awesome but I'm tired of the v2/v3 crap and frankly don't think it is the right tool for large, multi-person code bases (e.g. Openstack). Elixir has been truly enjoyable for me. If you are a jaded dev who used to love languages, give Elixir a try. I hope you get the same joy that I am getting from it because it has an ineffable quality about it.<p>[edited]
The changelog details all the good stuff in this release <a href="https://github.com/elixir-lang/elixir/releases/tag/v1.1.0" rel="nofollow">https://github.com/elixir-lang/elixir/releases/tag/v1.1.0</a><p>For anyone wanting to jump into Elixir, the getting started guides are excellent:
<a href="http://elixir-lang.org/getting-started/introduction.html" rel="nofollow">http://elixir-lang.org/getting-started/introduction.html</a><p>From there, José Valim wrote a How I Start article:
<a href="https://howistart.org/posts/elixir/1" rel="nofollow">https://howistart.org/posts/elixir/1</a><p>There's also a really helpful community on #elixir-lang irc. Someone is usually around to answer questions.
Honest question, and not meant to be inflammatory at all. I'm asking because I'm starting a project where an actor model may be a good fit.<p>Why would one choose erlang/elixir over akka[0]? Akka seems to implement a lot of common patterns for you. It has actor persistance, cross-node failover, advanced mailbox and routing logic, and is basically a superset of OTP.<p>The JVM is generally more efficient, has better tooling (ide support), has better libraries, and so on.<p>The only point I can give to erlang is the pre-emptive scheduling, which is useful for consistently low latency.<p>[0] <a href="http://doc.akka.io/docs/akka/2.4.0-RC3/java.html" rel="nofollow">http://doc.akka.io/docs/akka/2.4.0-RC3/java.html</a>
Here is my highly opinionated 2 cents.<p>Don't choose Elixir/Erlang just for the language. There are plenty of functional languages to choose from.<p>Choose them for what OTP provides. I doubt there is any language framework with as mature an operational framework as what Erlang/OTP provides.<p>For a startup it might feel like an extreme case of premature optimization but if you can make the technical investment you might reduce technical debt down the line.<p>I think Elixir in particular allows you to still get an MVP out the door with all the bells and whistles of OTP waiting silently in the background if your startup ever reaches the volumes to justify it.<p>BTW, I just attended a FANTASTIC 2 day (FREE) workshop conducted by Norberto Ortigoza (twitter: @hiphoox) at the HackerDojo that gave an overview of Elixir/Erlang/Phoenix and OTP. Thanks Hackers/Founders, Norberto and HackderDojo for arranging the training.
I have been watching Elixir/Phoenix for over a year with a lot of interest, one thing that I really appreciate is how dedicated they are to their CHANGELOG files.<p><a href="https://github.com/elixir-lang/elixir/blob/v1.1/CHANGELOG.md" rel="nofollow">https://github.com/elixir-lang/elixir/blob/v1.1/CHANGELOG.md</a>
<a href="https://github.com/phoenixframework/phoenix/blob/master/CHANGELOG.md" rel="nofollow">https://github.com/phoenixframework/phoenix/blob/master/CHAN...</a>
<a href="https://github.com/elixir-lang/ecto/blob/v1.0/CHANGELOG.md" rel="nofollow">https://github.com/elixir-lang/ecto/blob/v1.0/CHANGELOG.md</a>
Nice to see the new code of conduct, that's not something you see in every community.<p>I have to say it's incredible to see how quickly Elixir has developed and what the language is capable of. Between Elixir on the server side and Rust on the native space I feel like we're seeing a real growth of practical functional languages.<p>(I know Rust isn't as pure functional as many other languages but it's ML roots are still refreshing for writing native code)
For anyone who wants practise Elixir exercises akin to ruby koans. Check out. They are free :)<p>Études for Elixir
<a href="http://chimera.labs.oreilly.com/books/1234000001642/index.html" rel="nofollow">http://chimera.labs.oreilly.com/books/1234000001642/index.ht...</a>
I took a look at Erlang/Elixir a while ago and didn't get too far into it after realizing there was no compile-time type-checking.<p>My main question coming out of it: if you are going to go with a dynamic language, why go with Elixir over Python or Ruby (or Clojure or Racket or ...)? These have a larger mind-share and a more broadly recognized syntax.<p>Granted, Erlang (BEAM?) processes are appealing.<p>If you are using Erlang or Elixir, why?
Direct link to changelog: <a href="https://github.com/elixir-lang/elixir/blob/v1.1.0/CHANGELOG.md" rel="nofollow">https://github.com/elixir-lang/elixir/blob/v1.1.0/CHANGELOG....</a>
For anyone trying to install from Homebrew, the new formula hasn't been merged, you can brew edit it, if you need it now... Simply replace the existing formula, with the new one:<p><a href="https://github.com/josevalim/homebrew/blob/patch-30/Library/Formula/elixir.rb" rel="nofollow">https://github.com/josevalim/homebrew/blob/patch-30/Library/...</a><p>> brew edit elixir<p>Then just paste the new file in. You'll have to reset this eventually... which you can do for all your formulas using:<p>cd `brew --cellar`
git reset --hard HEAD<p>Installs like a charm on El Capitan.
I tried Elixir about 2 months ago for a project and found the standard library was lacking and the quality of community contributed modules wasn't up to par with other languages. I've worked with Python and Node my career and I prefer the Multi-paradigm approach of a Language like Go or Rust than the functional approach. I'll probably give it a try again in a year when it's more mature.
n00b question: can someone give me a small summary of the main difference between Elixir and Node at a very general level, without getting into a spat about the merits of JavaScript or true functional languages. Looking more for pros/cons like, "Elixir works _X_ way, where Node lacks _Y_," or, "Elixir is great for _Y_, but if you really want to do _X_, stick with Node."
Very excited about this, I am one of those people who theorycrafts about stuff quite a bit, and while I have been looking for an appropriate language for some of my next projects, elixir is at the top of the list consistently, mostly because I like not having to deal with concurrency myself, so I think it will be easier to rapid prototype and then scale as needed.
We created our microservice router in Elixir. It is rock solid and even the deployment is a breeze with exrm.<p>Even though I am the only one in the team who picked up Elixir, but soon we will have more. Elixir and its tooling is a welcoming change.
Sorry if this sounds like a noob question. Since everyone is asking why going with Elixir and not {X}, I am going to ask why would someone go with Elixir/Erlang and not Scala? I am asking this because we are evaluating new languages at the work place.
I was pretty excited about Elixir: great scalability and performance? Awesome!<p>I had an idea for a type of reverse proxy, so I wrote in on elixir + cowboy. Go to performance test it, and the results are nothing to write home about. Thought I was doing something wrong, but looking around I didn't find any performance test results that were all that different. What is the point of "lightweight threads" if the "heavier" solutions are way faster?<p>Here's TechEmpower's latest benchmark results. Keey scrolling till you get to an Erlang/Elixir based solution: <a href="https://www.techempower.com/benchmarks/#section=data-r10&hw=peak&test=query&l=2i1e8&a=1" rel="nofollow">https://www.techempower.com/benchmarks/#section=data-r10&hw=...</a>