
Elixir v1.10 - micmus
https://elixir-lang.org/blog/2020/01/27/elixir-v1-10-0-released/
======
nivenhuh
I’ve been using elixir for about a year now. It really makes writing API code
joyful.

The pattern matching concept works so well for handling the variation that
happens in API request handling.

I also love working with Plugs. The pipeline nature of elixir translates
directly into how you manage a request/response, and the plug abstraction
pattern allows you to be explicit about what should happen, and hide the
details in a clean way.

Overall, there are a few simple language patterns that, when used together,
provide a lot of power and flexibility — without the drawback of over
complicated code.

~~~
tyre
Reading the update to Enum.sort, I could see in my head how easy a change this
would be in elixer.

Supporting a different second parameter (a symbol rather than a function) can
be implemented with another function that pattern matches to :asc or :desc.
They can each call the original function(s) too.

In many other languages you'd start `sort` with a conditional and that
function would need to handle every case. Not here. Each function worries
about itself and what it can handle.

There's a beauty and practicality that Elixir hits so well.

------
_asummers
Woooo I have a feature in this release! Contributing to standard tooling feels
good.

~~~
anhldbk
Congrat :D

------
histriosum
I've been tempted a few times to dip my toes into Elixir -- I like the
language and the BEAM concepts, but in my environment I always bump into the
following concern..

Ecto v3 has been out for more than a year now, and there are still only two
supported adapters.. MySQL and Postgres. In my environment, I use a lot of
MSSQL and SQLite in addition to Postgres, and those adapters haven't been
successfully ported over to Ecto v3 yet.. in looking at some of the threads
related to porting efforts, it appears that it must be a fairly daunting
process.

I always get to that point in my technical evaluation and wonder whether I
ought to sit back and wait for a while yet, until the database stuff catches
up and solidifies. I realize Phoenix can still use Ecto v2, but that just
seems like it would add legacy dependency issues.. In actual practice, is most
everyone using Elixir and Phoenix just sticking with Postgres/MySQL? Is there
some other mitigating method that folks are using that makes Ecto support a
non-issue?

~~~
fyfy18
I think this hits on one of my biggest complaints with the Elixir and Erlang
ecosystem. As a high level toolkit for building distributed systems it's
great, but if you need to do something more low level you are often left on
your own using a third party library. This on it's own isn't a big deal, Ruby
has the same limitations. Unfortunately the Erlang and Elixir ecosystems
aren't as big as Ruby, so that often means the third party libraries aren't so
battle tested and features are limited. Often then are written for one
company's use case, and don't do anything outside of that.

I run a SaaS product where the backend is Elixir (it's been going for 10
years, so originally written in pure Erlang) and part of it needs to do a lot
of http requests. It's a bit of a unusual use case, as I need to do 1000s of
requests per minute to different servers. It's not feasible to keep that many
connections open, so the connection needs to be recreated each time. Using
hackney (the #1 Erlang http client wrapper) I found that some requests often
took much longer on average than other requests. I narrowed it down to being a
problem somewhere on the client side, but Erlang doesn't provide any tooling
for digging deeper into the lifecycle of a HTTP request. I figured maybe it's
a problem with TLS and then found Erlang (I think its been improved in v22)
had very poor performance when verifying SSL certificates, so I had to disable
that. I switched to mint which is a wrapper written in pure Elixir which
helped a lot, but still it a left a lot to be desired.

I wrote up a quick test in Go and found doing the same requests, it didn't
have any performance issues or timing oddities, and the code was much simpler.
I've hbeen working on extracting that part of the system into a Go app, called
via gRPC. Unfortunately there is no official gRPC library for Erlang, and the
only third party one has limited features that I've had to work around. So
it's a bit painful, but don't get me wrong I love using Elixir and Erlang :-)

~~~
methyl
> I've hbeen working on extracting that part of the system into a Go app,
> called via gRPC

What if you called it via Port instead of gRPC?

We are also using Elixir at our SaaS for more than 2 years in production.
There are times (although rare) when Elixir performance is just not enough.
For those cases we tend to use Rustler, which makes integration with Rust code
pretty safe and straightforward. Did you consider Rust instead of Go?

------
happy_path
Having learnt Ruby and a bit of Erlang, I'm interested in Elixir so I fire
this tangential question:

How would you recommend to learn Elixir? And a follow-up: some ideas for
personal Elixir-based projects?

~~~
plainOldText
If you really want to learn Elixir, you should learn enough Erlang prior, to
get a better understanding of how Erlang/OTP all fits together. Thus, I would
recommend the following structure:

