
Building a Reddit-like site after 3-4 months learning Elixir - stanislavb
https://www.reddit.com/r/elixir/comments/6c1vql/34_months_learning_elixir_and_what_got_done/
======
teilo
My company replaced the integration server I had originally written in
Python/Django/Celery/RabbitMQ with one built in Elixir/OTP. The results were
impressive.

Our task load was getting out of hand, and during peak load throwing memory
and CPU at it was not helping. Task monitoring was also a pain. It needed a
complete rewrite, because the original design, while robust for what it
targeted at the time, could not keep up with our growth.

The integration developer I hired to take over the project looked into using
Go at first, but then discovered Elixir. I started learning it with him (he
quickly surpassed me), and after a few trial task implementations, I gave him
the go-ahead. We couldn't be happier with the result. Thanks to OTP and the
existing tools built around it, we have great monitoring, and the ability to
easily and quickly scale up workers at peak times.

~~~
Xeoncross
Anything specific you liked about Elixir more than Go?

~~~
tsukaisute
As someone who writes both, it's even difficult to compare these as they are
apples and oranges.

Elixir (due to Erlang base) is great for long-running or distributed services
and includes tooling to, for example, easily introspect the state/memory usage
of your services down to a single mutable data structure, to heal from
failures, and to hot-swap upgrade/code while the server is still running, and
to perform node-to-node RPC.

Go would be a replacement for something that was previously written in C/C++,
that may need concurrency, and that should compile to native code. You get
very fine-grained control of everything from network to file operations and
excellent concurrency constructs. A web crawler, a device driver, or writing
an Nginx/HAProxy-type daemon, all may be great example use cases.

One could write their next social network/app backend using Go (just as one
could do it in C), but it would probably take more work than just using a
higher-level language.

~~~
oregontechninja
Go is much more suited for web apps than any driver or real time performance
application; although, I will agree that using Go for command-line tools is
great. I haven't used Elixir but as somebody who uses Go, I highly recommend
not replacing C/C++ with it unless it isn't performance critical.

PS: Go's memory usage is pretty up there some times, another reason you should
probably stick with C/C++ in the context mentioned above.

------
arvidkahl
Happy to see more and more non-trivial platform-based implementations in
Elixir. We're using the Elixir/OTP+Phoenix stack for our own projects,
handling networks of radio-connected sensors. It has been a breeze developing
with Elixir, as not only the language is maturing, but the ecosystem is
steadily growing as well - and there are a number of great libraries, from
Ecto to Phoenix itself.

The OTP foundation of Erlang and hence Elixir just screams "platform" or at
least "network", as it was designed to handle parallel flows of data. Great to
see yet another project utilizing this aspect of the language.

~~~
im_down_w_otp
Not sure what you mean by "parallel flows of data", but Erlang/Elixir isn't
particularly good at handling multiple streams of data between distributed
nodes if you're relying on the built-in distribution subsystem (net_kernel).

Only a single TCP connection is opened between any two nodes and there's a
head-of-line blocking issue with message delivery (intentionally for backward-
compatibility reasons).

Certainly you can build your own multi-connection subsystem if you want to,
but that's true of almost anything. I've had to do this for Erlang several
times.

