Live data from Hacker News

What can I only do in Erlang?

erlang.org

11–20 of 173 posts

Re: What can I only do in Erlang?

#11
Not sure I agree with the conclusions:

1. Binaries: this isn't really an issue. We ship the JVM with anything that we do in Java. Unzip, run, done. Go is probably ideal there but it doesn't support embedded resources without some hideous hacks so you're still going to be deploying more than just a single binary in a lot of cases. CLR is pretty good at this as well.

2. Sockets: 0MQ/WCF/JMS/any stream abstraction wired up correctly.

3. ASN.1: Everything has ASN.1 libraries these days. I've never had to use one in the real world in any of the sectors I've worked in.

3. Let it crash: we do this. In fact we force threads to crash if they do anything bad by throwing an exception that isn't caught. All threads are designed to be idempotent, restartable and transaction aware. This is true in JVM/CLR at least.

4. Supervision: New thread, new state, no shared state. Not hard. PHP does this...

5. Inspection: I've seen the Erlang toolchain and it's pretty good but I'm not joking but inspecting and debugging the state of a system is better when there is lots of pooled knowledge (google) and lots of diverse tools. JVM wins there every time.

7. Messaging is not RPC: It's not in JMS either or WCF. It abstracts the transport away. In fact we have inproc transports in some cases that use concurrent collections to throw messages around.

8. Dialyzer: compiler, static typing (Java is less strong here to be honest than say C#).

I really like the idea of Erlang but the worse is better mantra applies here. It's easier to get staff, the knowledge when something goes pop is available, we benefit from the reuse of billions of lines of code written and tested by others if we pick a JVM. If we have to think a bit or throw some more kit at it, so be it.

Edit: just to add, I'm not knocking Erlang and quite like it in principle (I spent 2 months disassembling CouchDB to see if we could maintain it so it's not a foreign language to me), but the justifications in the reply aren't particularly unique ones nor are they major advantages.

Re: What can I only do in Erlang?

#13

Not sure I agree with the conclusions: 1. Binaries: this isn't really an issue. We ship the JVM with anything that we do in Java. Unzip, run, done. Go is probably ideal there but it doesn't support embedded resources without some hideous hacks so you're still going to be deploying more than just a single binary in a lot of cases. CLR is pretty good at this as well. 2. Sockets: 0MQ/WCF/JMS/any stream abstraction wired…

He's talking about dealing with binary data when he says 'binaries':

http://www.erlang.org/doc/efficiency_guide/binaryhandling.ht...

http://www.erlang.org/doc/programming_examples/bit_syntax.ht...

Erlang is really strong for that.

As to Java, sure, you can do anything with it, and do a decent job of it. But sometimes, as a startup, you are resource constrained, so if you can do more with less because you have a good grasp of a tool like Rails, or Erlang or Lua or whatever, that might make the difference. For a large company, Java is definitely a safe pick - no one ever got fired for choosing it: you'll be able to get whatever you need done, and "If we have to think a bit or throw some more kit at it, so be it." For a group like WhatsApp, Erlang seems to have been a good pick.

Re: What can I only do in Erlang?

#14

Not sure I agree with the conclusions: 1. Binaries: this isn't really an issue. We ship the JVM with anything that we do in Java. Unzip, run, done. Go is probably ideal there but it doesn't support embedded resources without some hideous hacks so you're still going to be deploying more than just a single binary in a lot of cases. CLR is pretty good at this as well. 2. Sockets: 0MQ/WCF/JMS/any stream abstraction wired…

wrt point 1, that's poor phrasing, when he says binaries, I think he means binary data, not executables.

Re: What can I only do in Erlang?

#15
ZeroMQ gives you the same but better: messaging in any language. That means you can interface to any component you want written in any language you want. Also hiding native sockets, which means networking is not 1:1 but based on scalability patterns. At some point people will realize what a big deal that is.

Re: What can I only do in Erlang?

#16

Not sure I agree with the conclusions: 1. Binaries: this isn't really an issue. We ship the JVM with anything that we do in Java. Unzip, run, done. Go is probably ideal there but it doesn't support embedded resources without some hideous hacks so you're still going to be deploying more than just a single binary in a lot of cases. CLR is pretty good at this as well. 2. Sockets: 0MQ/WCF/JMS/any stream abstraction wired…