1\. Read Joe Armstrong's Book: _Programming Erlang_ to learn the basics and
the philosophy behind Erlang from one of its creators. [1]

2\. Read _Erlang and OTP in Action_ to learn more about the OTP (Open Telecom
Platform), applications and gen_servers (which btw, you will find them all
over).

3\. Learn Elixir, perhaps from one of the books _Elixir in Action_ [3] or
_Programming Elixir_. [4]

4\. Finally, start implementing your cool personal project.

Ah, one more thing: _Elixir School_ is also a wonderful resource with tons of
information and examples [5] and of course the official Elixir website with
its excellent docs. [6]

–––

[1] [https://www.amazon.com/Programming-Erlang-Concurrent-
Pragmat...](https://www.amazon.com/Programming-Erlang-Concurrent-Pragmatic-
Programmers-ebook/dp/B00I9GR4TW)

[2] [https://www.amazon.com/Erlang-OTP-Action-Martin-
Logan/dp/193...](https://www.amazon.com/Erlang-OTP-Action-Martin-
Logan/dp/1933988789)

[3] [https://www.amazon.com/Elixir-Action-Sa%C5%A1a-Juri-
cacute/d...](https://www.amazon.com/Elixir-Action-Sa%C5%A1a-Juri-
cacute/dp/1617295027)

[4] [https://www.amazon.com/Programming-Elixir-1-6-Functional-
Con...](https://www.amazon.com/Programming-Elixir-1-6-Functional-
Concurrent/dp/1680502999)

