
Elixir lang 1.10.0-rc0 - bluehatbrit
https://github.com/elixir-lang/elixir/releases/tag/v1.10.0-rc.0
======
princevegeta89
Elixir has always been a pleasure for me to work with. Maybe true with most FP
languages as well.

The main positive I see is that I can easily navigate through code (due to
absence of complex objects/classes) and the standard library seems to be very
extensive.

The language was also easy to get into. My only complaint is that the IDE
support for intelliJ(through the plugin) hasn't been impressive though I can
live with it.

~~~
AlecSchueler
Could you, or anyone else, recommend some well written and idiomatic elixir
code that's free to browse through?

Coming from an object oriented background the idea that classless code could
be less complex is sorta blowing my mind!

~~~
lliamander
I felt the same way going from Java to Erlang.

One hurdle that was difficult for me was understanding Behaviors (which are an
abstraction used in both Erlang and Elixir). On the one hand, a Behavior is
much like an class/object: it has public methods, internal state, polymorphism
(via message passing) and to some extent a notion of inheritance. According to
Alan Kay, it's more Object-Oriented than Smalltalk!

However, a Behavior runs in it's own process. Like a typical class, public and
private functions are defined in the same file This makes reading the code
where a Behavior is defined more difficult because the public methods are
executing in the client process, but the callbacks (i.e. private functions)
are executing in the Behavior's own process.

One insight I gained from working with Erlang was that the "academic" notion
of OOP modeling (i.e. model the entities of your domain as discrete objects)
works much better with Erlang's proceses/Behaviors than it ever did with
classes/objects in languages like Java.

Objects in languages like Java, C#, Ruby, JS, etc. are much at modeling the
architectural components of a system, than at actually modeling domain
entities directly. That's actually partly why I really the Pony language: it
combines both objects as processes (called Actors) and objects as
components/capabilities (called Objects).

~~~
tomn
> Behavior is much like an class/object: it has public methods, internal
> state, polymorphism (via message passing) > a Behavior runs in it's own
> process

This doesn't sound right; a behaviour is just a set of functions to be
implemented in a 'callback module'; you seem to be talking about processes and
modules. I agree with your points though.

~~~
lliamander
> This doesn't sound right; a behaviour is just a set of functions to be
> implemented in a 'callback module';

Going back, I see that you are right: the Behavior is technically the common
pattern that is shared across specific processes. Is there a name for a
process that is defined in a callback module?

And really, this complaint about confusing modules spans to more than just
callback modules. Most processes define both the client and server functions
in the same module. For small modules it's not too big a deal, but even then
it is very difficult for someone new to the language to learn how follow the
flow of data.

Dave Thomas has some interesting ideas about this and other problems, but as I
don't do Erlang programming professionally at the moment I haven't had time to
really dig in deep.

~~~
toast0
> Is there a name for a process that is defined in a callback module?

I don't think there really is. Where I was working, we would just say this
process is a gen_server (or whatever), as if it was a type of process, but
this is more of an emergent property of the environment, than a named
property. If enumerating the processes, you can guess a process is a
gen_server based on erlang:process_info(initial_call, Pid), but that's not
definitive because it could have started as something else, then used
gen_server:enter_loop to become a gen_server, or started as a gen_server and
then become something else.

Naming the behavior the same as the module, and including client apis and
server and the behavior in the same module is legitimately confusing as well;
although, all that being in the same place can be nice, too.

