5 ms·
We've been experimenting with Elixir at work, and it's been really cool to drop down into the Erlang ecosystem and see how people think when they're designing O
by _asummers 10y ago
We've been experimenting with Elixir at work, and it's been really cool to drop down into the Erlang ecosystem and see how people think when they're designing OTP programs, especially when it comes to things like Riak and Mnesia and those sorts of things. My only complaints about this ecosystem is that everything feels scattered in specific places (I've had to read a lot of books, versus being able to read tutorials) and that it's very hard to tell an abandoned project from a feature complete project on GitHub. You can generally look at downloads in the Hex package manager for a rough idea of popularity, but then again build servers can inflate unpopular packages. Someone in the Elixir slack joked to me "75 stars? That's super popular for Erlang!". I can deal with it, but I wish it weren't so.
All that said, I think I'm going to stick around with these languages. Everything feels very well designed and battle ready, in stark contrast to using JS. Elixir also seems to remove a lot of the cruft and awkward syntax of Erlang, and having Lisp-style macros makes the GenServer boilerplate go away entirely.
- qaq 10y agoElixir did make Beam/OTP more accessible and more "fun" :)
- _asummers 10y agoAnd not to diminish Jose's work, but a lot of it was a coat of paint -- read the Kernel module, where most of the language core is located, it's pretty much entirely macros. Most of the code in setting up the language, outside of the standard lib, was bootstrapping the macro processor. The better docs, build system, package manager, etc. were all just icing on the cake to make it a 21st century language, with Phoenix as the cherry on top.
- qaq 10y agoI am in no way equating a 20 year effort by Erlang team to that of Elixir team. But I think Elixir is making the whole ecosystem much more accessible. I once tried to bring Erlang into our shop about 6-7 years ago but could not get the team excited about it, with Elixir we will be going into production this Fall and everyone loves it.
- _asummers 10y agoFor sure, I wasn't trying to suggest you were. I guess the point I was trying to make without actually saying any of these words is that it's really interesting that the same ecosystem with a few extra things had that effect. I always liked the idea of Erlang and I've read Joe's thesis and stuff, but never could be bothered to learn the language because it felt niche, and same as your coworkers, we're all really excited about Elixir.
- maxarturo 10y agoHow much does your team get into actual Erlang/OTP code? I'm wondering since I'm taking the long route, learning Erlang/OTP first and a distinct second for Elixir. Is this not optimal?
- qaq 10y agoI think that's optimal but for us it was more people getting into Elixir first and starting to dig in into Erlang/OTP. basically Programming Elixir -> Promgramming Phoenix -> Elixir in Action -> Designing for Scalability with Erlang/OTP
- _asummers 10y agoSee also: Little Elixir and OTP Guidebook. Currently reading that book, it's good so far.
- sotojuan 10y agoAbout to finish it myself, also very good! Elixir in Action's second part moved a bit too fast for me, but I'll revisit after I am done with Guidebook.
- andy_ppp 10y agoThe thing that constantly gets me about Elixir and Phoenix is the default tends to be the correct way of doing it. Let me explain. For example, the other day, I was looking at filtering a next parameter to remove the domain... however it's unnecessary as redirect/2 in phoenix if passed a URL rather than a path will throw an error by default. As an aside different exceptions will return different HTTP error codes - for example a database not found exception from Ecto will cause a 404. There are hundreds or thousands of these little decisions that are the correct/simpler decision. Elixir and Phoenix, for want of a better way of saying it, show great programming taste. So to say it's a coat of paint is a bit harsh; it's the right coat of paint, in my opinion.
- _asummers 10y ago> Elixir and Phoenix, for want of a better way of saying it, show great programming taste. So to say it's a coat of paint is a bit harsh; it's the right coat of paint, in my opinion. Fair enough. On rereading my comment, it came off more brash than I intended. I completely agree with this statement.
- 9919839219 10y agoFun is in the eye of the beholder. I'm worried that Elixir will take off because it's "hip" and ruin the chances for other people to use a pure and consistent language (Erlang) at work. It is amazing what kind of middleware bloat is forced unto people these days.
- qaq 10y agohip is one thing, we primarily do web dev. so good unicode support & Phoenix are big selling points.
- careersuicide 10y agoIf you haven't read the code for how Elixir handles Unicode support [0] I highly recommend doing so. At compile time it reads from several Unicode Character Database text files [1] and then defines a whole slew of functions using the contents of the files that take advantage of pattern matching via unquoting. I already knew all about pattern matching before I came across this but I was still absolutely floored by how awesome this is. In the past when working with C I've needed to do something similar but it required running an external tool whose output was a .c file. It worked but it was hardly elegant. [0]: https://github.com/elixir-lang/elixir/blob/master/lib/elixir/unicode/unicode.ex https://github.com/elixir-lang/elixir/blob/master/lib/elixir... [1]: http://www.unicode.org/Public/8.0.0/ucd/ http://www.unicode.org/Public/8.0.0/ucd/
- qaq 10y agoYep very elegant solution
- factotum 10y agoOne person's middleware bloat is another's power tool.
- sotojuan 10y agoOne could argue that Erlang/OTP has had decades to be used at work, and no one wanted to (sadly). Elixir taking over doesn't affect Erlang because Erlang wouldn't had become more popular over time anyway.