5 ms·
I've been following Phoenix for awhile now and it's one of the first "shiny new things" that I'm genuinely impressed by...especially coming from Rails. Why? -
by mbesto 11y ago
I've been following Phoenix for awhile now and it's one of the first "shiny new things" that I'm genuinely impressed by...especially coming from Rails. Why?
- Out of the box, it solves the architectural performance problem that inhibits every Rails project by using the ErlangVM
- It's a fairly easy migration path for someone that has a Ruby/web-mvc background
- It's API-ready out of the box, which means connecting to devices, other services, etc is built into it's design
- Since it's functional programming by design, it means data manipulation is inherent to developing applications
I'm excited to see the adoption go up.
- thirdsun 11y agoSame here - the strongest argument for me are the performance benefits. I really like working in Rails but Ruby's general performance and memory handling tends to be a issue - when you run into problems it's hard to find the root. Looking forward to diving into Phoenix and Elixir.
- tclancy 11y agoSimilar here: I've been happily working in Django for a long time, but Phoenix/ Elixir has me intrigued.
- Cyph0n 11y agoI just find the Erlang style bizarre. I know it's a great language but I'm really don't see myself going the extra mile. I think Django is a good mid level framework that is good enough performance-wise for most cases. I'm now learning Play and Scala to take cover those high demand edge cases.
- izym 11y agoPhoenix is for the Elixir language which runs on the ErlangVM, and not for the Erlang language.
- Cyph0n 11y agoYes, I am aware of that. Elixir runs on the VM and as far as I know adopts many constructs from Erlang.
- innocentoldguy 11y agoWhat do you mean by that? If you mean Elixir borrows some of Erlang's esoteric data structures, like lists, then yes, you are correct. However, the language itself doesn't look anything like Erlang. It resembles Ruby more than anything else.
- derefr 11y ago> esoteric data structures, like lists I know they're not common in modern HLLs since we have magic do-everything array ADTs, but I find it kind of hilarious to describe (singly-)linked lists as "esoteric." Personally, I enjoy having (really cheap) lists around, and wish more HLLs had them as one of their fundamental, low-level abstractions. There's something extremely satisfying about accumulating elements backward by consing, and then reversing at the end. I'm always worried in Ruby/Python that push()ing elements onto an Array might do all sorts of stupid re-allocations at just the wrong time; lists, on the other hand, have extremely obvious time-space complexities for all their operations. That's something that can be said about all the Erlang ADTs, now that I think about it—each one has been carefully considered such that you can guess the time/space complexity for each operation and be correct. Erlang (and Elixir) also has a policy that if two ADTs both have an operation with the same semantics, but the two operations have different complexities, then the two operations will get different names—which is amazing for making bad ideas (like trying to do random-access on a list) obvious. (And really, while we're on the subject, it's tuples that are the weird Erlang type. As handy as they are as an underlying implementation for records et al, there isn't really much theoretical basis for having a set of N fixed-size non-enumerable product types, each with integer-indexed, untyped slots.)
- methehack 11y agoElixir feels like the functional language a ruby programmer might create. When you're programming in it, it feels like 90% of the power of ruby with 10% of the features. Instead of being constraining, I find the relative lack of features (compared to ruby) liberating. Elixir also has a supremely powerful and elegant macro capability that lets you build really powerful DSLs. For example, chunks of the language are written as Elixir macros -- the if 'keyword', for instance. As a programmer, you have full access to the very same macro system. Writing an unless 'expression' isn't even that hard. phoenix's use of Elixir's macro system is part of why phoenix can feel so much like rails. And yes, from the fragments I've seen of Erlang, the two are completely different. What Elixir wants from Erlang is primarily the VM and the OTP libraries. If you've seen Erlang and it scares you off Elixir, you've got it all wrong.
- simoncion 11y ago> I just find the Erlang style bizarre. It's odd at first, but has a few things going for it: * Its rules are consistent. * There are few keywords and symbols. * Once you understand it, you see that pattern matching on function heads or case statements is exactly the same as if/else statements. * Its standard library contains code that does a lot of the low-to-mid-level stuff you find yourself doing. * OTP provides nice templates for server-ish things and FSMs, as well as some nice conventions that get followed by a lot of Erlang software.
- deleted 11y ago[deleted]
- rozap 11y agoThe notion that Erlang is bizarre but Scala isn't is a particularly intriguing notion...but that's a different rant. I suppose the concurrency model of Erlang is a departure from The Way Things Are, but I'd argue that's a good thing. The JVM doesn't offer much fundamentally different in terms of the concurrency model than Ruby and Python. It certainly performs orders of magnitudes better, but it's still subject to a lot of the same issues: you have a pool of threads running your http service, and when you exhaust that pool then you have outages. And stopping the world for GC is enormously problematic. Erlang takes care of all that in an extremely elegant way. Also it doesn't take minutes (!!!) to compile an Elixir (or Erlang) program. Developer happiness is often overlooked (Scala being the worst offender in my experience) and Elixir really hits that out of the park.
- meowface 11y agoI've been comparing Erlang, Elixir, and Scala lately, and Scala seems to have both a nicer syntax and a nicer feature set than the former two. Scala is definitely C++-esque in being a bloated language. And it lets developers commit utter horrors. But if you stay away from those horrors (mostly new operators and DSLs) and don't use them yourself, it seems like a very nice and elegant language. You get the same functional programming and actor concurrency you would get form Erlang and Elixir.
- dudul 11y agoI honestly don't understand why Ruby developers are all so excited about Elixir/Phoenix. Don't hear me wrong, I think Elixir is an amazing language and I love using it, but it has nothing to do with Ruby, the paradigm is completely different. It makes me think that the only reason Ruby devs are so into it is just because the syntax is similar, which make them seem a little... shallow I guess.
- adambrod 11y agoI'm not a rubyist but it could be that their jaded with the current state of Ruby and constant performance struggles with Rails. Elixir has a similar community that's focused on testing, tooling, and quality. However I agree, very little Ruby syntax, just def & end for the most part.
- bratsche 11y agoI think Erlang just wasn't really on my radar before. I didn't know much about it and kind of just associated it with phone systems and didn't consider it for web. Elixir just came up on my radar and I started seeing a lot of smart people looking at it and Erlang, and so I did too. Now I kind of don't want to go back to Ruby. Part of it is that I like Elixir's syntax better than Ruby's, but mostly it's everything else. Ruby isn't very good at concurrency, so people making Rails apps have to move things to other services (sometimes in totally different languages) in order to get around this. As I've learned more about OTP I find that I can spin up different 'services' in the form of GenServers that are running inside the same VM, use supervisors to handle the inevitable crashes that will occur, and because the entire system is in the same language/VM it's a little easier to test. So far it all just feels less like some Frankenstein that's getting stitched together. :) Phoenix is nice too, but a lot of its niceness and power really comes from things lower than it in the stack: OTP, BEAM, Cowboy, Ecto, and mix. I really like Ecto so far, it feels more natural to me than ActiveRecord once I've gotten the hang of it, although it still has places where it is obvious that it's not quite as mature. One thing that Phoenix provides which is really nice (although I haven't made much use of yet) are the channels.
- innocentoldguy 11y agoI work with Ruby all the time, but the skin-deep similarity in syntax isn't at all why I like Elixir. I'm excited about Elixir because, like Ruby, it makes programming fun; even though the two languages are fundamentally different.