------
conradfr
Another news, Nubank buys Plataformatec (José Valim's 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/)

~~~
brenden2
Interesting, but seems a bit odd that a bank would acquire a software
consultancy firm though. I wonder what they plan to do with it?

~~~
bluegene
My guess is Plataformatec did consulting work for Nubank and they are
aquihiring purely for talent

~~~
dmix
This happens a lot. Direct talent acquisition with a nice payout for the
talent running it.

------
gamache
Great job to the whole core team! There's a bunch of awesome stuff in here,
but I think the one that's going to steal the most hearts is:

    
    
        Enum.sort(my_list, :asc)
        Enum.sort(my_list, :desc)
    

That rounds off a sharp corner of a very common part of the language.

~~~
elcritch
That and DateTime sorting using the module api. That’s much nicer! One of the
few "oh what the..." bugs I’ve had in Elixir was not realizing that sort
defaults to structural sorting. Also it helped make sense why all the Erlang
datetime primitives are tules that’s structurally sort correctly.

------
jswny
My personal favorite part of this release is the enhanced diffing in
assertions! Now if a pattern match assertion fails in a unit test ExUnit will
pretty print the both items in the comparing and color highlight the
differences!

ExUnit is a pleasure to work with and one of the best unit testing frameworks
I've ever used.

~~~
lawik
Oh dear, yes! I missed that in the release notes but I'd heard it was coming.
I want it. I wanted it today.

------
nickjj
If anyone is wondering who is running Elixir and Phoenix (Elixir's primary web
framework) in production I started a podcast recently where I talked to some
folks about this.

That's at:
[https://runninginproduction.com/tags/phoenix](https://runninginproduction.com/tags/phoenix)

Episodes range from using it in closed source private internal apps in the
medical industry to open source apps dealing with billions of events per month
on a single server.

Hopefully others will be willing to share more stories in the future. There's
a few more episodes going up in the next couple of weeks for Phoenix
specifically.

------
maltalex
Could someone with professional experience int Elixir give an overview of
what's the ecosystem like?

It's hard to imagine working with such a niche language. How easy is it to
find quality libraries? Connectors to external systems? Tooling? Someone to
ask when running into problems?

Also, what's the market like for Elixir developers? Did you learn the language
on the job? For a specific project? In your spare time?

~~~
dobs
I feel like my experiences are in sharp contrast to many others here.

I love Elixir the language but find myself still having to throughly review
new libraries to avoid footguns. In particular with "connectors" \-- DB
drivers, API clients, basic protocol implementations, etc. And resolving those
issues normally means fixing them ourselves, often with a significant refactor
to someone else's library. And in turn that's meant some of us having to
become fairly proficient with Erlang.

So while I'm optimistic about the future of Elixir there are still some pain
points that I think relate directly to the immaturity of the community.

~~~
elcritch
Are many of these issues related more to older Erlang libraries? Most all of
the Elixir libraries that aren’t a WIP have been pretty good for me. Just
curious which sort of protocols too. Not always, but I do find older Erlang
libraries often lack unit testing and consistent doc tooling, likely due to
lack of tooling in earlier days.

~~~
dobs
Probably 50/50 old (but popular) Erlang libraries and newer Elixir libraries.

For protocols, we have a not-uncommon use case for which there’s no mature
HTTP client. Mint might be an option but it’s new enough that I haven’t
evaluated yet.

------
zabana
For the elixir programmers who are going to read this: do you use it
professionally ? If so, for what purpose ?

I'm interested in learning this language but I don't really know what can be
built with it ? It is a general purpose language or a more specialised one ?

Thanks for your input

~~~
pmontra
2.5 years, a Phoenix webapp. It's the backend of a marketplace for invoices.
The frontend is a React SPA. It interfaces a number of third party JSON and
SOAP APIs. It's still well within the limits of a medium low server on GCP. No
need for fancier environments.

Coming from Rails I like that I don't have to go through separate job
handlers, everything we need is in the language. I don't like much ecto (too
complicated for our need.) I dislike the configuration, build and deployment
process (it's definitely not snappy). By the way, it's great that Phoenix
autodetects changes and recompiles them without the need of an IDE.

Compared to another Django project I've been working on in parallel, the
Elixir one feels more robust and easier to expand upon. Compared to Rails
ones, it's about the same but with less third party libraries.

~~~
nickjj
What I found interesting is the author of Phoenix said in a podcast[0] that
most of the apps he deploys don't use releases. They just run things inside of
a Docker container using mix straight up.

[0]: [https://soundcloud.com/elixirtalk/episode-157-feat-chris-
mcc...](https://soundcloud.com/elixirtalk/episode-157-feat-chris-mccord-
liveviewphoenix-part-deux)

~~~
pmontra
I know at least one company doing the same. I'm not sure it's a big advantage.
Currently we install a server using ansible once (debian, apt-get erlang and
elixir.) We run tests on Travis and make it start a build process on a server
of us, create a release and deploy it using distillery. Configuration is
compiled at build time with secrets installed on the build server.
Erlang/Elixir don't play very well together with systemd (not easy to detect
if they're running) but what we setup is okayish and keeps us running.

With docker I imagine we still need the build server, secrets would still be
there, compilation must be done there before we create the image (mix
phx.server on uncompiled sources is going to take minutes and eat up the CPU
of the production server.) Then we must push the image to a registry and pull
it. Probably docker would interact better with systemd but I never tested it
with a BEAM project. Finally we need something to switch connections from the
old container to the new one. Distillery takes care of that now.

All summed up I see some pros a cons, both are still cumbersome. Btw, we're on
Elixir 1.7. We didn't check yet the new release and configuration features of
1.9. Too busy with new business features. Customer's decision.

~~~
nickjj
I'm not an Elixir expert but doesn't not using releases come with pretty big
down sides?

I vaguely remember reading that a release will pre-load all of your modules at
boot up time so that by the time the app is running, everything is as
optimized as it can be.

But if you use mix without releases then everything is lazily loaded, so
unless you had extra code that gets run on deploy to curl all of your
endpoints (to warm up the VM) then users would experience slower load times as
your app's endpoints were naturally discovered?

It makes me wonder why the creator of Phoenix still decides to not use
releases. Unfortunately he didn't go into detail.

------
whalesalad
I've been having a lot of fun writing an API for a ublox GPS chip with Elixir.
Glad to see continued development of this wonderful language.

------
aloukissas
The "Tracking of compile-time configuration" part definitely stands out here
for me. We've been dealing with this using private module functions but this
new language approach is cleaner.

------
sergiotapia
Hard to believe this wasn't a feature already, but I love that they added it.

    
    
        DateTime.now!/2

~~~
dudul
So far, I've been totally unimpressed with Date/Time support in Elixir.
`DateTime` wasn't even part of the API until 1.9.0!

~~~
andy_ppp
That's why most people use a third party library. For me it's fine for most
things, what were you doing? An example of such a library I've used is
[https://github.com/bitwalker/timex](https://github.com/bitwalker/timex) which
seems quite complete.

~~~
conradfr
Timex is great.

However sometimes I feel I only use it because of the weird default
(non-)handling of timezones by DateTime.

~~~
bitscrapper
FWIW, timezone handling was added in v1.8 or v1.9. At this point I think
Elixir has ported all features from Timex, except date parsing and date
formatting.

~~~
conradfr
To be fair that's two big usecases for datetimes in any software ;)

