Live data from Hacker News

Phoenix 1.0

phoenixframework.org

171–180 of 228 posts

Re: Phoenix 1.0

#172
post #89

Earlier quoted context omitted.

Phoenix shares many features with Ruby on Rails, e.g. a strong MVC model, an integrated ORM, a routing system, etc. What Phoenix on Elixir excels at is concurrency and distributed computing. For applications, this means you can have many active web sockets, for instance, where Rails applications tend to break down when you have too many active connections. Phoenix uses erlang processes for these tasks, which are ligh…

Another example: I work on a Rails app where the user submits a request to us, and we have to talk to an API to respond. We can't afford to leave the connection open with the user, so we make them poll for results. My understanding is that the cheap processes of Elixir would mean we could just keep a connection open to that user if we wanted to. Similarly, no need for a background processing framework like ActiveJob;…

That's right. Because Elixir is 10x faster than Rails, we don't need to worry about caching so much. And because it supports cheap concurrency, we don't need to offload long running tasks to a background task. So the overall structure is simpler.

And this works across the whole architecture. One of our projects right now is a mobile medical application for medical where caregivers communicate in real time with a number of patients. We have the mobile app talking to the server using a REST API and real time messaging for chat. The caregivers can communicate with the server using a web application with integrated web chat or via an XMPP client. And we have the normal public web and admin CRUD. All via a single server process in a single language. This is what Elixir/Phoenix was made for, it enables a new generation of modern apps.

Re: Phoenix 1.0

#173

Earlier quoted context omitted.

You are probably more productive in Elixir at the early stage of development. However, I personally think Go would be better for long-term development because it is statically typed. You can read more about pros and cons of statically and dynamically type languages [1] [1] http://programmers.stackexchange.com/questions/122205/what-i...

I've used both Go and Elixir so here's my thoughts: Elixir/Erlang aren't your typical dynamic language. Elixir is compiled and has pattern matching. I catch a ton of bugs at compile time in Elixir that I would never catch in Ruby/Python/JS until runtime. Examples of these are misspelled variables/bindings/function names and pattern match that will never actually match. Those are really, really common time wasters all…

You can handle misspelled variables/bindings/function names in Ruby/Python/JS by linting. That's a class of errors that's easy to avoid anywhere with a good text editor.

Re: Phoenix 1.0

#174

Should there be concern using Phoenix given the low performance rank of it on the Web Framework benchmark? [1] [1] https://www.techempower.com/benchmarks/previews/round11/

As noted on that page:

> WARNING: Preliminary data! Errors, anomalies, and other peculiarities should be expected.

We sent them a PR as their example app was doing things like html form CSRF token generation, session fetching, and heavy logging, - all for JSON apis. Phoenix has pipelines to explicitly segregate these kinds of request overhead when they aren't needed. They also used a very low database connection pool size. Hopefully they merge the PR shortly, and re-run the tests to properly represent us. See own series of benchmarks here: https://gist.github.com/omnibs/e5e72b31e6bd25caf39a#results

Re: Phoenix 1.0

#175
post #61

Slightly off-topic, but can someone familiar with both Elixir and Erlang explain what Elixir provides in comparison to Erlang. I'm looking into using Erlang for a new project that requires extensive scaling and concurrency and am coming from a functional background so may be more comfortable with the traditional Erlang syntax. However it seems that perhaps more development and activity is happening on the Elixir side…

Coming from an Erlang background, I found it very easy to get started with Elixir, it has the same underlying concepts and power as Erlang. Elixir takes it to the next level, though. The syntax eliminates annoyances in the Erlang system, e.g. having to fool around with punctuation and work with binary strings. The Elixir standard library gets rid of inconsistencies in the Erlang libraries and it is organized to allow easy chaining via the |> operator. Then it has features like protocols which give the encapsulation and polymorphism of OO without needing objects. And finally we have macros, which are the "right way" to do metaprogramming, allowing ease of use at a Rails level without the mess underneath.

Another big thing is that the Elixir community focuses on ease of use and out of box experience the way the Rails community did. So it's easy to get started and all the pieces generally fit together well, e.g. the mix build tool works great, as does the hex package manager, and relx release builder. With Erlang it's more DIY. We have recently converted a big Erlang project to use mix as the build tool, and it just eliminated a bunch of cruft. The interop between Elixir and Erlang is easy. So you get the best of both worlds, the ease of use of Elixir with the power of Erlang, with the highly mature runtime and libraries. And with Phoenix we get a web framework with world class ease of use.

Re: Phoenix 1.0

#176

Earlier quoted context omitted.

my employer uses erlang because it's a huge leap forward operationally over ruby/python/go/java. the erlang/otp concept of a release is extremely straightforward and reliable and the beam (erlang/elixir vm) run time introspection and debugging tools are second to none. it's trivial to attach to any running application and get a REPL with full access to the environment. you can even update running code in place

how do people typically put security (authentication and authorization) around this? You wouldn't want just anyone to be able to connect to your running apps, of course. From what I saw in Elixir, there's some kind of cookie/session key that you can specify, but is that it or is there more?

we're on aws, so we use vpc with security groups that limit connections to our vpn or a bastion server at our network edge

i'm not aware of anyone running an erlang or elixir repl over http but it would be an interesting project

Re: Phoenix 1.0

#177
post #26

When people choose to build on a more esoteric language such as Elixir (and to lesser extent Erlang) is it because what they want to do simply is not possible in Ruby/Python/Go/JavaScript/etc or just less efficient, elegant, productive, etc?

I did. I love Rails. Love it. Love Ruby. I've been writing code for over 25 years this year, and I've been doing Ruby for 10. And I hit a big brick wall with a very websocket-heavy app I'm building.

I switched to Elixir and Phoenix last year and got the core of my app working.

It's funny though - the core is easier. But many freebies from Rails aren't there yet. So I still don't have password recovery emails or confirmation emails on signup done yet :)

Re: Phoenix 1.0

#178

Earlier quoted context omitted.

You are probably more productive in Elixir at the early stage of development. However, I personally think Go would be better for long-term development because it is statically typed. You can read more about pros and cons of statically and dynamically type languages [1] [1] http://programmers.stackexchange.com/questions/122205/what-i...

I've heard this argument before. For a long time, actually. But the kinds of errors I have are only rarely related to type issues, and those are almost always caught very early. YMMV, that's just been my experience.

If you haven't used a good type system (which has at least algebraic data types and pattern matching), it's hard to realize how many of those bugs might actually be type issues.

Re: Phoenix 1.0

#179

Earlier quoted context omitted.

how do people typically put security (authentication and authorization) around this? You wouldn't want just anyone to be able to connect to your running apps, of course. From what I saw in Elixir, there's some kind of cookie/session key that you can specify, but is that it or is there more?

VPC?

Virtual Private Cloud. Amazon's "branded" term for a private cloud with strict firewall inbound access protection.

Re: Phoenix 1.0

#180
post #26

When people choose to build on a more esoteric language such as Elixir (and to lesser extent Erlang) is it because what they want to do simply is not possible in Ruby/Python/Go/JavaScript/etc or just less efficient, elegant, productive, etc?

I did. I love Rails. Love it. Love Ruby. I've been writing code for over 25 years this year, and I've been doing Ruby for 10. And I hit a big brick wall with a very websocket-heavy app I'm building. I switched to Elixir and Phoenix last year and got the core of my app working. It's funny though - the core is easier. But many freebies from Rails aren't there yet. So I still don't have password recovery emails or confi…

But you woudn't need gems to for recovery emails right?
Post reply on HN