> 1. Binaries: this isn't really an issue. We ship the JVM with anything that we do in Java. Unzip, run, done. Go is probably ideal there but it doesn't support embedded resources without some hideous hacks so you're still going to be deploying more than just a single binary in a lot of cases. CLR is pretty good at this as well.

Not sure you read / understood what that point was about, due to its native binary types, tail recursion and pattern matching make dealing with binaries easier in erlang than most other languages

As far as most of the other points, you are mostly agreeing with the statement "nothing is impossible with other languages compared to erlang, but its better designed for this"

PHP does not so long process thread supervision (I mean it can but close to 0 people use it that way), Being able to inspect running processes is useful as well as the fact google is helpful, the JVM's entire ecosystem isnt based around a let it crash concurrent process isolation philosophy and java in particular is one of the worst offenders at having to ember error handling code at almost every point of your application logic

Re: What can I only do in Erlang?

#17
post #13

Not sure I agree with the conclusions: 1. Binaries: this isn't really an issue. We ship the JVM with anything that we do in Java. Unzip, run, done. Go is probably ideal there but it doesn't support embedded resources without some hideous hacks so you're still going to be deploying more than just a single binary in a lot of cases. CLR is pretty good at this as well. 2. Sockets: 0MQ/WCF/JMS/any stream abstraction wired…

He's talking about dealing with binary data when he says 'binaries': http://www.erlang.org/doc/efficiency_guide/binaryhandling.ht... http://www.erlang.org/doc/programming_examples/bit_syntax.ht... Erlang is really strong for that. As to Java, sure, you can do anything with it, and do a decent job of it. But sometimes, as a startup, you are resource constrained, so if you can do more with less because you have a good…

Thanks for the clarification! My bad.

Yes it is far superior from a representation point of view at least there. I have no doubts about that.

Re: What can I only do in Erlang?

#18

Not sure I agree with the conclusions: 1. Binaries: this isn't really an issue. We ship the JVM with anything that we do in Java. Unzip, run, done. Go is probably ideal there but it doesn't support embedded resources without some hideous hacks so you're still going to be deploying more than just a single binary in a lot of cases. CLR is pretty good at this as well. 2. Sockets: 0MQ/WCF/JMS/any stream abstraction wired…

> 1. Binaries: this isn't really an issue. We ship the JVM with anything that we do in Java. Unzip, run, done. Go is probably ideal there but it doesn't support embedded resources without some hideous hacks so you're still going to be deploying more than just a single binary in a lot of cases. CLR is pretty good at this as well. Not sure you read / understood what that point was about, due to its native binary types,…

Yes thank you for the clarification.

My point is more that regardless of the syntax, runtime or approach, the same outcome is possible without having to enter a risky niche.

PHP does nothing, but if you throw it in a prefork MPM module in apache, it does that.

Sure we don't let it physically crash and we handle the exception at the base of the thread and decide what to do, but the outcome is the same. Java error handling is absolutely fine and in some cases, far less painful that the "err" semantics of Go.

Re: What can I only do in Erlang?

#19

Not sure I agree with the conclusions: 1. Binaries: this isn't really an issue. We ship the JVM with anything that we do in Java. Unzip, run, done. Go is probably ideal there but it doesn't support embedded resources without some hideous hacks so you're still going to be deploying more than just a single binary in a lot of cases. CLR is pretty good at this as well. 2. Sockets: 0MQ/WCF/JMS/any stream abstraction wired…

1. Binaries refers to binary pattern matching, not how you build/deploy the software

3. it's not only letting it crash, it's supervisors, restarts, cascading crashes when the parents retried enought times. Yes you can do it in other languages, but in erlang it's already done and battle tested.

4. that's not supervision

7. in erlang sending a message to a process in the same cpu and in another server has the same syntax and it's the common way of building software, in other languages calling a method and doing a jms message are two different things that you have to deal differently.

8. I would add quick check to the mix, but yes, dialyzer is just a kind of progressive typing

Re: What can I only do in Erlang?

#20
post #9

In 2005, I worked in software development for 6 months before abandoning it for another field. In my new job, I was given the task of writing a server for a messaging application - which would allow users to send a "hand-drawn" message from our own proprietary handheld device to Windows phones. I was told to learn Erlang and get it done - the company was barely 30 people and had no formal training programs. While I h…

Agree, and to look at it from a different angle - to me writing Erlang felt like I was writing config txt files to some underlying system. The system performs good following your "config" but all the hardcore feel is lost for you.
Post reply on HN