Live data from Hacker News

Which companies are using Erlang, and why?

erlang-solutions.com

181–190 of 204 posts

Re: Which companies are using Erlang, and why?

#181
> Many countries rely on Erlang for their immediate payment switches, allowing instant bank transfers

Just wondering if such a system used in Poland, actually called Elixir[1], has a line of Erlang/Elixir in its codebase.

[1] https://pl.wikipedia.org/wiki/Elixir_(system_rozliczeń_międz...

Re: Which companies are using Erlang, and why?

#183
post #133

Earlier quoted context omitted.

Yes, take a look at nerves : https://nerves-project.org/

Yep, know Nerves. Like the toolset and the model. Really asking about the underlying Erlang/Elixir that Nerves provides. The delivery flow (think image to SD card) fits the more tradition embedded/realtime model - versus OS, and installing app.

Well a Nerves image is a Unix Kernel + Erlang/Elixir & BEAM and whatever else you need, so its a completely stripped down image. It uses the Whitelist model so you add what you need instead of removing what you don't need. This is both more secure and more performant since you don't have 100's of apps/services running in the background, you only run what you need.

You can control everything remotely with nerves-hub, push update, debug etc. Remember you only have to burn the image once, then its all update from here.

You can build a poncho application where everything is side-by-side, lets say you have your app-firmware (you build image from this), then you build separate app-ui, app-logic, app-whatever etc. and simply hard code the path as dependencies in app-firmware and each app has their own configuration.

Everything will be bundled into a single image and protects you from things leaking in from the sides rather than from above.

Re: Which companies are using Erlang, and why?

#184
post #97

Earlier quoted context omitted.

>Are you ready to do this for your Whatsapp? I don't need to thanks to the fact that a bunch of those patches are now part of Erlang.

Note how I said it was an incomplete list of patches only . There's also signinficant tuning and optimisation, both for the Erlang VM and FreeBSD. There also things like (quotes from Highscalability): "Mnesia: Using no transactions, but with remote replication ran into a backlog. Parallelized replication for each table to increase throughput." "When Rick is going through all the changes that he made to get to 2 milli…

> Erlang's default distribution mechanism grinds to a halt when there are more than ~60-80 nodes. And Mnesia has a 2GB limit on table sizes. So you have to work around those limitations yourself.

I've seen people say these, and I have no idea where they come from. If you have a decent network, dist works fine at well over 80 nodes, but everyone says it doesn't work. pg2/global has some sharp edges if you're trying to have many nodes acquire the same global lock when you have a lot of nodes (a few hundred) or a smaller number if you have a lot of latency between them. There's options though -- maybe you don't need to acquire the same lock on all nodes, or maybe you can look in pg2.erl and global.erl and wiggle the locking code until it no longer live locks.

The Mnesia supposed 2GB limit is a bunch of hooey. Yes, disc_only_tables has (or had) that limit, because dets has that limit. Yes, it's a sharp edge, because there's no warning about it. However, a 2GB dets table is awful to work with anyway. You want to use disc_copies or ram_copies for big tables. Also, mnesia_frag is well supported, so if you really wanted to, you could make your disc_only_copies table 1024 fragments, and have 2 TB of dets, if that's how you wanted to role.

And yes, if you're going to hyperscale, you're going to need a couple people who know how to figure out what your system is doing. Is there a language/environment where that's not true?

I claim, without real proof, that Erlang's BEAM VM and OTP standard library are easier to understand and tweak when you do hit problems. You'll note however, that Rick Reed's first presentation was when he had been at WhatsApp for about a year, and he had zero experience with Erlang before that.

Re: Which companies are using Erlang, and why?

#185
post #122

Earlier quoted context omitted.

Not to refute your experience, but "adding true -> ok to every if statement" sounds like an anti-pattern. A couple of notes to elaborate: 1. If-statementes should rarely be used in Erlang because case is preferred 2. If you're returning ok everywhere, you could also just let it crash by doing something akin to true = function(). Always go for let it crash first, unless you really know you can handle the error sensibl…

Agreed. Couple of clarifications/observations. (1) there are situations like this: if DeductCreditInRatingGroup -> log("deducting credit..."); end; unfortunately you cannot write it this way. You have to write it as: if DeductCreditInRatingGroup -> log("deducting credit..."); true -> ok end; Not a huge deal but it's annoying. (2) Let it crash attitude is something I never understood. It's just not something you can d…

> Let it crash attitude is something I never understood. It's just not something you can do most of the time. If subscriber consumed 2MB and you let it crash in the middle of rating function you just "lost" 2MB. With couple of million subscribers on LTE that turns into very expensive error handling very fast.

Let it crash is the only sensible thing to do. Depending on the type of error, the 2MB could be absolute garbage. I would rather stop sending any message instead of sending potential wrong data without knowing.

Re: Which companies are using Erlang, and why?

#186
post #178
post #173

Earlier quoted context omitted.

> Surprisingly enough multicore support was not great Considering that it’s state of the art, you must have been doing it terribly wrong. > adding `true -> ok` to every if statement That confirms it.

That's just not true. Before you would run into all kinds of bottlenecks after 2-4 cores. I believe it was addressed in R13A[1]. [1] http://erlang.org/download/otp_src_R13A.readme

Not after 2-4 cores. And R13A is 2009, that was 10 years ago. (Java 8 is 2014.)

Today’s Erlang (R22) MP support is practically the best, bar none.

Re: Which companies are using Erlang, and why?

#187
post #186
post #178

Earlier quoted context omitted.

That's just not true. Before you would run into all kinds of bottlenecks after 2-4 cores. I believe it was addressed in R13A[1]. [1] http://erlang.org/download/otp_src_R13A.readme

Not after 2-4 cores. And R13A is 2009, that was 10 years ago. (Java 8 is 2014.) Today’s Erlang (R22) MP support is practically the best, bar none.

Hence the past tense.

Re: Which companies are using Erlang, and why?

#188
post #122

Earlier quoted context omitted.

Not to refute your experience, but "adding true -> ok to every if statement" sounds like an anti-pattern. A couple of notes to elaborate: 1. If-statementes should rarely be used in Erlang because case is preferred 2. If you're returning ok everywhere, you could also just let it crash by doing something akin to true = function(). Always go for let it crash first, unless you really know you can handle the error sensibl…

Agreed. Couple of clarifications/observations. (1) there are situations like this: if DeductCreditInRatingGroup -> log("deducting credit..."); end; unfortunately you cannot write it this way. You have to write it as: if DeductCreditInRatingGroup -> log("deducting credit..."); true -> ok end; Not a huge deal but it's annoying. (2) Let it crash attitude is something I never understood. It's just not something you can d…

1) I would just write

    DeductCreditInRatingGroup andalso log("blah")
2) Let it crash attitude is often misinterpreted. It means your system should be fault-tolerant in general, so you can focus on the happy case instead of trying to predict all humanly possible failure modes. If you _expect_ invalid input, then handle it properly.

Re: Which companies are using Erlang, and why?

#189

worked with Erlang lately in a side project, I think the actor model is really cool (and the FP style), but the error messages are not helpful at all (at least for a beginner), I wonder how other people manage.

Where else do you get line numbers in stack traces by default?
Post reply on HN