[5] [https://elixirschool.com/](https://elixirschool.com/)

[6] [https://elixir-lang.org/](https://elixir-lang.org/)

~~~
alharith
This makes me _not_ want to learn elixir. Learning one language and becoming
masterful at it is hard enough. There's too many "learn this language, but
also this other language and platform"'s in my life (JVM-based work, and
anything in the front-end JavaScript world it feels like these days). It just
feels like you are telling people "Here, learn this language, but also learn
the assembly instruction set for your architecture as well" \-- that's not the
reason I choose to use higher level language.

~~~
playing_colours
What does it mean for you “learning one language and becoming masterful”?

You can learn the syntax of Elixir, Python, Go, whatever very fast, but
becoming a master is much less about its syntax - that is _usually_ a trivial
part. It is more about underlying standard library, concurrency, collection,
execution model, GC, patterns, and caveats.

------
sandGorgon
This is the first release of Elixir after the Nubank acquisition of the parent
company - [http://blog.plataformatec.com.br/2020/01/important-
informati...](http://blog.plataformatec.com.br/2020/01/important-information-
about-our-elixir-and-ruby-open-source-projects/)

~~~
ilja
Apparently José Valim is no longer at plataformatec:
[https://twitter.com/josevalim/status/1219264309202771968](https://twitter.com/josevalim/status/1219264309202771968)
Now at [https://dashbit.co/](https://dashbit.co/)

~~~
sandGorgon
Whoa. Then what did Nubank acquire then ?

I thought it was the talent.

~~~
brodock
they acquired the "Agile" managers

------
alberth
Note as of v1.9, Jose said the language was feature complete.

All subsequent releases will focus on improvements and bug fixes. Not new
features.

[https://elixir-
lang.org/blog/2019/06/24/elixir-v1-9-0-releas...](https://elixir-
lang.org/blog/2019/06/24/elixir-v1-9-0-released/)

>> ”As mentioned earlier, releases was the last planned feature for Elixir
[v1.9]. We don’t have any major user-facing feature in the works nor planned.
I know for certain some will consider this fact the most excing part of this
announcement!”

Edit: fixed for clarity

~~~
josevalim
I think the keyword in the v1.9 announcement was "major user-facing features".
:) Back then we also said:

> We will continue shipping new releases every 6 months with enhancements, bug
> fixes and improvements.

I would say v1.10 is quite close to this sentiment: a bunch of improvements
and enhancements but nothing really major. The main new feature in v1.10 is
"compiler tracing" but that will be directly used by a small subset of the
community, to improve the tooling, instead of being something everyone would
use from the get go.

~~~
alberth
Jose

I really love the years of work you’ve put into Elixir (and Phoenix as a
framework).

Can’t say thank you enough.

~~~
josevalim
Thank you, I appreciate it!

------
playing_colours
A very interesting language on powerful platform with a promising web
framework. Many saw it, myself included, as a Ruby / Rails Improved, and
expected its quick growth.

Unfortunately, initial enthusiasm a few years ago did lead to its wide
adoption.

I talked with a couple of companies that jumped on it initially, but later
decided to move to Java, Kotlin, Go. The main reason was difficulty to hire
engineers to scale up quickly (in Europe), not some technical disappointments.

Sadly, it seems that being a scalable platform is not enough to scale up to
business needs.

~~~
elcritch
Weird, on the Elixir forums and slack channels there seems to be a fair number
of developers working or wanting to work in Elixir. Perhaps the initial uptake
in interest outpaced the developer interests in some areas. It'd be
interesting to know what the community is like in Europe.

Based on the recent formation of Dashbit [1] and larger companies like PepsiCo
(?!) among others openly jumping onboard I think means Elixir has reached a
clear point of sustainability for those willing to find (and train!) devs.
Likely it'll never be RoR level, but I'm fine with that if it keeps the dev
community more selective. Functional programming in general seems to be a bit
of a self-selector.

1: [https://elixirforum.com/t/jose-valim-announces-his-new-
elixi...](https://elixirforum.com/t/jose-valim-announces-his-new-elixir-
consultancy-dashbit/28414)

~~~
ericsanchez
I picked up _Programming Erlang_ because I like Joe. I'm trying to understand
why the platform, and the accompanying language(s), aren't more widely used?
People seem to speak very highly about Elixir, BEAM, and OTP. It all seems
really great...

I see comments like

This:

>A very interesting language on powerful platform with a promising web
framework... I talked with a couple of companies that jumped on it initially,
but later decided to move...

And this:

>I recently had a convo with a company that moved into Elixir because they had
an easier time hiring...

I see this comment pair somewhat often.

Also,

From @hajile

>BEAM is about an order of magnitude faster than Cpython ...If you prefer Ruby
syntax over Python, there is no contest here.

>BEAM is slower than the JVM, but much more stable.

The second quote seems to be a pretty reasonable trade off (my next question
is, how much slower?).

This makes a lot more sense to me:

>Functional programming in general seems to be a bit of a self-selector.

I like functional programming, but experiences do tend to be either: "I love
FP" or "Eh, not for me."

But are these it? I've been getting into erlang lately (to then get into
elixir), but I feel like I've been "waiting for the other shoe to drop." As
in, I'm wondering if there's some disadvantage that doesn't get talked about.
Are there any engineering blogs that talk about using BEAM/Elixir/et al in
production?

~~~
dnautics
Honestly I think you are doing things backward. With all due respect to the
fantastic platform and vm that the erlang folks built, it's just not as joyful
as elixir. And I feel like writing legible and organized code is easier in
elixir since it's opinionated, about everything from directory structure to
documentation to tests, and a couple of detailey things like structs are
easier to read than records and macros are more sensible than string
preprocessing

~~~
cutety
Definitely agree, though I respect the effort/desire to learn Erlang first
given the fact the first time I saw Erlang code I was so confused/put off by
it, the syntax was so foreign (not c-like, not lispy), variable names up
capitalized, atoms are bare words, source files are just tons of functions,
the tooling isn’t anything like modern languages (though since Elixir and
hex/mix, that situation has gotten way better), then you’ve got all the OTP
behaviors which are entirely unique to Erlang/BEAM, Erlang’s documentation
though excellent and extensive isn’t by any means beginner friendly (IMO), and
to top it all off, unless you’re coming from another pure functional language
you have to deal with working in a new paradigm. Basically, Erlang is
intimidating, which is unfortunate because how powerful BEAM and the OTP
behaviors are.

However, Elixir wraps up the power of the BEAM and OTP in a much more
approachable package. The syntax is much more familiar (thanks Ruby), provides
tooling on par with (and better than some) popular modern languages, the
language itself also provides more modern user friendly features (macros, pipe
operator, protocols, etc). All with a community that is very beginner friendly
and willing to help.

If you want to make use of OTP/BEAM, Elixir is by far the best way to enter.
When you learn Elixir, you will also learn the major OTP behaviors and
concepts (Supervisors, GenServers, Applications, Registry). Eventually you’ll
find that there are even more goodies in the beam not directly exposed by
Elixir (genstatem, ets/dts/menisia,timer,digraph — are a few of my favorites).
Fortunately though, you can call Erlang modules/code directly from Elixir (and
vice-versa), so you’ll then eventually dip your way into playing with Erlang
modules as needed and when you approach the docs after having experience with
OTP with Elixir, you’ll notice a lot of things are familiar and the Erlang
docs become much less intimidating.

Basically Elixir is a much easier entry point to Erlang. Erlang is a great
language, but very different with a lot of new concepts and which can kill
your motivation to learn how awesome the BEAM is, so if you want to learn
Erlang, by all means give it ago, but if you find yourself frustrated/confused
with it, try Elixir for a while, then come back to Erlang and I bet it will be
a lot easier.

When I initially saw Erlang, I was put off, the docs were confusing and I
would avoid them at all costs, always try to look for an Elixir wrapper. Now
after having worked with Elixir a lot? I frequently find myself going to the
Erlang docs first to find a solution instead rather than hex or whatever. I
can easily grok my way through an Erlang projects source, which previously was
completely foreign to me. Will I ever likely write anything serious in pure
Erlang? Probably not. Am I saying if you learn Elixir you will also just pick
up Erlang? Absolutely not. What it will do though is make the process of
learning Erlang (if that’s the goal), and it’s absolutely massive built in
library of tools/abstractions/patterns that no language I’ve seen comes close
to replicating an order of magnitude easier.

~~~
dnautics
You may like this: the very odd gen_statem callback pattern exists to group
different callbacks by state (which you can't do because you need to group
like headers together). But in Elixir, we use modules and macros to organize
our code more sanely and less ad-hoc-ey:

[https://hexdocs.pm/state_server/StateServer.html](https://hexdocs.pm/state_server/StateServer.html)

~~~
cutety
I've only had 2 complaints with gen_statem, the docs were initially some of
the most confusing/unclear and the state_functions callback mode (which I
think partially is to blame for my first complaint as I was expecting a more
gen_server like api with handle_* functions -- which exists but the docs use
the state_functions for most of the examples and the handle_event just kinda
getting some "oh by the way this exists" examples). I actually initially
decided to just keep using gen_server's with a "status" or whatever value in
their state as I figured it was good enough. At some point over the next few
weeks I actually ended up having this talk[1] pop up in the recommend videos,
and I figured I give it a watch to see if it would help make sense of
gen_statem or at least just confirm that I don't need it. And while watching
it, once he started explaining actions (timeouts, state_timeouts, postponing,
etc) I realized that gen_statem literally solves so many problems that I've
had in the back of my mind on the project I was working on like "I should
figure out a way to change the state of A and do something when it doesn't
receive any messages from X,Y,Z processes" (gen_statem's timeouts!) or "how
should I handle messages received while attempting to recover, I guess I could
put them in a queue or something..." (oh, gen_statem will let me postpone them
until it's healthy!). It took a couple more re-readthroughs of the docs to
fully grasp, but now it gets included in almost everything I work on, it's so
useful (though I guess I should've assumed those were already solved problems
by the BEAM/OTP as usual).

However, now my biggest complaint about Elixir is that gen_statem didn't get
any official wrapper. StateServer looks like almost exactly what I would want
out of an official Elixir wrapper. I also like to see the addition of
`handle_continue` as well, because the first thing I did before migrating any
of the gen_server's to gen_statem's was create a small wrapper module to a)
make the handle_* return values more in like with GenServer's (basically just
making it {:(no)reply, (transition|keep), data, [actions]}) and b) add a quick
and dirty handle_continue callback because I use it all the time with
GenServer. And this literally just looks like a more polished version of that,
so thanks!

