TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Joe Armstrong: Solving the wrong problem

237 pointsby geoffhillabout 12 years ago

24 comments

mncolinleeabout 12 years ago
I worked in Cray's compiler department for seven years. If we couldn't dramatically parallelize someone's code, we couldn't sell a vector supercomputer. Period.<p>Automatic parallelization is very possible. The problem is tends to be less efficient. A decent developer can often do a better job than the compiler by performing manual code restructuring. The compiler cannot always determine which changes are safe without pragmas to guide it. With that said, our top compiler devs did some amazing work adding automatic parallelization to some awful code.<p>We inevitably sold our supercomputers because we had application experts who would manually restructure the most mission-critical code to fit cache lines and fill the vectors. Most other problems would perform quite adequately with the automatically-generated code.<p>What this article lacks is a description of why Erlang is more uniquely suited to writing parallel code than all the other natively parallel languages like Unified Parallel C, Fortran2008, Chapel, Golang, etc. There are so many choices and many have been around for a long, long time.
评论 #5452117 未加载
评论 #5452905 未加载
评论 #5453009 未加载
评论 #5456198 未加载
评论 #5453126 未加载
konstruktorabout 12 years ago
&#62; At this point in time, sequential programs started getting slower, year on year, and parallel programs started getting faster.<p>The first part of this statement is plain wrong. Single thread performance has improved a lot due to better CPU architecture. Look at <a href="http://www.cpubenchmark.net/singleThread.html" rel="nofollow">http://www.cpubenchmark.net/singleThread.html</a> and compare CPUs with the same clock rate, where a 2.5 GHz. An April 2012 Intel Core i7-3770T scores 1971 points while a July 2008 Intel Core2 Duo T9400 scores 1005 points. This is almost double the score in less than four years. Of course, one factor is the larger cache that the quad core has, but this refutes Armstrong's point that the multicore age is bad for single thread performance even more.<p>For exposure to a more balanced point of view, I would highly recommend Martin Thompson's blog mechanical-sympathy.blogspot.com. It is a good a starting point on how far single threaded programs can be pushed and where multi-threading can even be detrimental.<p>Also, I think that fault tolerance is where Erlang really shines. More than a decade after OTP, projects like Akka and Hysterix are finally venturing in the right direction.
评论 #5452699 未加载
评论 #5452189 未加载
评论 #5452953 未加载
评论 #5452651 未加载
评论 #5453611 未加载
评论 #5454045 未加载
daleharveyabout 12 years ago
I cant help but read a lot of irony in this.<p>Erlang solved a problem really well over 20 years ago, its the sanest language by far that I have used when dealing with concurrent programming. (I havent tried go or dart yet) and I owe a lot of what I know to the very smart people building erlang.<p>However it has barely evolved in the last 10 years, will 2013 be the year of the structs? (I doubt it), every new release comes with some nice sounding benchmark about how much faster your programs will run in parallel and there is never a mention of whats actually important to programmers, a vibrant ecosystem and community, language improvements that doesnt make it feel like you are programming in the 80's. Better constructs for reusing and packaging code in a sane way.<p>Its fairly trivial in most languages to get the concurrency you need, I think erlang is solving the wrong problem in 2013.
评论 #5452874 未加载
评论 #5451790 未加载
评论 #5451780 未加载
dvtabout 12 years ago
Same old hype. Erlang is good I guess, and I've used it in production a couple of times. But it's just a language that solves 3 problems but creates another 30. Just like C++11, Dart, Go, etc.<p>This kind of belligerent rhetoric (we're solving the right problems, everyone else is dumb) is the kind of drivel that gives momentum to language zealots that think language X is better than language Y.<p>I've contributed to Google Go in the early phases and I was naïve and really believed that Go was the "next big thing." But it turned out to be yet another general-purpose language with some things that were really interesting (goroutines, garbage collection, etc.) but some things that were just same-old same-old. Now, I'm editing a book about Dart and I've since lost my enthusiasm for new languages; I can already see that Dart solves some problems but often creates new ones.<p>And in a lot of ways Erlang sucks, too. The syntax is outdated and stupid (Prolog lol), it has weird type coercion, memory management isn't handled that well (and many more). Of course, since Facebook uses it, people think it's a magic bullet (Erlang is to Facebook like Python is to Google).<p>The article also forces readers to attack a straw man. Often times, algorithms simply <i>cannot</i> be parallelized. The Fibonacci sequence is a popular example (unless you use something called a prefix sum -- but that's a special case). So in many ways, the rhetorical question posed by the article -- "but will your servers with 24 cores be 24 times faster?" -- is just silly.
评论 #5451925 未加载
评论 #5452923 未加载
评论 #5452144 未加载
djvu9about 12 years ago
We used Erlang several years ago. The code base has ~100k lines of code so it should be representative. We abandoned it later and switched to C++ because of performance (mostly in mnesia) and quality issues (some drivers in OTP). We didn't expect too much from performance considering it is functional (which seldom does in place update) but it is still below expectation.<p>It is understandable though. Just think about how much resources have been put into development of Erlang VM and the runtime/libraries(OTP), and compare it with JVM/JDK. There is just no magic in software development. When talking about high concurrency and performance, the essential things are data layout, cache locality and CPU scheduling etc for your business scenario, not the language.
评论 #5452477 未加载
eridiusabout 12 years ago
If zlib could be rewritten in Erlang to be lock-free, why not just rewrite it in C to be lock-free instead of porting it? AFAIK Erlang isn't some magical language that allows traditionally-locked data structures to become lock-free.
评论 #5451637 未加载
评论 #5451979 未加载
评论 #5452344 未加载
评论 #5452938 未加载
评论 #5451528 未加载
eksithabout 12 years ago
There's one big problem Erlang couldn't solve that I live with to this day :<p>Unlike another general purpose language (like say, C++ or C#) allow me to grasp what's happening after staring at it for 30 seconds. This is the same problem, I have with Lisp.<p>Maybe I'm just dyslexic, but these rhetoric pieces for one language or another that says it's concurrent (which it is), fast (obviously), more C than C, will bring the dead to life, create unicorns and other wonderful, fantastic things that I'm sure are all true, just don't seem to be capable of passing into my grey matter.<p>You know another thing all these amazing super power languages haven't been able to do that even a crappy, broken, in many ways outright <i>wrong</i>, carcinogenic etc... etc... language like even PHP has allowed me to do? Ship in 48 hours.<p>Before, I get flamed, I already tried that with Nitrogen (<a href="http://nitrogenproject.com" rel="nofollow">http://nitrogenproject.com</a>). It didn't end well, but maybe it will work for someone already familiar with Erlang.<p>It's like you've written the Mahabharata; it'a a masterpiece and it's one of the greatest epics of all time. Unfortunately, it's written in Sanskrit.
评论 #5452271 未加载
评论 #5452178 未加载
评论 #5452315 未加载
评论 #5452683 未加载
评论 #5452943 未加载
acdhaabout 12 years ago
zlib is fine as long as you don't give an non-threadsafe memory allocator - see <a href="http://www.gzip.org/zlib/zlib_faq.html#faq21" rel="nofollow">http://www.gzip.org/zlib/zlib_faq.html#faq21</a>. As far as I can tell, it either means that the summary was imprecise and the slowdown was in the image processing code and not zlib or that they chose to rewrite (and debug) a big chunk of code rather than read the zlib documentation.<p>Ignoring that point, this seems like a poor point for comparison as it's a trivially parallelized task because zlib operates on streams and shouldn't have any thread contention. There's very little information in the description but unless there are key details missing, this doesn't sound like a problem where Erlang has much interesting to add. The most interesting aspect would be the relative measures for implementation complexity and debugging.
Uchikomaabout 12 years ago
Because the lock-free Erlang meme doesn't die:<p><pre><code> 1. Erlang has locks and semaphores [1], receive is a lock, actors are semaphore. Erlang chose a 1 semaphore/ 1 lock per process model 2. Erlang scales better not because of being lock-free (see above), but because it easily uses async compared to other languages 3. Async prevents deadlocks not Erlang being lock-free (see above) </code></pre> Some 4year old reading <a href="http://james-iry.blogspot.de/2009/04/erlang-style-actors-are-all-about_16.html" rel="nofollow">http://james-iry.blogspot.de/2009/04/erlang-style-actors-are...</a><p>[1] <a href="http://en.wikipedia.org/wiki/Semaphore_(programming)" rel="nofollow">http://en.wikipedia.org/wiki/Semaphore_(programming)</a>
splicerabout 12 years ago
&#62; <i>We’re right and the rest of the word is wrong. We (that is Erlang folks) are solving the right problem, the rest of the world (non Erlang people) are solving the wrong problem.</i><p>&#62; <i>The problem that the rest of the world is solving is how to parallelise legacy code.</i><p>As member of the rest of the world, I can assure you that I'm not trying to solve either of these problems. :p
InclinedPlaneabout 12 years ago
People have been thinking this, that it's vastly better to design for concurrency upfront, for literally decades. And every single time there has been a big sea change in processor technology it's always been the <i>next</i> generation which will see things like VLIW or Erlang and so forth come to the fore while what I will call "iterative advancements" and "patched solutions" turn out to have too many weaknesses to be competitive. In reality the reverse has happened, and new specialized languages and instruction sets have been relegated to niches.<p>It'll be the same over the next 20 years as well.<p>I predict that we'll see a lot of technological leaps which will serve as much to maintain the ability to run "old code" in new and interesting ways as to enable a brave new world of purpose-built languages.<p>In the next few decades we'll see advances in micro-chip fabrication and design as well as memory and storage technology (such as memristors) which will result in even handheld battery powered devices having vastly more processing power than high-end workstations do today.<p>Is that an environment in which one seeks to trade programmer effort and training in order to squeeze out the maximum possible efficiency from hugely abundant resources? Seems unlikely to me, to be honest.<p>Indeed, it seems like the trend of relying on even bloatier languages (like Java) will continue. Do you think anyone is going to seriously consider rewriting the code for a self-service point-of-sale terminal in Erlang in order to improve performance? That's not the long pole, it never has been, and it's becoming a shorter and shorter pole over time.<p>In the future we'll be drowning in processor cycles. The most important factor will very much not be figuring out how to use them most efficiently, it'll be figuring out how to maximize the value of programmer time and figuring out how to use any amount of cycles to provide value to customers effectively.<p>(I think that advancements in core, fundamental language design and efficiency will happen and take hold in the industry, but mostly via back-door means and blue sky research, rather than being forced into it through some impending limitation due to architecture.)
评论 #5454101 未加载
meshkoabout 12 years ago
The lack of understanding is amazingly widespread. I often have to explain to people that when they look at their CPU utilization and it is at 10% it means "you are throwing money way", not "you are efficient".
评论 #5451835 未加载
评论 #5451868 未加载
kamaalabout 12 years ago
This blog post shows everything that is wrong with languages like Lisp and Erlang. This is total disregard for that the rest of the world considers valuable to them.<p>The problem with these languages remain unchanged. The syntax is so strange and esoteric, learning and doing anything basic things with them will likely require months of learning and practice. This lone fact will make it impractical for 99% for all programmers in the world.<p>No serious company until its absolutely unavoidable(and situation gets completely unworkable without it) will ever use a language like Erlang or Lisp. Because every one knows the number of skilled people in market who know Erlang, are close to zero. And those who can work for you are going to be crazy expensive. And not to mention the night mare of maintaining the code in this kind of a language for years. There is no friendly documentation or a easy way a ordinary programmer can use to learn these languages. And there is no way the level of reusable solutions available for these languages as they are for other mainstream C based languages.<p>In short using these languages attracts massive maintenance nightmares.<p>The concurrency/parallelisation problem today is very similar to what memory management was in the 80's and 90's. Programmers hate to do it themselves. These are sort of things that the underlying technologies(Compilers/VM's) are supposed to do it for us.<p>I bet most of these super power languages will watch other pragmatic languages like Perl/Python/Ruby/Php etc eat their lunch over the next decade or so when they figure out more pragmatic means of achieving these goals.
评论 #5453596 未加载
评论 #5454855 未加载
评论 #5453414 未加载
评论 #5453876 未加载
评论 #5453967 未加载
评论 #5459088 未加载
zzzeekabout 12 years ago
&#62; The road to automatic parallelisation of sequential programs is littered with corpses. It can’t be done. (not quite true, in some specific circumstances it can, but this is by no means easy).<p>vs three paragraphs later<p>&#62; Alexander’s talk gave us a glimpse of the future. His company concurix is showing us where the future leads. They have tools to automate the detection of sequential bottlenecks in Erlang code.<p>why is that not a contradiction? because an erlang program isn't "sequential" to start with?
评论 #5451813 未加载
评论 #5451694 未加载
评论 #5451958 未加载
评论 #5451693 未加载
surferbayareaabout 12 years ago
Have you even used zlib in c++? The largest ecommerce site out there uses zlib in a multitreaded c++ application(24 cores, 100s of threads, 1000s requests/sec/server) and it works just fine! Bet you erlang can't come within a tenth of the performance of c++...
评论 #5454872 未加载
评论 #5459501 未加载
dapabout 12 years ago
This completely misses the fact that many network services are not compute bound, and multi-tenancy (as we get from "the cloud") lets "legacy" code make very efficient use of CPU resources, even a larger number of relatively slow cores.
alexchamberlainabout 12 years ago
A very very interesting article, but I was extremely disappointed with the example they gave.<p>So, there was an error in someone's code which you rewrote without the error and it ran faster? Well done detective...<p>We need more parallel programs, no doubt, but we need more, better programmers, who are willing to write in compiled languages with low-overhead.
artsrcabout 12 years ago
Excel solves this right problem, and Erlang does not.<p>Erlang allows you to create concurrent programs, i.e.: programs where the result is schedule dependent.<p>One right problem is allowing people to write deterministic parallel programs. This gives you the speed (from parallel) with the reliability (from deterministic).
spenroseabout 12 years ago
In conventional blocking languages, you can get a start on parallelizing your programs this way:<p><pre><code> - break program into function calls that match the steps that can happen in parallel - wrap the function calls in messages passed over the network + i.e. process(thing) -&#62; post(thing)/poll_for_things() - split the sender and receiver into different processes </code></pre> OF COURSE there are big advantages to using a language (Erlang) or a heavyweight framework (map/reduce) designed for concurrency. Rolling your own process-centric concurrency is a different set of tradeoffs, not a panacea. But it's worth considering for some problems.
uwigerabout 12 years ago
To say that Erlang fails to deliver what most programmers need misses the point. If you have a mainstream problem, use a mainstream language!<p>I've spent many years developing and reviewing products in the telecoms realm, and have found that failing to realize <i>when</i> something like Erlang brings life-saving concepts to your project may well make the difference between delivering on time and disappearing into a black hole of endless complexity. It's not for everyone, but when it fits, boy does it help!
damian2000about 12 years ago
I would hazard a guess that 90%+ of the worlds programmers are working on projects that don't really need to use parallelism to get the job done.
评论 #5453233 未加载
ternaryoperatorabout 12 years ago
Joe Armstrong: "The problem that the rest of the world is solving is how to parallelise legacy code."<p>Donald Knuth: "During the past 50 years, I’ve written well over a thousand programs, many of which have substantial size. I can’t think of even five of those programs that would have been enhanced noticeably by parallelism or multithreading."
fulafelabout 12 years ago
all true. to add' we are in a local optimum where we have a lot of fast non- parallel solutions and the parallel way needs &#62;10 x parallelism. we'll see if we ever get to ubiquitous 100-way parallelism with no need for backward compatibility.
jlebrechabout 12 years ago
Which frameworks can you use?<p>This? <a href="http://nitrogenproject.com/" rel="nofollow">http://nitrogenproject.com/</a>
评论 #5455762 未加载