Benchmarking Phoenix vs. Rails vs. Sinatra vs. Express vs. Martini
github.com
github.com
I have experience with Sinatra and Rails and I did a small project with Elixir and Phoenix in September. My bet before looking at the benchmarks was Phoenix >> Sinatra > Ruby, and that's the way it turned out to be. I was curious about how Martini and Node would compare.
That said, I enjoyed developing with Phoenix and it's really similar to Rails in its structure. The differences are about having views+templates (decorator pattern) instead of Rails' plain views (which would be Phoenix's templates) and having first class handlers for websockets. The developers of Phoenix answered quickly to all my questions and to the issues I opened on GitHub (it's still 0.x software in heavy development).
Anyway I still can't use it to replace Rails in the projects I do for my customers. There many reasons for that, some about Phoenix and some about me.
1) There aren't enough developers and it won't be wise for a customer to become too dependent from me (or any other developer)
2) There isn't an ecosystem comparable to the Rails one yet. Example: it can take forever to develop a replacement for all the basic functionality a Rails developer gets for free from a gem like devise (everything that revolves around authentication).
3) There might be many useful tools from the Erlang world but it takes time to learn them and become decently productive with Erlang and Elixir. How to make decent money while going back so many years productivity-wise? Obviously this applies to any transition to any ecosystem.
4) Performances usually don't matter at all: most servers have to sustain only low loads and Rails is good enough for that. In 20 years I probably had to work with only two web applications were speed really mattered. One was done with Java, the other one was PHP+Java and it was constrained more by the db than by the frontend. However I would consider Elixir right now for any heavily concurrent server, let's say a game server with thousands of players.
That is not to be underestimated. Many frameworks will provide better throughput but consistent low latency is harder to do and Erlang's BEAM VM does it. It is really a marvel of engineering and has been battle tested for decades.
If you say use Negroni, you might as well say use net/http (which is fair enough, since it's a low-level framework in itself).
It adds better support for UTF8, better metaprogramming tools for declaring custom constructs, a standard library for things like collections and streams, proper default setup for some use of OTP patterns, and various other things. It adds a few sane default conventions for things like documentation, testing, and private/public visibility in modules.
It in turn transpiles to Erlang, so has all the same performance characteristics.
It's baller as hell. :)
1.) Elixir ships with a build tool called Mix. Falls back to use rebar for erlang projects. Mix is awesome and IMHO way more stable that rebar (Had problems with erlang libs shipping diff versions of rebar binaries in the git repo itself).
2.) There's a really good package manager - Hex.pm (developed and maintained by Elixir's co-author Eric)
3.) OTP compliant config.
4.) Pipes ~! This for me has been a very useful feature to decongest my code. I'm not sure what project had pipes first (should we credit F# or Unix shell itself?). Having that feature in Elixir is a boon for me.
Finally about Phoenix:
* More mature that most people think. It has a few features that even rails doesn't have (or even cannot handle in real world scenarios). There's support for "transports", which allows people to use polling or websockets and such if your apps need it.
* Phoenix not having an ORM doesn't make a diff. Elixir's core-team develops and maintains Ecto, which is easy to drop it and start using. Ecto still has a long way to go, but for most apps, it is sufficient.
* Authentication? Very simple to write a plug for that and share it across all Elixir frameworks. AFAIK someone wrote plug for OAuth.
You'd have to go with unix out of those options, F#'s pipe operator is just flipped function application, and is primarily to make up for the poor type inference F# has. Every functional language has or can easily have a function application operator.
tl;dr there are good innovations and bad things, not a surprise :-)
[0] http://devintorr.es/blog/2013/06/11/elixir-its-not-about-syn...
The fact that Elixir has the same semantics is really a good thing, because it makes it much easier to learn both languages at the same time and that is still pretty much essential in my opinion, if you want to become productive in Elixir.