[1]
[https://www.youtube.com/watch?v=_4MTIffWhYI](https://www.youtube.com/watch?v=_4MTIffWhYI)

------
xyst
What’s the advantage of using this language over Rust, Go, Java (or any other
JVM language), or Python?

~~~
hajile
Rust: much lower-level systems language which will take quite a bit more
development time.

Go: Go's CMT implementation is fundamentally broken (you can't just use go
channels without mutexes for complex work unless you want your application to
have bugs). Elixir and Erlang Actors have much better guarantees.

Java: BEAM is slower than the JVM, but much more stable. Native actors are a
much better experience than Akka.

Python: Django finally added initial support for async development, but
library support is a long ways off (and the GIL is its own issue). BEAM is
about an order of magnitude faster than Cpython (though probably similar
performance with pypy). If you prefer Ruby syntax over Python, there is no
contest here.

My big question is less Why BEAM? and more Why Elixir?

I prefer the native Erlang Syntax, LFE/Joxa (lisps), or alpaca (ML family with
static types) over Ruby-ish syntax.

~~~
dynamite-ready
I'd not written any Ruby before touching Elixir (and still don't, barring
tools like Dependabot and Vagrant), but far and away prefer Elixir's syntax to
Erlang.

I write scraps of Erlang from time to time, but hate the idiosyncrasies such
as the rules behind commas and full stops, and variable names starting with
capitals. There are so many other weird quirks too, like how strings are
handled.

