pumping out the functionality: language and community quality versus productivity

Submitted by metaperl on Mon, 03/28/2005 - 7:56am.

I think Haskell is the best computer programming language. I say so for two reasons. First, the community of people is excellent. I have yet to see one arrogant hothead anywhere. I have had discussions with some of the best Haskell programmers out there with absolutely no sense of them thinking they are better than me. Having been around Perl for 5-7 years, let me tell you, it is rough in Perl world. And there are plenty of arrogant, egotistical self-centered people in that community. In fact, I suppose being around them has made me that way as well. Haskell is also the best computer programming language because of it's wonderful mix of strong typing and pure functional approach. Finally, haskell is an amazing project to be the result of a community effort. How in the world could a group of people get together and not simply fight and bicker and never agree? Perl was a 1-man language. Emacs was a 1-man language. Ditto for Tcl, Python and I guess PHP. Unix was a 2-man project.

Anyway, now that I have said how great a _language_ Haskell is, let us note its chief deficiency. No available functionality. I remember 2 weeks ago Philippa was asking in #haskell about whether another person had a CGI extension to deal with cookies... Perl has had this since the dot-com era! Perl has search.CPAN.org, which is a huge library of modular functionality for a plethora of real-world scenarios.

Now, let's move on to PHP. From a purely linguistic perspective, PHP is a worse language than Perl: http://tnx.nl/php. BUT from an application perspective, it outdoes Perl. I did not say from a modular/functionality perspective, but from the application perspective.

Applications are tools that are ready to run. Modules are pluggable units of functionality to build applications. Functions are even smaller units of pluggable functionality to build applications. Abstractly, applications, modules and functions all fill a gap. Applications fill the largest gap, modules fill the medium gap and functions fill the smallest gap. The relation between immediate ability to fill a gap and language quality is inversely proportional. Or, concretely: PHP sucks as a language, but rules in filling the biggest gap in apps. Haskell rules as a language, but sucks in filling application and modular gaps. And Perl is right in the middle. It is a decent language with great ability to fill in the middle gaps. It is not as composable as haskell and thus cannot compete in filling in small gaps. It lacks good, out-of-the-box applications like phpMyAdmin and Drupal and postNuke, and phpBB.

/me dons flame-retardant vest.

Submitted by shapr on Mon, 03/28/2005 - 8:11am.

Maybe libraries are a crutch for insufficiently expressive languages?

Submitted by metaperl on Mon, 03/28/2005 - 9:29am.

In some cases, yes. Take a look at Perl. We have created Language::Functional because... no wait. The stuff in Language::Functional puts in a module what is available in modules in Haskell... There's no difference there.

Submitted by Philippa (not verified) on Thu, 03/31/2005 - 8:43am.

Depends. Everybody having to reinvent the wheel on something is still often worse - imagine if everybody had their own version of the Prelude?

Submitted by metaperl on Mon, 03/28/2005 - 8:52am.

Computer languages are supposed to map human thought to computer operations.

However, human thought and the science of computations are not isomorphic.

The best language for expressing computation is Haskell. Witness Autrijus' comments about transforming pugs from interpreter to compiler. However, the best language for expressing human thought appears to be Logo, Basic, or PHP. Perl is also good to some extent for this purpose.

Submitted by jgoerzen on Mon, 03/28/2005 - 11:19am.

This is a nice and thought-provoking post, and I agree with your analysis of the deficiencies of Haskell.

You are quite right that CPAN has a lot more modules out there than are available for Haskell, and that it is more usefully organized.

The organization problem probably won't persist for too much longer, given the Cabal and Hackage projects. We are moving to a standard way to express the builds of Haskell code (Cabal), and Hackage is a web site designed around Cabal.

The breadth of available modules is a problem that will likely persist for awhile. I don't believe this is a problem with Haskell itself, nor do I believe that the problem is permanent.

I am doing what I can to try and help out.

To start with, my MissingH library is a collection of code I have found useful, as a former Python (and even longer ago, former Perl) hacker. It's my attempt to fill in the Haskell library where it seems deficient. MissingH is pure Haskell and very portable.

Besides porting code to Haskell, there are some other methods that can be useful, too:

First, there is FFI, the standard Haskell method of calling to (and being called from) C code. As someone that has tried to work with the C interface from other high-level languages (Python, etc.), FFI is amazingly simple and easy to use. Haskell provides a lot of support for using FFI.

Finally, there can be interfaces to other high-level languages that maybe provide more needed features. My MissingPy library, for instance, provides an interface to Python. It supports Python file-like objects as Haskell HVIO objects, thus providing things like bzip2 and gzip (de)compression for free. It can access Python objects, evaluate Python code, etc. It took me about a week to whip it up, so it shouldn't be too hard to come up with interfaces to other languages like Perl. (An interface to Java also exists).

So, bottom line is, yes, there is a barrier to entry with Haskell if you find yourself needing lots of these modules. But the barrier isn't all that impenetrable.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.