Live data from Hacker News

Programming in Elixir with the Phoenix Framework

gogogarrett.sexy

11–20 of 28 posts

Re: Programming in Elixir with the Phoenix Framework

#11
post #2

Nice writeup. I hadn't looked at Phoenix yet. It seems that many Elixir people come from Ruby. One thing we should be wary of is making shallow ports of Ruby concepts into Elixir, when there's much more elegant approaches available. We, software engineers, have a tendency of doing this: for example, there's a whole bucketload of C# libraries that have Java roots (NHibernate, Spring.NET), and every single one of them…

Phoenix creator here. Please take a look at my ElixirConf presentation where I exactly address your concerns. We're very much not out to replicate Rails and we are leveraging Elixir's strengths. As Dave Thomas said "Why replicate when you can innovate?". I very much agree. Our realtime Channel layer shows this off. That said, we have borrowed a few ideas from Rails where they make sense. I think Rails got a lot more…

Awesome, thanks. Will watch!

Re: Programming in Elixir with the Phoenix Framework

#13
post #8
post #5

Earlier quoted context omitted.

> We should avoid making Elixir a Ruby-on-Erlang when it has the potential to be so much more. Elixir is fool-proof from turning it into a "Ruby on Erlang" simply because it embraces and improves on Erlang's programming model. Some libraries are ported over from Ruby. But there are also libraries ported from other languages and libraries that have been written for Elixir specifically. Just a heads up: please don't ma…

When I wrote "we should avoid making Elixir a Ruby-on-Erlang", i meant exactly that. I didn't mean the sugar-coated American oh my god how can I say this without being direct version of "we're making Elixir a Ruby-on-Erlang and this has to stop". Sorry if you were offended, but I think you're reading more in my comment than there is. Elixir is young enough that it can go many directions and it depends on the early li…

I wasn't implying anything beyond the quoted phrase. My last remark was targeted at anyone reading the comment, I didn't mean to sound condescending towards you.

I don't share your belief that early libraries and frameworks have the potential to override Elixir's broad domain. In other words, even if there will be a widely popular library/framework for Elixir, it won't automatically negate its other strength or fitness for a wide range of uses.

During the recently held ElixirConf we've seen it used in a telecom company, also powering game servers, distributed robots, and hobby projects like an elevator controller and command-line applications. The community already has a diverse set of interests and many of us will be pushing the adoption in our respective areas of interest.

In any case, our best effort today would be to continue hacking and having fun with Elixir, and at the next year's conference we'll be able to see in which direction the trends go.

Re: Programming in Elixir with the Phoenix Framework

#14
post #2

Nice writeup. I hadn't looked at Phoenix yet. It seems that many Elixir people come from Ruby. One thing we should be wary of is making shallow ports of Ruby concepts into Elixir, when there's much more elegant approaches available. We, software engineers, have a tendency of doing this: for example, there's a whole bucketload of C# libraries that have Java roots (NHibernate, Spring.NET), and every single one of them…

We had a lot of conversations about this and it was a somewhat common topic during ElixirConf ( http://www.confreaks.com/events/elixirconf2014 ). On my keynote I addressed exactly your concerns: it is fine to do "X in Elixir", which is a very helpful learning exercise, but remember to revisit it later, otherwise you will have a project that misuses or does not fully uses this new environment. Dynamo ( https://github.…

I really appreciate your attitude. You are really inspirig people like me to understand it is okay to make mistakes :). Also, every mistake teaches you something. Learn from your mistakes and keep building things that matters :).

Needless to say, I am becoming a fan of yours :)

Re: Programming in Elixir with the Phoenix Framework

#16

Earlier quoted context omitted.

We had a lot of conversations about this and it was a somewhat common topic during ElixirConf ( http://www.confreaks.com/events/elixirconf2014 ). On my keynote I addressed exactly your concerns: it is fine to do "X in Elixir", which is a very helpful learning exercise, but remember to revisit it later, otherwise you will have a project that misuses or does not fully uses this new environment. Dynamo ( https://github.…

I really appreciate your attitude. You are really inspirig people like me to understand it is okay to make mistakes :). Also, every mistake teaches you something. Learn from your mistakes and keep building things that matters :). Needless to say, I am becoming a fan of yours :)

Thanks for the nice words! I appreciate it!

Re: Programming in Elixir with the Phoenix Framework

#18
post #2

Nice writeup. I hadn't looked at Phoenix yet. It seems that many Elixir people come from Ruby. One thing we should be wary of is making shallow ports of Ruby concepts into Elixir, when there's much more elegant approaches available. We, software engineers, have a tendency of doing this: for example, there's a whole bucketload of C# libraries that have Java roots (NHibernate, Spring.NET), and every single one of them…

> We should avoid making Elixir a Ruby-on-Erlang when it has the potential to be so much more.

I agree and share the enthusiasm. However, I feel like Elixir gets a bad rap just because how similar it looks to Ruby. I feel that other languages, such as HN's current darling Go, and Node.js actually have way more Ruby/Railsism libraries than Elixir does. In Go, there are hundreds of libraries with the tag line "Like but for Go!". The same goes for Node.js, but that number is probably in the thousands. In Rust, someone has actually tried to port ActiveSupport to Rust!

Syntax aside, the only influences Ruby has on Elixir in current day is the virtue of creating joy to use tools. Mix is a great example of this. Which is great, because that is by far Ruby's greatest strength and is the only Ruby influence I would want in Elixir, having been a Ruby user for many years.

When you start to get familiar with Elixir, you realize it is far more influenced by Lisp/Clojure and Erlang than it is Ruby.

Re: Programming in Elixir with the Phoenix Framework

#19

I'd love to see someone who knows Exilir/Phoenix to submit it to the Web Framework Performance Shootout [1]. [1] http://www.techempower.com/benchmarks/ Edit: typo

I'd love to see Phoenix represented there. I'll see what's required to get it added.

Re: Programming in Elixir with the Phoenix Framework

#20
post #6
post #3

Earlier quoted context omitted.

From the little that I know of Elixir, the overloaded methods with pattern matching on the arguments is Elixir-ish.

Indeed, and that's not what the blog post's router code does.

It is in fact what is done with the blog post's router code.

Phoenix gives a high level DSL for routes, which is created using macros that result in a pattern match: exactly the alternative suggested.

For example: http://slides.com/chrismccord/rise-of-the-phoenix#/7

Thus you get the convenience of writing routes the way you want, and the resulting code has the speed of pattern matching.

Post reply on HN