3 ms·
l used to be/still am a ruby on rails developer. I wrote a very naive web crawler in elixir within a week while learning elixir and I'm blown away by the perfor
by flocial 10y ago
l used to be/still am a ruby on rails developer. I wrote a very naive web crawler in elixir within a week while learning elixir and I'm blown away by the performance. It basically maxes out my 2011 macbook air's cpu while staying under 200MB of RAM (and maybe another 500 for multiple postgres connections). It basically runs in the background on a computer that can barely handle Firefox with multiple tabs open. The only real bottleneck of my crawler is bandwidth (my internet speed). The performance you get out of the box is insane. And my app really sucks (individual database inserts, saving the entire html to the database, etc).
The transition to a functional language is not exactly a cakewalk and I honestly still miss ruby's ability to be able to hack through arrays (no way to easily get the nth element of an array, it's all head|tail recursion) and hashes (nothing like hash[:key]) to make something "work" but the pipe operators and pattern matching are addictive. The eco system is not "opinionated" at all aside from the constraints of erlang. Documentation is crystal clear. Most of the phoenix stack can be used as stand alone libraries/dependencies. There's a lot less magic and most of the "magic" comes from macros which are much more transparent.
I'm honestly excited for web programming again after being burned out on legacy rails app development and deployment. Mix is like gems/bundler/rails {console, server, etc.} in one neat package done right and minus the headaches. Jose Valim and Chris Mc Chord are brilliant but are very approachable and all around nice people to interact with. In my short time with Elixir/Phoenix I'd say the "hype" actually understates the true potential of BEAM for web development and tiny startups. Also there's also LFE (lisp flavoured erlang created by one of the creators of erlang) you can add to the mix (similar to what you have with Scala/Clojure + Java only with concurrency and multicore out of the box with a tiny RAM footprint).
Learning Elixir was one of the best investments of time I've made in learning a new language and made programming a "hobby" again for me. Being able to write a naive implementation/prototype of an app and not dreading a "real" deployment (pulling out a bag of deployment tricks or stringing together a slew if external libraries/dependencies) is the most liberating experience I've had in a long time.
- dpeck 10y agoNot that you should do it too much since traversing arrays (lists) is expensive, but http://elixir-lang.org/docs/stable/elixir/Enum.html#at/3 http://elixir-lang.org/docs/stable/elixir/Enum.html#at/3 gives you the ability to grab arbitrarily.
- phamilton 10y ago> nothing like hash[:key] What's wrong with map[:key] ?