4 ms·
Phoenix is for the Elixir language which runs on the ErlangVM, and not for the Erlang language.
by izym 11y ago
Phoenix 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.