Elixir/Erlang almost couldn't be more different in this regard, which basically embrace runtime failures (things fail, so... "Let it fail quickly"). An uncaught runtime error in Elixir/Erlang causes the node to shut down after logging the error and, if it has a supervisor node (which is quite likely), the node is restarted in a fraction of a microsecond. The developer is expected to monitor the logs and watch for common faults and fix those. This is in fact where the "nine nines" reliability comes from- restarting nodes extremely quickly after runtime errors.
The Erlang philosophy is basically, "these systems exist in the real world, which is sometimes unpredictable and flaky... accept it and allow the code to move on quickly." This happens to be a good strategy for website code- Remember that Erlang was built to run cell networks... How often are cell networks down these days?
I was also a "disenfranchised" Ruby guy, tired of working on classes of bugs that would never even see the light of day in a functional language, which is why Elixir's syntax was appealing (I had already looked at Erlang, but I didn't like its syntax). Again, there's taste and opinion here, of course. Coding has become awfully fashion-driven, of late.
There's a class of programmers who don't care about syntax or don't see the point of it. Ruby/Rails folks are not typically that type of programmer, and that's the first group who will likely migrate to Elixir.
Finally, what really raised my eyebrows about Elixir was its macro facility http://elixir-lang.org/getting-started/meta/macros.html Prior to Elixir, full-fledged macros were only a feature of homoiconic languages (the Lispy ones where the syntax is also a data structure). Elixir came up with a clever way to do macros, while retaining syntax.
> Again, there's taste and opinion here, of course. Coding has become awfully fashion-driven, of late.
I agree and that's a really enlightened view. But I'm quite glad - it means the ecosystem is maturing if we now can be fashion driven, rather than having to care about "does it work?"
Its a completely different language, with a completely different set of people thinking it is the way to go going forward. They have very little in common.
> Or where Go didn't live up to its promises?
As there are in the present, there will probably be more than one significant web application language in the future. Its not impossible that Go and Elixir could both be among them. Its not really an XOR type of situation.
I'm also not sure elixir is so great (not enough experience with the language and no time to try it right now) but at least at a glance it seems to put a cleaner face on some of Erlang's strengths, so at least it brings something new to the table.
And looking at the state of competing and ever-growing landscape of Javascript frameworks, I'm not convinced multiple big things is better.
1. elixir is less strongly typed than go
2. elixir is more purely functional
3. elixir has a smaller community and is less backed
[1] http://jlouisramblings.blogspot.com/2013/01/how-erlang-does-...
1. Real-time baked in.
2. Uses Javascript (tons and tons of developers know at least enough to use Meteor)
3. Sane templating engine.
4. Same wow effect I had when I first started Rails.
5. Fantastic build system.
Pheonix and Elixir may be the bees knees, but unfortunately because it uses a functional language, it drastically cuts down the mindshare of developers. I don't even know any developers in real life that use functional languages. Looks interesting but that's the reality.
2. Tons of programmers know JavaScript well enough to avoid it. A language originally thrown together "to make the monkey dance" is generally a poor choice.
3. Sane templating engines are a dime a dozen. I could probably find 5 in Python alone.
4. Same later realization that it's really good at a few things at the expense of others, I'd bet.
5. Okay I'll cede one point.
> Pheonix and Elixir may be the bees knees, but unfortunately because it uses a functional language, it drastically cuts down the mindshare of developers. I don't even know any developers in real life that use functional languages. Looks interesting but that's the reality.
That says more about you than about the quality of tools involved. I'd rather have quality of mindshare than quantity.
1) Once upon a time, almost no one used object oriented languages except for Smalltalk weirdos.
2) Ruby, javascript and a host of other languages have "functional" features. Does your language have a "lambda" feature, where you can define nameless functions and pass them around as arguments to other functions? Then you are already working with functional language paradigms. There's nothing really "magically hard" about it, you're overselling how hard it is. This is not rocket science. Most existing programmers can handle it.
The hardest thing I had to wrap my mind around when switching my work to Elixir was letting go of mutable state. And attributes and methods on objects. And guess what... It seems that it's a good idea, generally!
If you see enough bugs that are only there because something modified an attribute in some unpredictable way which impacted upstream code... You will realize mutable state is bad.
If you still aren't convinced that mutable state is evil, watch this Rich Hickey presentation http://www.infoq.com/presentations/Are-We-There-Yet-Rich-Hic... which basically proves that mutable state actually makes state a function of a hidden/conflated "time" variable, proving it's not just wrong from a practical standpoint (in the form of extra bugs that are hard to reason about, and all this brittle mutex code) but from a theoretical one, too. Mutable state comes from a time when memory was expensive, and it's time to ditch the training wheels so we can get the real work done.
Both Javascript and Ruby use mutable state extensively, and it's unfortunately not something you can just slap onto the language after the fact (although ClojureScript must make a valiant effort!) And if the high-level language wasn't built with it from the get-go, then you're stuck dealing with legacy libraries using the poorer-written code (see: Ruby gems).
Another fad brought up for the sheer fashionability of it.
Saying "mutable state is bad" is just as inane as saying "immutability is bad". There are tradeoffs for either. There is absolutely no reason to pretend that one trumps the other in all cases.
Other than looking cool to your peers, I guess.
I'm doing this at present and there is no special difficulty.
And things like package management, build tools, meta-programming, unicode handling and web frameworks are not as straight forward as in languages such as Ruby.
Erlang's module system means that a chunk of the raison d'etre behind language-specific package managers is already alleviated. The rest - dependency management and building, is handled quite well by tools like Rebar. One can also leave Rebar as a dependency tool strictly (which is its primary purpose anyway) and use whatever they like for a build system. Plain old Makefiles can work just fine, and it's not like most language-targeted build systems aren't some shiny variation of make, anyway.
Metaprogramming isn't quite as easy as in many OO languages, but it's hardly out of reach. The parser, the lexical scanner and other components are all exposed as Erlang modules, and there are projects such as the BossDB ORM that use parser transforms to provide features such as parameterized modules, which allow for using Rails-like ActiveRecord patterns, among other things.
Unicode handling? I think this might be a knock on Erlang's string handling. Strings are represented as iolists of Unicode points (integers) which goes with much of Erlang's philosophy in lists and tuples as being the prime data types. Space efficiency and real-world usage usually has strings passed as binaries, but most web frameworks and libs can handle them plainly nonetheless.
Web frameworks? Chicago Boss for a Rails-like, Nitrogen and N2O for real-time and extremely high load applications, or even just plugging in to web servers like Cowboy or Yaws can be enough for a RESTful backend.
Sure, modules provide a way to "package" functions, but that is 5% of what a package manager does. Being able to distribute, fetch and do dependency resolution is certainly the bulk of it.
I definitely prefer my deployments to rely on packages than fetching git repositories from Github and Bitbucket. There are recent discussions in Erlang mailing list regarding packages and the OTP team (the team behind Erlang) is looking into package managers too.
> The rest - dependency management and building, is handled quite well by tools like Rebar.
Sorry, Rebar does not handle dependencies well. Rebar does not even guarantee repeatable builds. Once I fetch dependencies on my machine, my co-worker can end-up with versions different than mine and that is dependency management 101.
Rebar 3 seems to improve in this area but is still alpha. erlang.mk idea of package manager is a file on github in tsv format (and still no repeatable builds).
> Unicode handling? I think this might be a knock on Erlang's string handling.
Erlang needs better unicode support, regardless of using lists or binaries. Strings support only latin1 in literal format. If I want to write my name as a binary, it needs to be written as <<"paweł"/utf8>>. This is nowhere close to acceptable to anyone that has to write strings in formats other than latin1.
Things are getting better in Erlang 18 but there won't be any conveniences for handling unicode. There is no function to calculate the grapheme length (essential if you want to support languages like japanese or korean and do a size validation on an input), to convert to lowercase/uppercase and so on. Be it if the underlying representation is a list or a binary.
Please God the Erlang/Elixir community don't invent another package manager. Pip, easy_install, gem, npm, composer, bundler, bower, maven and all the others I don't know about - we've got enough as users to remember the variations in syntax for. Let alone the duplication of effort in developing and maintaining the package managers, when their clever creators could be working on other problems.
I think you're setting the bar a little high there. Reproducible builds is something that most package managers, OS and language-specific alike, struggle with to this day. Only Nix and Guix have complete solutions, I think.
As for Erlang string handling: [175,95,40,12484,41,95,47,175] ;)
The good thing is that Erlang and Elixir can benefit from each other. For instance https://hex.pm which is made in Elixir, but can also be used for Erlang projects.
I don't know about other languages, but having personally migrated from Perl and Ruby to Erlang/Elixir, I at least believe that to be the case in that particular circumstance.
A big part of it is that parallel programming is starting to catch on as mainstream rather than something to be shunned or avoided; whereas in the past folks were conditioned to avoid having to deal with threading or forking because of having to think about thread safety, there are now languages like Erlang (and its kids Elixir and LFE), Rust, Go, Scala, Julia, etc. that are meant to make parallel computing easier to reason about or less dangerous (or sometimes even both).
On top of this, though, Erlang-and-kids' reliability features allow them to achieve the legendary "nine-nines" of uptime (99.9999999%) relatively easily (I say "relatively" because - while you certainly still have to think about it (particularly if you're trying to push a change to, say, how data is represented on the (D)ETS or Mnesia or CouchDB or SQL or whatever side of things) - it's much easier than with a lot of other languages). That level of availability has huge implications for a company's bottom line, particularly those companies that measure downtime in "thousands of dollars per second" instead of just seconds. A well-written Erlang/OTP (or Elixir/OTP or LFE/OTP or anything/OTP) application can do this on the software side rather effectively (on the hardware side, you'd still want redundancy wherever possible/feasible, including on the network side of things; most well-run hospitals, for example, will have connections with at least two different ISPs so that if one goes out, they still have the other, and will only lose connectivity in very extreme circumstances).
In the case of Elixir, it makes for a very solid migration target from, say, a Rails codebase; the syntax is a bit more modern (I personally prefer Erlang's in many cases, but Elixir's pipe operator is a godsend) and familiar to Rubyists ("do" blocks, more flexible pipelining with the |> operator, etc.), while being fully compatible with the existing Erlang and growing Elixir ecosystems.
Are you a developer because you don't want to keep learning? Maybe you walked into the wrong room? ;)
> What, people will now have to port all Ruby libraries to Elixir (or, at the very least, relearn them), and then a few years down the line to the next thing? Isn't this a huge waste of effort?
In this case, Elixir actually has a selling point, as Erlang has existed for over 20 years and has its own fairly mature box of tools (which are all easily accessed from Elixir).
From a bigger picture, a lot of code construction of late has moved to a SOA paradigm, in which case you can still call into perfectly-working Ruby codebases, except as a client from another language.
Don't you rather be learning new concepts rather than new syntax/APIs? Not that Elixir doesn't bring new concepts to Ruby developers (it does), but even so, I think switching a language for production code has a terrible cost/benefit ratio compared to learning a new algorithm or even a new approach without switching a language.
Since when has "learning" in CS meant adopting a new language?
"In this article I will explain why I think the Elixir language will make a big impact in the world of web development."
:)
I wanted to know which direction Elixir is going to take? Will Elixir be mostly compatible enough with Ruby so that Rails can run directly off on Elixir?
Is there a plan to change Rails enough to run on Elixir?
How does the community feel about Elixir? I'm certainly interested in the concurrency aspects of Elixir (ie. no GIL) and everything else that Erlang has to offer.
The developers of Elixir were core Rails developers so please forgive me if I'm getting the wrong impression here.
Elixir is not even approximately compatible with Ruby, nor is it intended to be. It just has syntax that is very loosely reminiscent of Ruby. Someone might one day write a Rails-like framework for Elixir, but it will never be the same Rails that runs on Ruby.
OTOH, if you want something no GIL that can run Rails, there is always JRuby.
Most likely not. However, it might be possible to run Ruby programs in OTP-style supervision trees, thus managed by a supervisor written in Erlang or Elixir of LFE or some other BEAM-based language and thus made able to leverage some or all of the advantages of Erlang (a good potential proof-of-concept would be a replacement for Puma or Unicorn or Passenger - in other words, a Rack-compatible web server (or wrapper around an existing web server, like Cowboy) written in Elixir or Erlang or LFE or what have you).
> Is there a plan to change Rails enough to run on Elixir?
Also most likely not; most of the Rails community is currently heavily dependent on the Ruby ecosystem, and there's not really much of a point in changing that.
That isn't to say that there's no place for Elixir in a Rails development framework; there are plenty of Rails shops that use Erlang for dispatching requests to Rails instances (I believe Github is one such shop).
> How does the community feel about Elixir?
The Elixir community obviously feels elated :)
The Ruby/Rails crowd is a bit harder to read. I personally work for a Rails consultancy, and right now my coworkers don't seem universally interested in it quite yet. That may change in the future, though, especially as more folks realize the merits of using Elixir and Ruby side-by-side and more packages (whether from the Ruby side or the Elixir/Erlang side) are developed to allow easy communication between those two worlds.
The Erlang community seems to be mildly positive about it. At least one of Erlang's original creators has expressed a modestly-positive opinion of Elixir's direction (with a particular excitement about Elixir's Clojure-inspired "|>" (pipe) operator - something that a lot of Elixirists seem to like using, myself included). There's some deviation from the more Erlangy ways of doing things, however, and it's not as mature as Erlang itself, so (from what I understand based on my observations of the Erlang community - particularly mailing lists and conference recordings/transcripts) there's still a bit of resistance there.
But... the last commit was 9 months ago. Weber is dead. If you're interested in doing web stuff with Elixir today Phoenix is what you want.
http://sugar-framework.github.io/
(disclaimer: I'm one of the collaborators on the project)
It was temporarily "abandoned" because Ericsson had (has?) a policy forbidding the use of non-free languages. In response, the Erlang devs open-sourced it, and now (IIRC) it's not banned anymore.
> Can anyone explain what is Erlang Public License?
It's derived from the Mozilla Public License. It differs mainly in terms of legal jurisdiction (i.e. Swedish law being specified as the applicable legal jurisdiction).
> Why not something like Apache, GPL or MIT?
Good question. The answer's probably similar to the reasons why Mozilla created the MPL (partial copyleft, in contrast with the GPL's strict copyleft, and with the Apache's and MIT's and BSD's and crowd's copycenter/copyfree).
Can anyone give more information on the nature of Elixir's type system? Without digging into the docs I see elixer-lang says that its dynamically typed, but how strongly typed, is it robust, does it have ADTs, inheritance, etc?
edit: looking an inch deeper, I see that it has 'protocols,' which seem like typeclasses, and 'typespecs,' which seem like gradual typing
This doesn't work with Elixir directly, but rather BEAM byte code (Erlang VM) which Elixir compiles down to.
I remember hearing the "genesis story" of Elixir. IIRC, José was working on ensuring Rails was thread safe. He did so, but was dismayed with the difficulty and felt like he was fighting Ruby. So he stepped back, and thought that if concurrency is the future, he should find a better language for it. He looked into immutable, functional languages (Haskell, Clojure, Erlang), and realized that Erlang is built for an arguably harder problem: distributed computing, and made the connection that concurrency is sort of a smaller case of that. He worked with Erlang for awhile before deciding that it could be improved by building on it.
Going through the Elixir tutorial and seeing how you could "simulate" state, by spinning up an infinite loop in another process and sending messages to it was mind bending. And learning about Erlang's OTP principles has made me really think about robustness differently. I really do hope Elixir/Phoenix become the next big language and web framework.