News for hackers. Stuff that matters.
Re:Bartosz Milewski - The Downfall of Imperative Programming by josephg on Monday April 09, 2012 @06:23PM (#3819561)
This is a cute idea, but your computer is almost never CPU pegged. It spends most of its time waiting for input from you. For 95% of software, faster execution (through parallelism or whatever) would have no effect.

But don't take my word for it. Look at all the applications you have open right now and check if a magical 1e100Hz processor would make any meaningful difference. For me: iTunes: no. Vim: no. Chrome with hackernews: no. VLC: no. Terminal: no.

"We need to rethink software design to make our programs run faster" – Hardly. We're actually seeing the opposite trend. People are caring less about CPU performance now than they used to. One of the effects is that real software is being written in slow languages like Ruby and Coffeescript, performance be damned.

There are obviously exceptions (games and scientific simulations). But for the other 95% of code out there, we simply don't need the parallelism of functional languages to write good software.

Re:Bartosz Milewski - The Downfall of Imperative Programming by j_baker on Monday April 09, 2012 @08:24PM (#3820024)
I think it's stretching it to say that 95% of programs won't peg your CPU. Ok, maybe 95% of all programs written for an actual desktop/laptop that aren't games are. But we live in a more complex world where mobile devices are slow, but have multiple cores. And what about games? Game developers are always trying to squeeze that last little bit of performance out.

And we haven't even gotten into server-side software, nor have we discussed concurrency due to I/O-boundedness.

Re:Bartosz Milewski - The Downfall of Imperative Programming by josephg on Tuesday April 10, 2012 @01:18AM (#3820804)
On mobile devices, you can already be a bit sloppy with your code and your UI will still be responsive. The fact that Corona and Phonegap are usable is proof of that. The 'comfort margin' of mobile CPUs will only increase over the next few years.

You certainly don't need functional languages to write efficient server-side code for I/O-bound applications. People have solved the C10k problem for every imperative language I know.

Ryah (the nodejs guy) makes a pretty strong case that functional programming's parallelism doesn't help you on the server side anyway, because you'll need to scale across multiple machines. Multiple machines mean multiple processes. If you're doing that anyway, you may as well avoid threads entirely and parallelize by spawning a few processes on each server.

Games are the big exception, though I find it curious that I've never heard of any published game (big or small) that was written in a purely functional language. If functional programming really does make concurrent code easier to write, I'd expect at least a couple indie computer game developers to be using them, somewhere!

Anyway, despite how visible game development is, it makes up a small percentage of the computer industry. That we will experience 'The Downfall of Imperative Programming' because some day, I hope game developers use functional languages to make their games run faster is a bit of a stretch.

The ability of functional programming languages to do parallelization is really cool, but you're not solving a problem that many programmers actually have. Its like selling a car by saying it has lots of leg room for tall people. Its a great pitch to the right customer, but don't expect a revolution.

Re:Bartosz Milewski - The Downfall of Imperative Programming by gaius on Thursday April 12, 2012 @09:22AM (#3832182)
Shaders are effectively written FP style. The performance-critical bit of a game isn't waiting for a joystick, it's rendering on the screen.
Re:Bartosz Milewski - The Downfall of Imperative Programming by cageface on Monday April 09, 2012 @09:37PM (#3820256)
This is only true because all of the heavy lifting in those apps is done in C/C++ code that is a real pain in the ass to get right. I'd love to be able to do my low-level DSP work in a higher level language than C++.
Re:Bartosz Milewski - The Downfall of Imperative Programming by doktrin on Monday April 09, 2012 @08:27PM (#3820029)
This is a rather salient point. Relatively few tasks, even at the enterprise level, are actually CPU bound. Memory & I/O are pushed to their limits regularly, however.
Re:Bartosz Milewski - The Downfall of Imperative Programming by saon on Monday April 09, 2012 @11:09PM (#3820470)
I think the consideration (not addressed by the article), is that high power highly-multi-core systems have the potential to change the kind of computing experience we have, and harnessing the power of these systems effectively with the imperative tools available right now is really hard compared to using pure fp.