News for hackers. Stuff that matters.
Re:Erlang is at long last getting the break it deserves. by KirinDave on Saturday May 17, 2008 @06:16PM (#192964)
So you're suggesting that IM, Chat, SMS and message queues aren't about Parsing and I/O?

Erlang has weaknesses, but certainly those are not it. Basically, Erlang excells at writing servers. Take a look at YAWS (http://yaws.hyber.org/) for a web server written in Erlang that can actually outperform more traditional web servers in very realistic scenarios.

If I had to name a weakness or two of erlang offhand:

1. Integrating foreign code with Erlang is very different from traditional FFI and requires some initial legwork (libraries like Erlectricity http://github.com/KirinDave/erlectricity/tree/master , for example).

2. String manipulation. Erlang doesn't have a real string type. Its string libraries and core string type assume using linked lists for strings, which is spectacularly inefficient. However, there is a movement and a proposal to change the string type to Erlang binaries and provide an alternative string library. Hopefully that will address the problem.

Other than that, it's a reasonably fast and rock-solid implementation of an FP language with a mountain of solid IPC library code integrated at the language level.

Re:Erlang is at long last getting the break it deserves. by yariv on Saturday May 17, 2008 @07:14PM (#193004)
Representing strings as lists can be very efficient depends on what you're trying to do. Incidentally, Haskell does the same thing.

I think the "Erlang sucks for strings" argument is overblown, and it's rarely if ever backed by real world experience and/or data. Erlang is fine for most string handling tasks you'll find in a typical (web) application.

Re:Erlang is at long last getting the break it deserves. by KirinDave on Saturday May 17, 2008 @08:33PM (#193059)
My personal experience has had erlang very poor at handling and manipulating large strings. By poor, let me be clear: slow and spending far too much memory.

We have to be honest identifying our tool's weaknesses, Yariv, even if we like them. EEP-009 (http://www.erlang.org/eeps/eep-0009.html) and EEP-010 (http://www.erlang.org/eeps/eep-0010.html) are extremely important for the continued growth and adoption of Erlang.

Re:Erlang is at long last getting the break it deserves. by yariv on Saturday May 17, 2008 @09:13PM (#193070)
I'm curious -- what kind of string processing tasks did you try to use it for? Did you compare its performance to other languages? Also, did you try to use binaries?

Erlang may not be optimal for applications that do heavy string processing, but the significance of that statement is overblown. Take typical webapps for example. What kind of string processing do they do? Very light stuff. They spend of their cycles slurping binary data from the database and sending it down a socket. Erlang is excellent for this usage. They occasionally take form inputs from a user, in which case they do some simple processing to ensure the input is properly escaped. Erlang handles that just fine.

Most of the "Erlang sucks for strings" arguments remind me of the "Ruby/Java is slow" arguments. They're sort-of true, but they just don't matter for most applications.

Re:Erlang is at long last getting the break it deserves. by KirinDave on Saturday May 17, 2008 @10:21PM (#193103)
Why not contact me personally if you'd like more details via Twitter or AIM (this name). The short story: An attempt at a distributed web crawler showed that Erlang's default string type was not suitable for large strings.

Please don't confuse this sentiment with any anti-erlangism or any assertion that Erlang isn't fantastic. I just want to be realistic, and I'd love to have faster string processing to make faster routing code for Fuzed (http://github.com/KirinDave/fuzed/tree/master).