News for hackers. Stuff that matters.
Re:Elixir vs. Erlang: a question of momentum by aaron-lebo on Thursday April 23, 2015 @10:19AM (#9426810)
Sure, Erlang has an issue with gaining forward momentum, but I feel like people are really overstating the momentum Elixer has.

It is easy to gain huge percentages of momentum (if you could ever measure that) when you have little to start with. That's the case with Elixir. That's the same situation languages like Factor and even Haskell saw seven years ago. The former is more or less dead and and the latter still never "broke out".

When Elixir is competing library-wise and ecosystem-wise with the likes of existing languages like Python, Ruby, Java, Javascript, and then some of its major selling points are in competitors like Go (though not 100%) or Clojure/Scala (which can leverage the JVM), it really, really has to distance itself.

As great as Elixir is, it is hard to make a bet on it ever crossing the threshold of "this is really cool" to something you can goto because library x y and z are available.

Re:Elixir vs. Erlang: a question of momentum by josai on Thursday April 23, 2015 @11:24AM (#9427329)
>> I feel like people are really overstating the momentum Elixir has

I don't think so at all. I see elixir gaining a groundswell of momentum very much like the early days of rails and node. Of course it's the beginning, but I see a whole different crowd of people interested in elixir - the "gets things done" crowd rather than the "this is cool/elite" crowd I see playing with factor or haskell (sorry, but it's true).

Elixir does not compete with Python, Ruby or JS - it solves a whole different problem, which is the "massively multiplayer" requirement the apps world is obviously moving towards. No-one I know likes Go or Scala. Clojure is a genuine competitor, you are right about that, but it lacks the ruby community spirit showing itself in elixir. Say what you want about ruby but its community moves mountains.

It's early, yes, but I know a lot of good rails devs who are embracing elixir and they're all "smart and gets things done" types. A lot of torque is building behind taking elixir mainstream, and there's excitement in the air. Time will tell, but it's a bet I'm increasingly ready to make.

Re:Elixir vs. Erlang: a question of momentum by lighthawk on Thursday April 23, 2015 @11:30AM (#9427371)
> Elixir does not compete with ... Ruby ...

I think it does, actually, though not intentionally. José Valim was a Rails core dev and as far I can tell he took on Elixir to address concerns with performance.

In http://elixir-lang.org/blog/2013/08/08/elixir-design-goals/ he says, "Given my previous background in Ruby, it is natural that some of the constructs added were borrowed from Ruby. However, those additions were a by-product, never a language goal." He follows this with a comparison of Ruby code to Elixir.

I'm heavy into Ruby but looking forward to Elixir gaining strength.

Re:Elixir vs. Erlang: a question of momentum by josai on Thursday April 23, 2015 @11:51AM (#9427531)
> I think it does, actually

You may be right, but what I meant is that every rubyist i know looking into elixir is after massively persistent connections. Websocket, basically, to thousands or more clients. They are leaving ruby because it simply cannot offer that (I don't care what DHH says. No-one big is doing EM WS in production, nor should they).

Phoenix has a steeper learning curve than rails but is addressing the new paradigm of persistent duplex connections. Rails remains unapologetically a request-based framework, ActionCable notwithstanding. That is fine. 99% of today's apps don't that. Right tool for the job! But to me, the future is very clear.

I'm heavy into ruby too, but speaking pragmatically, it and elixir are playing different games in different ballparks. That's why I said they don't compete.

Re:Elixir vs. Erlang: a question of momentum by lectrick on Thursday April 23, 2015 @01:28PM (#9428318)
There are many, many other selling points to Elixir/Erlang over Ruby, if you already like Ruby (and its syntax, some of its conventions, etc.)

1) Immutable data throughout- prevents certain classes of bugs

2) 10x faster- obvious benefit

3) Actual macros- the ultimate metaprogramming: http://elixir-lang.org/getting-started/meta/macros.html

4) Functional paradigm- encourages decoupling of code by forcing state to be passed around explicitly as arguments, this also aids unit testing, it also reduces bugs further

5) Instant "forking" without having to worry about thread safety, and good semantics around it

6) Potential 99.999999999% uptime reliability (thanks to Erlang's OTP)

7) Hot-swappable code upgrades with no downtime

8) Pattern-matching reduces the amount of "switch logic" code greatly. In Ruby code I often saw complex logic branches with no test coverage- it's easier to cover those in Elixir when every "branch" is a different pattern-matched function