~~~
zambal
Instead of rolling your own connection subsystem, there is also this
[https://github.com/lasp-lang/partisan](https://github.com/lasp-lang/partisan)
Although they call it still experimental, it seems to be pretty actively
developed.

------
kbd
I don't appreciate the "Elixir is growing" commentary in the title. That's not
justified because a person wrote a program in it.

~~~
jazoom
Just grew by 1

~~~
kbd
And somewhere else someone stopped using it. One person doesn't make a trend
as the title claims.

~~~
kranner
Arguably this post will lead to net-positive growth. I'm certainly going to
try it after having read the top comments.

~~~
RUTHLESS_RUFUS
I stopped using it just to throw a wrench in your gears.

Grind this thing to a halt!

(...no, actually Elixir is pretty cool.)

------
crusso
I write a lot of server processes that communicate with remote devices.

Elixir has become my go-to language for whipping up new communication
utilities. The syntax is comfortable, although I had to get used to a
Functional Programming style at first.

What I like most is the language and runtime's features that make
parallelization so easy. Spawning threads that are monitored, have their own
protected state, that are managed if they crash, and are trivially spread
across different machines on the network made it straightforward to write
fairly highly available code right from the beginning without a lot of
planning.

~~~
FrancoAustrian
Thanks to Erlang

~~~
steveklabnik
Thanks to BEAM, no?

~~~
bpicolo
Which is "Bogdan/Björn's Erlang Abstract Machine". So erlang.

------
josteink
For the lazy who are unsure what Elixir _is_ :

[http://elixir-lang.org/](http://elixir-lang.org/)

(I assumed it was a front-end Javascript framework or something like that)

~~~
eloisant
From what I gathered, it's popular for Rails developers who want something
that feels like Rails, but with (much) better performances and concurrency.

For me coming from Scala, I feel like the lack of typesystem would be a step
back.

~~~
gamache
I came to Elixir from Scala, and for me the dynamic typing is a big step
forward, because now I don't have to deal with the half of the Scala community
that tries to make Scala into Haskell.

Between Dialyzer (a static analyzer that finds type errors) and runtime
pattern-matching (extremely powerful destructuring, sort of borrowed from
Prolog initially), I don't find myself wanting to go back to strong typing on
the JVM.

~~~
hhandoko
I'm currently working with Scala and recently dabbling with Elixir and
Phoenix. It's a good language and great platform, however, I still prefer
static typing.

I'm still getting used to dynamic typing in Elixir. Most of the time I feel
like just matching against Map data structure or records.

While Dialyzer is great, writing the typespecs is a bit of a maintenance
overhead. I suppose it's a tradeoff...

> I came to Elixir from Scala, [..] now I don't have to deal with the half of
> the Scala community that tries to make Scala into Haskell.

IMO Scala will continue to be a multi-paradigm lang. On pure-FP and libs, it's
a choice and really depends on the problem domain. It might not be a good
solution to everyone, but I'm glad it exists.

~~~
gamache
I think of Elixir typespecs as documentation more than as overhead. Given that
I'm writing comments that tell the shape of the inputs and outputs of every
function anyhow, I might as well do it in a way that lends itself to static
analysis. :)

------
minhajuddin
Google trends shows that Elixir is in fact growing:
[https://trends.google.co.in/trends/explore?q=%2Fm%2F0pl075p,...](https://trends.google.co.in/trends/explore?q=%2Fm%2F0pl075p,%2Fm%2F03yb8hb,%2Fm%2F03j_q,%2Fm%2F02mm3)

~~~
cyberferret
Strange - that graph set shows Elixir on a slight growth path, but Erlang on a
slight downward path? Isn't Elixir simply the framework around Erlang??

It would be a bit like showing Rails on the uptake, but Ruby going down, isn't
it?

~~~
unscaled
No, Elixir is an entirely different language running on the same virtual
machine as Erlang.

It's as seeing a graph with Java usage going down, while Kotlin or Scala up.

~~~
cyberferret
Thanks @unscaled and @LukaD for clarifying this. I hadn't used the language,
so didn't understand that Elixir wasn't just the name of the framework.

Not sure why I got the downvotes for asking a question, but there you go...

~~~
hashkb
Because literally five seconds of googling would have gotten you the answer.
Your comment didn't add anything for anyone but yourself. That's why you got
downvoted.

~~~
cname
I was wondering the same thing, so I found cyberferret's comment (and the
answers) useful. It might be helpful to anyone who's skimming through here.

------
raphy
I have been using Elixir extensively for my services for a year now and it's
been a really great experience overall.

------
stanislavb
p.e. why "Elixir is growing" in the title - because more and more people are
building sophisticated and production ready services using Elixir.

Elixir isn't in the Top 50 programming languages yet, but I reckon it will be
there in not more than 3 months... and that is respectful given its age.

~~~
sdiepend
Says you? It's hard/to early to tell ofcourse, but currently it looks like
it's stagnating.
[https://insights.stackoverflow.com/trends?tags=elixir](https://insights.stackoverflow.com/trends?tags=elixir)

~~~
minhajuddin
A lot of Elixir Q&A actually happens on
[https://elixirforum.com/](https://elixirforum.com/) and the slack channel
[https://elixir-lang.slack.com/](https://elixir-lang.slack.com/) . So
stackoverflow trends may not be the best thing to judge this.

~~~
juhatl
As an avid Elixir user, your comment got me thinking about how and where I
look for help. I realized that it wouldn't even really occur to me to use
Stack Overflow for answers regarding Elixir, as the other platforms you
mentioned tend to be so active and well suited for that purpose.

This isn't to say that I wouldn't use SO for other purposes, as I actively
visit the site for JS/PHP content. Anecdotal evidence to support your insight
by all means, of course.

~~~
te_chris
Absolutely. The elixir community on the forum are amazing.

------
eggy
I prefer LFE (Lisp Flavored Erlang) because I prefer Lisp syntax to the Ruby-
like Elixir syntax. LFE compiles down to core Erlang, while Elixir compiles
down to vanilla Erlang. True macros can be done in LFE, but as I understand
it, macros are done after parsing in Elixir. LFE was created by one of
Erlang's co-creators.

~~~
christophilus
I'm curious to hear what you've built with LFE, and what the experience was
like? What would you say were the biggest stumbling blocks you ran into?

I'm also in your camp (not liking Elixir or Erlang's syntax, but really liking
BEAM). I like Clojure a whole lot, but would prefer it on BEAM for a whole
variety of reasons. LFE seemed like a step back from Clojure in many ways when
I looked at it.

~~~
nunb
Perhaps the 'step back' is that LFE is a Lisp-2 like Common Lisp whereas
Clojure is a Lisp-1 like Scheme.

You might find Joxa interesting, it predates Elixir, but came after LFE and is
patterned on Clojure.

[http://joxa.org](http://joxa.org)