------
ta93754829
I'm curious to know more about the total cost of ownership of Elixir.

What's it like finding other developers with experience?

How long does it take to train people up?

How easy to understand the code base is it for developers who are 2
generations down from those that wrote it?

How good is the tooling/support/interoperability? When I'm using X service, do
they already have an SDK are do I have to build it from scratch _every single
time_ because I'm using Elixir and not say Java or .NET.

What's the general level I have to hire at? Can the "average" developer (who's
not that great let's be honest) learn it and be productive or do I need to
hire very good developers for every seat (read more expensive)

I feel like language features and syntax is close to the bottom of things to
consider...

~~~
vetrom
Speaking as a sometimes Erlang developer: the ecosystem certainly isn't as
universal as language $FOTM. That said, Erlang's concurrency primitives and
runtime are second to none, and there is little that is more battle-tested in
the industry.

Individually developers will be more expensive, but if you have a product that
demands maximum leverage of concurrency (i.e. data-heavy api, whatever-in-the-
middle services, multiparty real-time data), you will more than makeup the
developer premium when you get to that point.

I havent hit Elixir yet, but it seems to make access to the Erlang runtime
much easier. As far as SDKs/api, Erlang itself has primitives and libraries to
build useful access to most APIs you can find. If you're worrying about what
services you can access though, you probably don't need Erlang's features, at
least not yet.

------
7777fps
previous discussion from the release candidate:
[https://news.ycombinator.com/item?id=21981908](https://news.ycombinator.com/item?id=21981908)

The new sort api seems like a significant improvement.

------
sysashi
I'm really exited about that pattern-match diffing improvement!

Although finding green and red mismatches in pages of output of your data
structure was fun :)

.. no

Thanks for the work on Elixir!

------
Grimm1
Elixir as a language provides a very robust standard lib with most tools to
accomplish many tasks that would require external dependencies in other
languages. Combine that with the actor model, Erlang's vm and own std lib and
you have a very powerful language for a wide array of problems.

------
etuil
Highly doubt that would get me anywhere but. I'm searching for elixir/js
apprenticeship. It could be non-paid and re-evaluated at later point. I have
been tinkering with programming as a hobby for a while. Currently located at
UTC+2.

~~~
Zsolt
Hi bud,

Please add your email to your profile so I can reach out to you. I'd like to
chat and see if you'd be a good fit.

~~~
etuil
Oh that's nice. Done

------
ctas
My team and me rely heavily upon Elixir and the Beam VM within our startup and
couldn't be happier. I'm glad to see continuous improvements beyond the
acquisition of Plataformatec.

------
brintnc
anyone mind explaining the /# to me? like `Application.get_env/3`. been
wanting to learn Elixir for awhile now, but didn't even know what do Google
for that one.

~~~
pera
It's called "arity":

[https://elixir-lang.org/getting-started/basic-
types.html#ide...](https://elixir-lang.org/getting-started/basic-
types.html#identifying-functions-and-documentation)

~~~
brintnc
not sure how i made it through my entire CS degree without learning this term.
either that or i just don't remember it. anyways, thank you! this is really
useful even outside of Elixir.

~~~
quaunaut
I've honestly never heard anyone who isn't an Elixir programmer use it. I
wouldn't worry about not having heard it before.

~~~
grzm
It's much more common than just Elixir programmers. It's a common concept in
computer science, particularly in functional programming or languages which
permit function overloading on arguments.

[https://en.wikipedia.org/wiki/Arity](https://en.wikipedia.org/wiki/Arity)

Edit to add: I've heard and used arity for at least 10 years, in particular in
the Clojure community. I've heard of Elixir and understand it shares some
common ideas with Clojure and Ruby, but never been a part of its community.

~~~
hopia
In functional programming classes at the uni you probably wouldn't hear this
because if they teach Haskell which I assume most do, every function always
takes just one argument. That's because functions are curried by default.

I personally haven't really heard this mentioned anywhere outside of the
Erlang/Elixir sphere.

~~~
cthalupa
This thread really surprised me - I learned about arity when learning about
ternary operators, which are pretty universal - you can find ?: in all sorts
of languages. I think I was learning about C when I first got a detailed
explanation on the subject.

