43 ms·
Elixir is one of those languages that changes you. I realize its a ruby flavored wrapper on top of erlang but I don't care. Coming from an OOP/C based language
by vikingcaffiene 8y ago
Elixir is one of those languages that changes you. I realize its a ruby flavored wrapper on top of erlang but I don't care. Coming from an OOP/C based language background, it took me a while to get it. Implicit returns? Immutable data? Pipes?? No inheritance??? No for loops????? And all thats just if you use the phoenix framework which maps pretty analogously back to a standard web server flow. Once you start digging into Supervisors and umbrella projects, the top of your head will get blown clean off. It's a hell of a drug.
I am glad to hear there are more companies out there giving it a try. Any time I see a job posting for a company that uses it, I give them a hard look. It tells me that they are a) hiring people who are of a certain mindset (see the python paradox[0]) and b) they understand the competitive advantage that using a language like Elixir can bring to the table.
[0] http://paulgraham.com/pypar.html http://paulgraham.com/pypar.html
- richk449 8y agoFunny how that pg post has aged. Now python is the language you learn if you want to get a job. What’s the new python?
- johan_larson 8y agoRust, maybe. I'm not particularly leading edge myself, so I've heard of it but never actually tried it.
- deleted 8y ago[deleted]
- phkahler 8y agoYep. The last time I picked up a language it was python. It lived up to much of what I had read. I've ignored most languages and watched them come and go with the exception of web dev which is not my thing. I wanted a better more pythonic C++ and have started dabbling in Rust. It appears to be everything people say. Would recommend.
- tosh 8y agoRust, ClojureScript, Clojure, Racket, Elixir, Elm, Reason, OCaml, Haskell
- mcguire 8y agoOCaml? Someone other than Jane Street is using OCaml?
- sgrove 8y agoI think the Reason syntax is picking up a lot of steam these days, especially in areas where React is used (web frontends and ReactNative apps). You can see some of the companies using it here https://reasonml.github.io https://reasonml.github.io
- lacogubik 8y agoSeems like - https://functional.works-hub.com/jobs/?tags=ocaml https://functional.works-hub.com/jobs/?tags=ocaml
- DyslexicAtheist 8y agoI would add Nim to this list, just after Rust
- hopler 8y agoAlso, Java and C++, even if they are "only" used at a "few" companies that happen to have the hiring power of 1000 startups each.
- fkrkgkvodkskd 8y agoJavaScript.
- rad_gruchalski 8y agogolang
- peteforde 8y agoI'm a Ruby guy and I'd love to feel what you're feeling. Where should I start / what should I check out? Bonus points for concept walkthroughs and materials designed to bring Ruby folks up to speed, specifically concepts that need to be temporarily forgotten or unlearned in order not to get sad. I like being a polyglot, but my schedule is tight enough that I need to hit the ground running or else I get pulled back to reality pretty quickly. There's a lot of posts and videos out there on Elixir, so curators are incredibly awesome in my world.
- whizzkid 8y agoStart here --> https://elixir-lang.org/getting-started/introduction.html https://elixir-lang.org/getting-started/introduction.html You will start feeling the magic around chapter 4 with pattern matching and the rest gets just better :) Try not to migrate your "how to .." thoughts from other languages into Elixir. It has some uniqe ways to solve everyday problems. Have your interactive elixir console ready to play with as well, good luck!
- peteforde 8y agoAwesome! Thanks so much.
- whizzkid 8y agoNo problem at all! I am also a ruby guy, so i can easily say that Elixir will not disappoint you.
- Klathmon 8y agoPattern matching will break you. I get frustrated at least once a week trying to use it in a language that doesn't have it. My brain just thinks in pattern matching!
- macintux 8y agoIt's unfortunate when I encounter a language that has a crippled implementation of pattern matching (looking at you, Scala). After using Erlang, it's hard to accept anything less.
- wolco 8y agoNo loops? That can be life changing.
- Jtsummers 8y agoI don't know Elixir, but I do know Erlang (one of Elixir's inspirations). The lack of loops is replaced by recursion or higher level functions. Tail calls (all, not just recursive) are optimized so that you don't blow the stack. Since the two (iteration and recursion) are easily transformed into the other, it's a pretty clean mode of coding.
- tim333 8y agoYou can sort of loop in Elixir eg. Enum.map(1..100, &IO.puts/1) prints the numbers 1 to 100
- xtian 8y agoWell, there is also a `for` construct: for i <- 1..100, do: IO.puts(i) I guess what people mean is that that’s an abstraction over function calls?
- derefr 8y agoIf you’re wondering: Erlang (and so Elixir) has a very “pragmatic” design behind its abstract machine/runtime; it’s not like the lack of loops is to be functionally pure or anything. They remove loops in the Erlang abstract machine so that there are only ever O(1) instructions executed between each function call (where a tail-recursion is considered a function call.) With this constraint in place, the runtime can get away with a hybrid of cooperative and preemptive scheduling called “reduction scheduling”, where functions only ever yield when they make a function call (or return from one.) By ensuring every function body has O(1) “reductions” before it hits a CALL or RET op, the runtime guarantees (unlike cooperative scheduling) that execution will always yield from a task in a bounded amount of time; and by ensuring yields only happen at call-sites, the runtime ensures that (unlike preemptive scheduling) there is no register state to preserve at time of yield—all the scheduler has to record when it pauses a task is the thunk (function pointer + parameter list) for the call it was about to make. Together, these guarantees allow for extremely low-overhead context switching between tasks in a soft-realtime context. Other systems (e.g. .NET’s Orleans) simulate this hybrid approach by splitting code into state machines with explicit yield points being the state transitions. But AFAIK, only ERTS takes the approach of making function calls into the state transitions. (Because, without the no-native-loops constraint, such an approach doesn’t work at all.)
- ashleyn 8y agoAs someone who's done a bit of Rust, I'm starting to see its influences just reading that list of features.
- Retra 8y agoIt looks to me like Elixir is just doing the same things most other functional languages are doing.
- macintux 8y agoThe language itself is a fairly typical FP, but only if you disregard the VM it runs on and the OTP framework. As I've frequently said about Erlang, the language is much more powerful than the sum of its parts. There are a great deal of complementary features in the stack.
- deleted 8y ago[deleted]
- bitwalker 8y agoIt is really the BEAM that is most compelling, Elixir is a great language on top of it, but the VM provides tools that simply don't exist in most other languages, if any. Specifically things like runtime tracing with pattern matching, the ability to connect an interactive remote shell to a running system and poke at it using code, ETS/Mnesia, hot upgrades/downgrades, etc.