Hacker News new | ask | show | jobs
by gleb 3821 days ago
We are rewriting an internal Rails application in Elixir as a test project. I like what I see so far. Elixir/Phoenix promise it to be like Rails but 10x faster with 1000x less memory use and better concurrency. Our preliminary data is that it does deliver that.

But there are definitely problems.

The only one that really concerns me is Ecto and its integration in Phoenix. It makes simple things hard and hard things impossible.

More generally, I don't get the feeling that Phoenix was "extracted from a production web app" like Rails was. With Rails you knew there was at least one app, Basecamp, that worked on top of it. With Phoenix I am not so sure. This is a very preliminary opinion, but first impressions matter.

This specifically applies to Ecto and it's Phoenix integration. The rest of Phoenix seems perfectly nice, and fixes a lot of Rails' warts.

The rest of downsides are not a big deal, and time will fix them:

There is no installed base to speak of. You'll be the first one to run into many problems. 3rd part libraries are not there/not mature. It's missing a lot of basic scripting language functionality (e.g. wrappers over libc functions). Some code comes out verbose and hides the intent (though most of it is surprisingly nice, often as good or better than Ruby).

3 comments

I would love to hear more about the Ecto/Phoenix integration and what feels hard and what feels impossible. Feel free to shot me an e-mail or ping me on IRC.
Email WIP.
Email sent.
I don't think the point of Phoenix is to be like Rails. It always struck me as being aligned more toward something like Sinatra. ?

One thing Elixir definitely needs is a killer app or framework that really plays to the strengths of its Erlang underpinnings. A web framework is probably not that app/framework.

Those already exist with extreme maturity in other ecosystems. Scaling the web framework part is pretty easy since, unless you royally screwed up your design, you should be able to just add more stateless web heads to service more requests and you almost always should end up ultimately bottlenecked at the persistence layer, not in the request router/processor.

I just don't know what that killer app/framework will be.

Phoenix is much closer to Rails in terms of its goals than it is to Sinatra. It's a full-featured framework with asset handling, a recommended file layout, template discovery and compilation, generators, etc.

As far as I can tell, most projects one might use Sinatra for are done in Elixir by just working with Plug directly (Plug being the Elixir analogue to Ruby's Rack). I'm sure there are many lightweight web frameworks for Elixir out there, but I haven't seen any with Sinatra's level of ubiquity.

> It's missing a lot of basic scripting language functionality (e.g. wrappers over libc functions).

What libc stuff are you missing? (I'm rather interested in the answer to this question! :) )

It's entirely possible that the functions that you want are available in the Erlang standard library, which can be trivially accessed from Elixir.

E.g. mktemp and friends. Or more generally, a secure way to work with temporary files.

Subprocess control, e.g. popen seems different/hard. We are using Porcelain though, which is nice. This thread on the list about working with pty's didn't inspire confidence either: http://comments.gmane.org/gmane.comp.lang.elixir.general/457...

Another Unixy thing that's missing in a hard-to-believe sort of way is Unix domain sockets. Makes connecting to Postgres irritating.