4 ms·
> functional-Ruby. It is not. I understand why people from Ruby really what it to be "like a Ruby", but it is a completely different language. People confuse t
by eddd 9y ago
> functional-Ruby.
It is not. I understand why people from Ruby really what it to be "like a Ruby", but it is a completely different language. People confuse this by not understanding the erlang runtime and end up writing really poor code.
This should be one of first articles new people to elixir should read.
http://theerlangelist.com/article/spawn_or_not http://theerlangelist.com/article/spawn_or_not
- mononcqc 9y agoThis is, incidentally, one of the oldest arguments Erlang proponents had about the positives of Erlang's generally unfamiliar syntax: it is different because you should approach it differently, and it helps the programmer do a full context switch when working in Erlang. When Elixir came out, I think a lot of Erlang regulars had similar words of warning about it. For the most part it hasn't proven to be too critical of a problem from my observer point of view. Mostly, it appears that Ruby tends to be slow enough that even if you write suboptimal "ruby in Elixir" rather than properly working to the VM's strengths, you may still get a speedup over the Ruby baseline you had before.
- dmix 9y ago> it appears that Ruby tends to be slow enough that even if you write suboptimal "ruby in Elixir" rather than properly working to the VM's strengths, you may still get a speedup over the Ruby baseline you had before. This is why frameworks like Phoenix are good for onboarding newbies even though they are pretty heavy and require a steeper learning curve than just a language. You can approach Phoenix like Rails initially and survive pretty easily. Plus you still get a lot of the gains if you use the standard best practices. But eventually you're app will grow, you'll have more complex requirements than simple CRUD/channel based interfaces. You'll also come across other apps and blog posts like the above "Spawn or Not". Then you can dig deeper into what it means to program on the Erlang/Elixir VM. So the fact Elixir isn't as similar to Ruby is indeed true, the gap isn't wide enough top make the transition difficult. You can still fake it till you make it. I was previously a ruby dev as well and I learned Erlang before Elixir (and other FP languages before that) so it was easier to wrap my head around the major differences with Ruby. But I already felt at home when I started to use Phoenix later on that I'm sure others will have a similar experience and they don't necessarily have to be worried that Elixir is fundamentally different.