[Haskell-cafe] Can Haskell outperform C++?

Sam Martin sam.martin at geomerics.com
Mon May 21 17:47:06 CEST 2012


> Yes, this seems to be a separate disease.  Not just using low-level langs, per se, 
> but using them for *everything*.  I have worked at places in industry where teams 
> automatically use C++ for everything.  For example, they use it for building all 
> complete GUI applications, which surprises me a little bit.  I would have thought 
> in recent years that almost everyone was using *something* else (Java,Python, 
> whatever) to do much of the performance-non-critical portions of their application logic.

I think "disease" might be overstating this somewhat :) In defence of using C++ for everything: Interfacing different languages is not exactly trivial, and in some cases, impossible.

If you are writing a program or system that has significant performance requirements, you might just be better off doing the whole thing in C/C++ and living with the annoyance of doing GUIs, or whatever, in C++. The overhead of pulling in another language may simply outweigh the convenience. 

In addition, it's pretty much impossible for me to use Haskell to write portions (or all of) a game that would include a console version. This is largely for build system and platform support issues. Doing everything in C++ is nearly the only option here.

This situation could be improved though, by making it far easier to embed Haskell within C/C++. It's not difficult by design, but there are large engineering obstacles in the way, and it's hard to see where the effort to remove these could come from. But then it would be more plausible to argue that people are missing out by not using a mix of C++ and Haskell.

Cheers,
Sam




More information about the Haskell-Cafe mailing list