Live data from Hacker News

What can I only do in Erlang?

erlang.org

61–70 of 173 posts

Re: What can I only do in Erlang?

#61
post #57

Added in edit: Seeing that this is getting down-votes suggests either that I've not been sufficiently clear in the point I'm trying to make, or that you think I've phrased it in an unacceptable way. Either way, sorry you don't think this fits here, but I'll leave it for others to down-vote, correct, reply to, or support, as they see fit. Another edit: Getting more down-votes, but not learning anything. Do you think t…

That's actually the first thing the answer in the post addresses: > Anything can be done in any language, so the technical answer is "nothing". But the spirit of the question begs for an answer, especially in a company situation with deadlines.

I read that first answer (and the others) carefully before writing the above, and I don't think it does. Well, let me be more precise.

The answer addresses the question I think the questioner intended to ask. What the answer does not do is fully disambiguate the question as asked, nor does it even point out that the question as asked is ambiguous. It just takes what it thinks is the most obvious interpretation, and answers that.

Which is fair enough. Most people are going to adopt that interpretation and understand the intent of the question. That's not addressing the point I'm trying to make, which is that the question as asked is ambiguous, and yet a simple re-wording would not be ambiguous. Or at least, not as ambiguous.

But I guess my point is lost, and people will down-vote this thinking I'm just picking nits. Lost cause, but I honestly don't understand why programmers of all people should care so little about the careful and precise use of natural language.

They appear not to, and I'll have to take that as an axiom without understanding.

To be honest, your reply has made me stop completely and reassess everything. In particular, the fact that you of all people seem not have missed completely my intended point makes it perfectly clear to me that I quite simply have failed utterly to make my point at all. I know your posts and comments on HN, I recognize your nick, so to have you not see the point means that, somehow, it's simply not there to be seen. I'll have to go away and think again as to whether it is in fact possible to make the point, and if possible, whether I'm a good enough writer to do so. Current evidence suggests not.

And finally, you say ...

    That's actually the first thing the
    answer in the post addresses ...
Maybe I've mis-interpreted your use of "that's", and perhaps I don't know which part of what I've written you think is being addressed in that first answer. Perhaps we're just talking past each other.

Re: What can I only do in Erlang?

#62
post #49
post #36

Earlier quoted context omitted.

When you say Erlang is slower than C++, You are right. It is also slower than Go. Ruby is also slower than C++ & Go, But Ruby on Rails is not only popular but a very productive web framework which can help you build your app with a productivity that C++ or Go can't match. When you write a high quality, fault tolerate system, the raw speed comes at the end. Erlang shines when you write a concurrent system plus its des…