9) A bunch of neato things such as build-your-own-sigils, which felt even more "Ruby-like" than Ruby's own capability (or lack thereof) here: http://elixir-lang.org/getting-started/sigils.html

10) Trendy Actor model built-in from the get-go ;)

Re:Elixir vs. Erlang: a question of momentum by lighthawk on Thursday April 23, 2015 @02:56PM (#9428985)
> A bunch of neato things such as build-your-own-sigils, which felt even more "Ruby-like" than Ruby's own capability

I like custom sigils, those are pretty cool, e.g. def sigil_i(string, []), do: String.to_integer(string)

But, having to put that char into the method name rather than argument, doesn't that limit the characters that you can use? Seems like would be better as arg.

Re:Elixir vs. Erlang: a question of momentum by lectrick on Sunday April 26, 2015 @07:19PM (#9443677)
I agree with that... Perhaps it's limited that way on purpose?
Re:Elixir vs. Erlang: a question of momentum by pbowyer on Thursday April 23, 2015 @03:38PM (#9429288)
> 2) 10x faster- obvious benefit

Given Erlang is sometimes slower than Python [1] I am surprised if it's 10x speed improvement over Ruby.

1: https://news.ycombinator.com/item?id=9417453 (start at last comment & work up)

Re:Elixir vs. Erlang: a question of momentum by TylerE on Thursday April 23, 2015 @04:31PM (#9429596)
It depends on what you're doing.

I believe for the sort of thing typically done in these sort of languages (which usually boil down to doing lots of string processing) Elixir may well be 10x faster.

The reason?

Lack of dynamism.

Function calls in python/ruby? SLOOOOOW

Function calls in Elixir? Hella fast, because it's all resolved at compile time, there's no dynamic lookup, no creating a locals dictionary for each call, etc.

(PS: Most typical web frameworks make a LOT of function calls - all that data sanitizing, templating, and formatting has to happen somewhere)

It's true that Elixir is slower if doing numerics heavy code since it can't just call out to a highly tweaked numeric library like NumPy.

(This is all talking single threaded, of course. With a parrallizeable task you won't even be in the same zip code.)

Re:Elixir vs. Erlang: a question of momentum by bascule on Thursday April 23, 2015 @10:40PM (#9431139)
Erlang and Elixir are both dynamically typed and do dynamic dispatch.

Erlang does not know the types flowing through a call site in advance and therefore has to do dynamic dispatch.

In particular, Erlang has a "code server" that all calls throughout the system must thunk through, versus a statically typed language where a call is optimized to a single JMP instruction. Smarter JITs, like Java's HotSpot, can also do this, and HotSpot is smart enough to inline both virtual and dynamic dispatch at runtime. BEAM can't.

Erlang's closest thing to a JIT (HiPE) cannot inline calls across modules, has no support for deoptimization, and is in effect a naive, crappy, AOT compiler which does the bare minimum to work in an otherwise dynamic environment.

Source: I made this... it was basically Elixir before Elixir:

http://reia-lang.org/

These days I like languages that can actually avoid this overhead through the use of static typing, like Rust.

Note that it isn't necessarily bad that Erlang works this way. When it comes to Erlang's core strength: coordinating the concurrent activities of a massive number of processes/clients, it really does shine. Just don't use it for anything CPU-intensive.

Re:Elixir vs. Erlang: a question of momentum by drieddust on Thursday April 23, 2015 @05:21PM (#9429905)
6) Potential 99.999999999% uptime reliability (thanks to Erlang's OTP)

I don't have much understanding of programming language internals but why we don't thing see low level stuff like distributed file system written in Erlang.

I genuinely interested in knowing why this is not tried by someone?

Re:Elixir vs. Erlang: a question of momentum by TylerE on Thursday April 23, 2015 @05:40PM (#9430052)
Every phone call you've made in the last 10 years+ probably touched an erlang node at some point. That's pretty distributed.

If your're looking for more traditional server stuff, there's RabbitMQ.

Re:Elixir vs. Erlang: a question of momentum by KirinDave on Thursday April 23, 2015 @07:56PM (#9430673)
Actually quite a few systems have been! Besdies telco stuff, Facebook used it quite a bit and I'm told it was in LinkedIn's stack as well.

I get a lot of recruiting interest from my time at Powerset as an erlang engineer, from the most surprising places. Game companies come up a lot.

Re:Elixir vs. Erlang: a question of momentum by bascule on Thursday April 23, 2015 @10:38PM (#9431134)
> 10x faster- obvious benefit

Please put down the kool aid. If you can't back statements like this up, you're not helping anyone.

Re:Elixir vs. Erlang: a question of momentum by lectrick on Thursday April 23, 2015 @11:02PM (#9431193)
I would swear I saw this somewhere, but in the meantime, this shows up to 6x

http://benchmarksgame.alioth.debian.org/u64q/compare.php?lan...

Re:Elixir vs. Erlang: a question of momentum by lectrick on Friday April 24, 2015 @02:19AM (#9431701)
Re:Elixir vs. Erlang: a question of momentum by karmajunkie on Thursday April 23, 2015 @01:36PM (#9428365)
Add one to the column of people who are into Elixir for reasons that have nothing to do with websockets.
Re:Elixir vs. Erlang: a question of momentum by sjtgraham on Thursday April 23, 2015 @12:40PM (#9427955)
> No-one big is doing EM WS in production

Are you kidding me? Look at Pusher, which is literally EM sitting behind Route 53

Re:Elixir vs. Erlang: a question of momentum by bsummer4 on Thursday April 23, 2015 @02:20PM (#9428723)
Pusher? Aren't they moving all of their code to Haskell?
Re:Elixir vs. Erlang: a question of momentum by mdpye on Friday April 24, 2015 @05:03AM (#9432116)
It will be a long time before we're rid of EventMachine. It's served (relatively) well considering, but I wouldn't say any of us are fans or would recommend it for new projects.
Re:Elixir vs. Erlang: a question of momentum by themartorana on Thursday April 23, 2015 @12:15PM (#9427707)
Hi. I'm Dave. I really like Go, and I write and maintain a real-time and turn-based multiplayer game backend.

I liked Elixir a lot too, but when trying to pick the right tool, the learning required around Elixir/Erlang, the VM, and OTP didn't make sense when writing a production system that needs to handle 1000 req/s or more with a small staff. Go handles what we do fantastically.

Now you know someone. :)

Re:Elixir vs. Erlang: a question of momentum by rdtsc on Thursday April 23, 2015 @01:22PM (#9428286)
Actually OTP makes even more sense though. WhatsApp processes billions of messages per day and they only have 10 or so engineers working on the backend.

At any large scale what becomes more important is fault tolerance. Even though Go has goroutines and sane and modern concurrent IO handling, goroutines still share memory. So then even a super fast 1M req/s system is no good if it is down 50% of the time because it crashed.

Re:Elixir vs. Erlang: a question of momentum by perishabledave on Thursday April 23, 2015 @03:27PM (#9429213)
If your interested, Jamie Winsor of Undead Labs did a talk at Erlang Factory on how they use Elixir for their backend: https://www.youtube.com/watch?v=_i6n-eWiVn4

Also theres a good writeup on how Erlang was used for some of Call of Duty's infrastructure. http://www.erlang-factory.com/upload/presentations/395/Erlan...

Sounds like you're already committed to Go, but just wanted to make the case. Concurrent, fault-tolerant, highly scalable systems is Elixir's sweet spot.

[edit] One more, great talk from the Elixir Conf on how Martin Shurrer used Erlang to build a multiplayer card game. This one is particularly good because it deals with scaling, game states, and is very practical: http://confreaks.tv/videos/elixirconf2014-otp-in-production-...

Re:Elixir vs. Erlang: a question of momentum by themartorana on Thursday April 23, 2015 @09:49PM (#9431003)
To be clear, I really liked both Elixir and Erlang. It's just that purely functional programming, the Erlang VM, OTP, and so on all required learning, and so introduced so many possible points of failure.

Go was familiar from the jump, and easy to reason around coming from primarily Objective-C, C, Python, and C#. Considering timeline, it wouldn't have made sense to be so behind the learning curve.

With more time or breathing room, I think Erlang would be a space I'd jump into with both feet.

Edit: I know Martin through common colleagues and have worked with him in Austria. He's a great dev, and that was a good watch. Thanks for the link.

Re:Elixir vs. Erlang: a question of momentum by arca_vorago on Thursday April 23, 2015 @10:30AM (#9426905)
"I feel like people are really overstating the momentum Elixer has."

I think the real problem is overly broad generalizations about languages in general. I'm just a sysadmin, so I have to keep up with the big picture overview of things, and one thing I have learned is that certain languages have momentum in certain areas of application where they don't in others. The devs in one area see language A as awesome and language B as sucky for their work, while the devs in another see it the opposite. Elixir/Erlang for example has concurrency that is only challenged by a small set of languages like Go. (Henning Diedrich got 877k TPS with Erlang and VoltDB. )

Anyway, my point is that for those of us more specialized and deep instead of jacks of all trades, we need to keep in mind our biases when we speak so broadly about languages. Also, when it comes to momentum, some languages can pull others behind them. For example, I am recently fascinated with Racket, which seems to me a perfect way of pulling Scheme (SICP) into a modern setting. Elixir may have enough momentum that it brings Erlang with it, etc.

Re:Elixir vs. Erlang: a question of momentum by jtittsler on Friday April 24, 2015 @01:09AM (#9431535)
Have you explored Lisp Flavored Erlang (LFE)? http://lfe.io/ It is another way to participate in the BEAM ecosystem and might align well with your Racket interest.
Re:Elixir vs. Erlang: a question of momentum by arca_vorago on Monday April 27, 2015 @11:16AM (#9446816)
I have not but I'm looking at it now and am very interested. Thank you very much for the link!
Re:Elixir vs. Erlang: a question of momentum by Hemospectrum on Thursday April 23, 2015 @10:40AM (#9427008)
> That's the same situation languages like Factor and even Haskell saw seven years ago. The former is more or less dead and and the latter still never "broke out".

Kind of a nitpick, but "breaking out" was never a goal of the forces behind Haskell, and in fact contrary to their stated desires. Much of Haskell's value was always (and continues to be) its variety of tools for expressing the semantics of the problem the code tries to solve — features which we now see spreading rapidly among mainstream languages. The rest of its value (and its primary purpose) was as a research tool for developing such features. There's still a lot of work to be done in exploring that frontier.

Re:Elixir vs. Erlang: a question of momentum by hawkice on Thursday April 23, 2015 @11:02AM (#9427176)
The canonical phrasing in the Haskell world is "Avoid success-at-all-costs." [If you don't mind me adding the disambiguating hyphens.]
Re:Elixir vs. Erlang: a question of momentum by metaphorm on Thursday April 23, 2015 @12:20PM (#9427758)
I thought the more prevalent attitude was "speak to developers like the wretched ignorant peasants they are." followed closely by "A monad is just a monoid in the category of endofunctors, what's the problem?".
Re:Elixir vs. Erlang: a question of momentum by hawkice on Thursday April 23, 2015 @12:29PM (#9427848)
There is a difference between blog posts and conversations about Haskell. The community is extremely friendly to beginners, but many blog posts are not, and most are largely geared towards experts familiar with the more esoteric terms. If you actually answer the "what's the problem?", explain your trouble, you will, with extremely high certainty, get explanations from people that are neither condescending nor deliberately obtuse.
Re:Elixir vs. Erlang: a question of momentum by davidw on Thursday April 23, 2015 @12:26PM (#9427818)
Anecdote: I was at a dinner with Simon Peyton Jones once, and he was about as nice and kind and polite as could be, despite me not holding a candle to him in the computer science field. He was genuinely curious about my job as a consultant "in the trenches", selling coding time for money. I came away extremely impressed with him as a person. Hopefully some of that attitude gets passed on throughout that community.
Re:Elixir vs. Erlang: a question of momentum by dukerutledge on Thursday April 23, 2015 @02:50PM (#9428948)
SPJ is certainly a bodhisattva.
Re:Elixir vs. Erlang: a question of momentum by mercurial on Thursday April 23, 2015 @02:53PM (#9428968)
The Haskell community is very friendly in general (same with OCaml). You will find a few "I figured out how to open a file in Haskell, therefore I am smarter than John Carmack" types, but they're not prevalent.
Re:Elixir vs. Erlang: a question of momentum by lectrick on Thursday April 23, 2015 @01:18PM (#9428259)
Related: I literally bought a book to try to help wrap my head around the mathy ideas in Haskell (recommended by someone here, I believe). I am about to start it: http://books.google.com/books/about/A_Book_of_Abstract_Algeb...

That said, if you have to understand a sufficient amount of math concepts to code in a language... that's an impediment. (Perhaps an empowering learning curve, to be sure.)

Re:Elixir vs. Erlang: a question of momentum by kyllo on Thursday April 23, 2015 @10:45AM (#9427042)
I don't think you're giving Haskell enough credit. I just went to a Haskell meetup last weekend and was very impressed by the attendance and engagement level, it was a very lively and interactive group. A lot of software companies are using Haskell now, I know Microsoft has Haskell code in production and I think Facebook does too. I really feel like the language is gaining steam lately.
Re:Elixir vs. Erlang: a question of momentum by qubitcoder on Thursday April 23, 2015 @03:11PM (#9429101)
Google also uses Haskell for Ganeti, their cluster-based virtualization management software. [0]

Why does Ganeti use Haskell?

Ganeti first used Haskell as an experiment when we needed a compiled language that could perform fast computations on cluster metadata. Eventually, we found that Haskell had advantages in its type safety that made it easy for us to develop better code with fewer common errors without having to write extensive “type-specific” unit tests. At this point, we decided to expand our use of Haskell.

As of January 2014, we plan to convert only “infrastructural” code (job queue, locking) that was already very complicated in Python to Haskell. We’ll continue to use Python for Logical Units, backend RPCs, and hypervisor, storage, and networking implementations.

There are two main reasons why Haskell constitutes a low barrier:

- Haskell doesn’t have any runtime dependency on the target systems.

- For setup, Haskell only requires a development environment.

[0] https://code.google.com/p/ganeti/wiki/GanetiFAQ#Why_does_Gan...

Re:Elixir vs. Erlang: a question of momentum by istvan__ on Thursday April 23, 2015 @11:02AM (#9427172)
Exactly, Erlang is a highly concurrent distributed system out of the box but this does not mean too much for Rails developers, on the other side the syntax is kind of hard to get used to. I think this is primarily why Elixir was created. I think if we see the usage or Erlang in the world it has enough momentum already and it proved itself with empowering startups like WhatsApp. On the top of that, the Erlang community is absolutely amazing. I guess I don't understand what the author means in terms of momentum. Is Erlang popular on Github? Certainly not. Should we use this to measure momentum? I don't think so.
Re:Elixir vs. Erlang: a question of momentum by alxndr on Thursday April 23, 2015 @05:56PM (#9430136)
José Valim has repeatedly said that he did not create Elixir to be a whitewash of Erlang's syntax.

http://devintorr.es/blog/2013/06/11/elixir-its-not-about-syn...

Re:Elixir vs. Erlang: a question of momentum by MCRed on Thursday April 23, 2015 @06:07PM (#9430203)
No, but it is part of the reason for its popularity.

I think it's silly that we have a generation of programmers who are unwilling to learn a language without a C or Ruby like syntax.

But I must admit that I find Elixir easier to read and more comfortable than Erlang.

Re:Elixir vs. Erlang: a question of momentum by steveklabnik on Thursday April 23, 2015 @10:35AM (#9426951)
> the latter still never "broke out".

Crossing the Chasm strikes again. In general, grabbing the early adopters doesn't inherently mean you'll be successful.

(Not that everyone wants to cross said chasm. Haskell's motto has been 'avoid success at all costs' for a while now, if I remember correctly.)

Re:Elixir vs. Erlang: a question of momentum by tel on Thursday April 23, 2015 @10:39AM (#9427000)
To be clear, SPJ has apparently clarified that to "avoid 'success at all costs'". :)
Re:Elixir vs. Erlang: a question of momentum by david-given on Thursday April 23, 2015 @10:59AM (#9427161)
...surely that should be "avoid $ success at all costs"?