Live data from Hacker News

How I Start: Erlang

howistart.org

11–20 of 32 posts

Re: How I Start: Erlang

#11

Earlier quoted context omitted.

Not currently. I've setup a twitter account where I'll post updates https://twitter.com/how_i_start and you'll see updates here https://github.com/howistart/howistart before they go live. Depending on how much this picks up I may expand to having an update subscription list. Python and Elixir are next up. Those will hopefully be out by the second week of July.

Just curious, what do you use Erlang for? I can think of neural networks as a possible use case but I don't hear much in the way of that.

Any time you need to do multiple things at once, erlang (or elixir) is often the best choice.

EG: If you have a website and want to serve more than one request at at time. If you have multiple people chatting or sending mail, or instant messaging, or voice communicating, erlang is a good choice.

If you have a search engine with many people searching, while spiders crawl the web, erlang is a good choice.

The only "downside" to erlang is new syntax and that its "slower" on a given node. But this last one isn't really a downside-- you can scale a process to 20 nodes with erlang a whole lot better than, say, node.js or java or go. None of those really support concurrency properly (of the ones who even try.)

This makes erlang unique.

I think many engineers try to tell themselves that the JVM or node.js or Go can be concurrent, but they are really just making excuses for the fact that the erlang syntax is a bit of a hurdle for getting started.

I'm fine with that- it makes a great hiring filter!

If someones learned erlang, you know something that makes them better than most of the rest of the programmers out there who are happy to believe rationalizations that let them get away with not learning erlang. (And if you're not thinking about concurrency you're even further behind.)

Re: How I Start: Erlang

#12
post #11

Earlier quoted context omitted.

Just curious, what do you use Erlang for? I can think of neural networks as a possible use case but I don't hear much in the way of that.

Any time you need to do multiple things at once, erlang (or elixir) is often the best choice. EG: If you have a website and want to serve more than one request at at time. If you have multiple people chatting or sending mail, or instant messaging, or voice communicating, erlang is a good choice. If you have a search engine with many people searching, while spiders crawl the web, erlang is a good choice. The only "dow…

I'm curious why you think Golang doesn't support concurrency properly.

Re: How I Start: Erlang

#15
post #12
post #11

Earlier quoted context omitted.

Any time you need to do multiple things at once, erlang (or elixir) is often the best choice. EG: If you have a website and want to serve more than one request at at time. If you have multiple people chatting or sending mail, or instant messaging, or voice communicating, erlang is a good choice. If you have a search engine with many people searching, while spiders crawl the web, erlang is a good choice. The only "dow…

I'm curious why you think Golang doesn't support concurrency properly.

For comparisons between Go and Erlang, I've been passing this out lately: https://news.ycombinator.com/item?id=7277957

edit: the entire thread, not just the OP.

Re: How I Start: Erlang

#16
Thanks for the write up, especially the part on relx was enlightening. I've been toying with Erlang, and have three questions I have not been able to find good answers to. Maybe someone could elaborate?

1) How well does Erlang deal with multiple VMs on a single machine? Are there any upsides to using a single VM per machine? (So, run your own code along side a RabbitMQ instance for example, if that is even feasible.)

2) What is a good way to have run-time mutable configuration data? I was looking into Mnesia to store user / password combinations, but it seems a bit overkill. Ideally a solution that lets you add / remove config data from a running node on the fly.

3) How do you handle access control to the node, while preserving the distributed Erlang features? VPN all machines and then only listen on the private interface?

Re: How I Start: Erlang

#17
BTW this is the author of Learn You Some Erlang for Great Good

http://learnyousomeerlang.com/

I just wanted to say that both this write-up and in the whole book you can see passion, and excitement for the topic. They say cliches like "work of love" but if anything that defines it I think.

It is the little humorous bits, the additional "Don't Drink Too Much Koolaid" parts, the visuals. It is a fantastic resource.

I think this post is a partially the response to "Why Cool Kids Don't Use Erlang" topic we discussed recently. There was a lot of "Too hard to get started" and I think Fred took the initiative and did something about it. That is great. Thank you Fred!

Re: How I Start: Erlang

#18
post #16

Thanks for the write up, especially the part on relx was enlightening. I've been toying with Erlang, and have three questions I have not been able to find good answers to. Maybe someone could elaborate? 1) How well does Erlang deal with multiple VMs on a single machine? Are there any upsides to using a single VM per machine? (So, run your own code along side a RabbitMQ instance for example, if that is even feasible.)…

1) It deals with it well. There's no issue running one or more nodes on a single host or machine. It's been done that way before SMP was made nicer a few years ago. The distribution mechanism is based on a name@host scheme so as long as the total pair is unique to a cluster, things are usually fine.

Running one VM per machine has a few upsides: better resource handling (large binaries are shared on a heap rather than copied), copying within a VM is cheaper than serializing over the network, and so on. The downside is lower isolation.

For this reason, people will tend to bundle a bunch of services together if they relate to the same general logical block of applications. You should definitely be able to find a way to run your Erlang code around with RabbitMQ (though that depends on their compilation process and assumptions as well).

They'll keep them separate for operational purposes often: some code bases are less mature, require more ops, crash more often, and so on, or have more erratic behavior, and so isolation is welcome in these cases.

2) See http://www.erlang.org/doc/man/config.html, http://www.erlang.org/doc/man/app.html, and http://www.erlang.org/doc/apps/kernel/application.html

Erlang comes out of the box with a configuration mechanism, which you may or may not make mutable at your choice on a per-application basis.

3) That's one way to do it, yes. This one or equivalent ones (restricting network access, IP tables, etc.) are the most used ones as far as I know. Some mechanisms can also include running an SSH daemon on the node and only allowing people with the right credentials to connect to a node. There's one that ships with the Erlang/OTP distribution.

Re: How I Start: Erlang

#19
post #16

Thanks for the write up, especially the part on relx was enlightening. I've been toying with Erlang, and have three questions I have not been able to find good answers to. Maybe someone could elaborate? 1) How well does Erlang deal with multiple VMs on a single machine? Are there any upsides to using a single VM per machine? (So, run your own code along side a RabbitMQ instance for example, if that is even feasible.)…

1. I've tended to see slightly better overall performance running multiple VMs (nodes)/server.

2. We use zookeeper and cache locally with an ETS wrapper. It's not-erlang but there are a lot of nice zookeeper tools and the ezk module for erlang is very solid.

3. we typically don't do vpn as if the vpn goes down it is a disaster. dual nics are ideal. i don't always configure that way due to limitations of the environment (non-VPC AWS, for instance). but what are you trying to control? access to the node even if you know the cookie?

Post reply on HN