> and Erlang is perhaps the most commercially successful functional language. Out of interest, what makes you say that? Looking at the TIOBE rankings (not that this is definitive), Erlang doesn't even make the top 20 languages, when F# and R do: http://www.tiobe.com/index.php/content/paperinfo/tpci/index.... Is there a reason you think it's more successful in the commercial world? (btw, I'm a fan of Erlang - unfortun…

Probably because it is used in Ericson switches etc? A lot of stuff has been sold on the back of Erlang even though it is probably a niche language in terms of users/popularity.

Re: What can I only do in Erlang?

#63
post #46

I love Erlang (and it's younger sibling Elixir). I love reading about it. I enjoy following tutorials about it. I love its simplicity. But when I try to come up with scenarios/ideas where Erlang might be a good fit, I realize I'm not smart/motivated enough (yet?) to tackle such problems. Erlang isn't difficult. It's the problems it was designed to solve that are difficult.

You're probably thinking about it the wrong way then. It turns out that even in cases where you don't have some massively distributed, scalable needs, there are a lot of cases to use Erlang. While it makes insanely difficult problems tractable, it can also make moderately challenging problems simple (and it sometimes can make simple tasks irritating; see usual list of Erlang complaints).

Just about any sort of web backend (that isn't having to do a whole lot of number crunching), any sort of interaction with hardware, handling/transport of binary data (as mentioned above), and of course any time you need reliability, it's worth considering.

But even in areas where there's not an obvious win, a lot of problems that are traditionally done in a single threaded manner can be made simpler in a concurrent language like Erlang.

An example I like to give is time based task scheduling. In a traditional language, you'd implement something like that with a priority queue. Which is fine, but you have a lot of work. First, what happens if timings change? You have to rejigger -everything-. What happens if you have multiple tasks at the same time? You need a threadpool or similar to dispatch these things onto. What happens if one task itself creates a new task for a later time? You'll have multiple people adding things onto the priority queue, so now you need to start locking. And of course, since you've got your dispatching process sleeping until the next task is to start, you have to make sure any time you modify the queue, you remember to notify that sleeping task, so it can update as necessary. There is a lot to get wrong.

In Erlang? You spin up a separate process for each task, with a timer. Done (with caveats; you likely will need to persist the task information and load it periodically into a task+timer process, but that's pretty trivial).

A similar case can be made for functional compared to a more procedural approach. That's a little too long winded for here, but even examples that seem -ideal- for OO, can oftentimes be described more simply in a functional, data-centric manner, and future refactorings are made simpler as well in doing so.

Re: What can I only do in Erlang?

#64
post #57

Earlier quoted context omitted.

That's actually the first thing the answer in the post addresses: > Anything can be done in any language, so the technical answer is "nothing". But the spirit of the question begs for an answer, especially in a company situation with deadlines.

I read that first answer (and the others) carefully before writing the above, and I don't think it does. Well, let me be more precise. The answer addresses the question I think the questioner intended to ask. What the answer does not do is fully disambiguate the question as asked, nor does it even point out that the question as asked is ambiguous. It just takes what it thinks is the most obvious interpretation, and a…

> Perhaps we're just talking past each other.

Probably. I think most of us saw the title and reacted like the guy posting "well, technically, nothing" and moved on to the however, which is a fairly straightforward list of "what are the things this system is the best at", which is mostly what we're interested in as programmers and/or startup people.

I didn't downvote you, of course, since people can't downvote stuff on articles they have posted.

Re: What can I only do in Erlang?

#65
post #64

Earlier quoted context omitted.

I read that first answer (and the others) carefully before writing the above, and I don't think it does. Well, let me be more precise. The answer addresses the question I think the questioner intended to ask. What the answer does not do is fully disambiguate the question as asked, nor does it even point out that the question as asked is ambiguous. It just takes what it thinks is the most obvious interpretation, and a…

> Perhaps we're just talking past each other. Probably. I think most of us saw the title and reacted like the guy posting "well, technically, nothing" and moved on to the however , which is a fairly straightforward list of "what are the things this system is the best at", which is mostly what we're interested in as programmers and/or startup people. I didn't downvote you, of course, since people can't downvote stuff…

  > I didn't downvote you, of course, since
  > people can't downvote stuff on articles
  > they have posted.
I knew that, but thanks for mentioning in.

  >> Perhaps we're just talking past each other.

  > Probably. I think most of us saw the title
  > and reacted like the guy posting "well,
  > technically, nothing" and moved on to the
  > however, which is a fairly straightforward
  > list of "what are the things this system is
  > the best at", which is mostly what we're
  > interested in as programmers and/or startup
  > people.
Indeed, and I agree entirely with that. It still completely ignores the point I was trying to make, though, hence my confusion. So to elaborate minimally:

The question as asked is ambiguous. People are putting a reasonable interpretation on it and answering that interpretation, and that's fair enough. I'm trying to point out that more precise use of language costs little, and creates significant benefits in more effective communication.

Seems it's a lost cause, even among programmers, for whom ultra-precise communication is part of their work.

Re: What can I only do in Erlang?

#66

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…

>I spent 2 months disassembling CouchDB to see if we could maintain it

I would love to know your thoughts on this.

Re: What can I only do in Erlang?

#67

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.

Nobody needs reliable messaging: http://www.infoq.com/articles/no-reliable-messaging

'Nobody ' is not quite correct. What you probably mean is not everyone needs reliable messaging.

As a former TIBCO and MQ developer, I could not have done without them when developing trading applications.

Re: What can I only do in Erlang?

#68
post #37
post #35

Earlier quoted context omitted.

You wouldn't use Erlang for number crunching: you'd write some C code and communicate with that. Same as you'd likely do with Ruby or PHP or whatever.

Okay. But let's take the example of the C++ webserver framework written by Facebook employees, which was discussed here a few days ago, [1]. This project contains lots of protocol-handling logic for HTTP/1.1 and SPDY, and beneath that TLS. Are you saying that such projects are better written in a combination of Erlang and C/C++? [1] https://news.ycombinator.com/item?id=8563199

Facebook has two scaling problems. One is the code, sure, but one is also the employees. They need to be able to hire and scale out their teams, and have had to do so quite quickly.

It's easier to find C++ people than it is Erlang. That is a consideration.

It's why Facebook chat was originally in Erlang, then switched to PHP. Facebook already had a lot of PHP devs, they are a lot easier to find, so rather than having to bring people up to speed, or keep a dedicated team always slightly free to be able to handle issues for chat, they rewrote it in PHP.

There is no magic bullet, not even Erlang. You have to weigh a variety of considerations, and pick appropriately based on them. But dismissing Erlang because a benchmark showed it to be slower is likely a mistake; dismissing it because you can't hire fast enough for it is a reasonable business decision.

Re: What can I only do in Erlang?

#69
post #47
post #20

Earlier quoted context omitted.

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.

Huh? "Hardcore feel" is definitely there and the language is anything but "writing config txt files to some underlying system". I've built applications in the > 10k SLOC range that use a consensus algorithm for distributed computing and it was hard but made tremendously easier because of Erlang's built in primitives. No hardcore feel was lost at all and neither was it writing a config txt file... [EDIT] I would love…

Down vote = I don't agree with your statement normally here. Not that it might be a starting point on a conversation?

Re: What can I only do in Erlang?

#70
post #27

Op's work environment is exceptional in many ways. It's a quintessential hacker work place. Unbelievable flexibility. I am sure a place like that attracts people who can make any technical edge, however miniscule, into a real felt advantage. I want to learn about their management, hiring and culture-building practices more than their actual hacking triumphs.

"As for encouraging adoption, I recommend you solve a problem in your spare time that your company has, in Erlang, and demonstrate how easy it is to maintain compared to whatever the accepted solution being worked on is. That's a lot safer thing to your management than "throwing money at a new toy, hoping for a payoff"." For me, this translates to: invest unpaid time for your employer to improve things, on the off ch…

Does your employer not have periodic internal needs, things that are basically "hey, we really need something that Xs", that isn't really directly funded, but which they'd be willing to let you take a week on?

What about devops? Are there any areas where you either aren't collecting data you might want, or you are collecting it but only recovering it after it's caused an issue? Maybe a small utility there will, while nibbling a bit at your productive hours (few hours a week), lead to enough gains over the long term as to offset it.

Sure, if your employer prevents you from touching anything outside your dev box without a TPS report signed by the head of engineering, the head of QA, legal, and Gryphon (the mythical animal one), and any code that passes always has to be in Java, you're out of luck, but that seems like the kind of environment to flee.

Post reply on HN