Monty Python's Life of Brian, the Functional Programmer

Kragen Sitaker kragen@pobox.com
Sun, 24 Sep 2000 21:16:10 -0400 (EDT)


This is a most amusing article.  It reminds me of Alan Cox's Slashdot
article on the Town Hall Effect.

From: Markus Mottl <mottl@miss.wu-wien.ac.at>
Newsgroups: comp.lang.functional
Subject: Re: Why C will never die... and FP isn't going to take over the world...
Date: 18 Sep 2000 13:52:42 GMT
Message-ID: <8q56na$g4u$1@bird.wu-wien.ac.at>

George Russell <ger@informatik.uni-bremen.de> wrote:
> There are some problems for which functional programming offers no conceivable advantage.
> Consider for example complex floating point code of the sort found in
>    http://cm.bell-labs.com/netlib/fdlibm/
> (which is a very well-written set of routines for computing the elementary functions
> in C given the elementary IEEE arithmetic functions).   The most you could say is
> that functional languages could be as good for this sort of thing.  But given a choice
> I would rather write such code in C, since I have more control over what is going on.
> In the same way, it is still the case that if you want the very best performance you
> need to write assembler.  (And understand pipelining on the target machine, which is
> a lot harder.)

It is common practice to write very efficiency demanding libraries in
low-level languages. But why does this rule out FPLs for applications where
such libraries are required? As for other languages, you can easily
interface (most) FPLs to C (or worse ;)

E.g. take the BigNum-library of OCaml: it is a chimera of about 50% OCaml,
25% C and 25% Assembler. Needless to say that both performance and
convenience are on a very high level...

As others have already noted, there is no excuse for us (other than lack of
interest) that we have not implemented so many practically useful libraries
up to now.

Sometimes this newsgroup reminds me a bit of the following scenes (hm,
wasn't this a comedy on *religious* groups? ;)

---------------------------------------------------------------------------
BRIAN:  Visual Basic scripts, Java beans, Perl modules.
REG:  Got any theorem proving frameworks?
BRIAN:  I haven't got any theorem proving frameworks.  Sorry.  I've got
        GUI builders, IDE support, database interfaces--
REG:  No, no, no.
BRIAN:  Java beans?
REG:  I don't want any of that industrial rubbish.
JUDITH:  Why don't you sell proper software components?
BRIAN:  Proper software components?
REG:  Yeah, not those rich imperialist tit-bits.
BRIAN:  Well, don't blame me.  I didn't ask to sell this stuff.
REG:  All right.  Bag of Java beans, then.
FRANCIS:  Make it two.
REG:  Two.
FRANCIS:  Thanks, Reg.
BRIAN:  Are you "comp.lang.ml"?
REG:  F*** off!
BRIAN:  What?
REG:  "comp.lang.ml".  We're "comp.lang.functional"!  "comp.lang.ml".
      Cawk.
FRANCIS:  Wankers.
BRIAN:  Can I... join your group?
REG:  No.  P*** off.
BRIAN:  I didn't want to sell this stuff.  It's only a job.  I hate the
    industry as much as anybody.
comp.lang.functional:  Shhhh.  Shhhh.  Shhh.  Shh.  Shhhh.
REG:  Stumm.
JUDITH:  Are you sure?
BRIAN:  Oh, dead sure.  I hate the industry already.
REG:  Listen.  If you really wanted to join C.L.F., you'd have to really
    hate the industry.
BRIAN:  I do!
REG:  Oh, yeah?  How much?
BRIAN:  A lot!
REG:  Right.  You're in.  Listen.  The only people we hate more than the
    industry is those impure "comp.lang.ml".
C.L.F.:  Yeah...
JUDITH:  Splitters.
C.L.F.:  Splitters...
FRANCIS:  And "comp.lang.scheme".
C.L.F.:  Yeah.  Oh, yeah.  Splitters.  Splitters...
LORETTA:  And "comp.lang.functional".
C.L.F.:  Yeah.  Splitters.  Splitters...
REG:  What?
LORETTA:  "comp.lang.functional".  Splitters.
REG:  We're "comp.lang.functional"!
LORETTA:  Oh.  I thought we were "comp.lang.apl".
REG:  APL!  C-huh.
FRANCIS:  Whatever happened to the APL-group, Reg?
REG:  He's over there.
C.L.F.:  Splitter!
(...)
---------------------------------------------------------------------------

Hm, does this mirror reflect something? ;)

How about criticizing industry? ...

---------------------------------------------------------------------------
REG:  They've bled us white, the bastards.  They've taken everything we
    had, and not just from us, from our fathers, and from our fathers'
    fathers.
LORETTA:  And from our fathers' fathers' fathers.
REG:  Yeah.
LORETTA:  And from our fathers' fathers' fathers' fathers.
REG:  Yeah.  All right, Stan.  Don't labour the point.  And what have they
    ever given us in return?!
XERXES: Graphical user interfaces?
REG:  What?
XERXES:  Graphical user interfaces
REG:  Oh.  Yeah, yeah.  They did give us that.  Uh, that's true.  Yeah.
COMMANDO #3:  And office suites.
LORETTA:  Oh, yeah, office suites, Reg.  Remember what typing letters
    used to be like?
REG:  Yeah.  All right.  I'll grant you graphical user interfaces and
    office suites are two things that the industry has done.
MATTHIAS:  And accounting software.
REG:  Well, yeah.  Obviously accounting software.  I mean, the accounting
    software goes without saying, doesn't it?  But apart from office
    suites, GUIs, and accounting software--
COMMANDO:  Integrated development environments.
XERXES:  Medical software.
COMMANDOS:  Huh?  Heh?  Huh...
COMMANDO #2:  Educational software.
COMMANDOS:  Ohh...
REG:  Yeah, yeah.  All right.  Fair enough.
COMMANDO #1:  And computer games.
COMMANDOS:  Oh, yes.  Yeah...
FRANCIS:  Yeah.  Yeah, that's something we'd really miss, Reg, if the
    industry left.  Huh.
COMMANDO:  Public web access.
LORETTA:  And it's safe to buy things over the web now, Reg.
FRANCIS:  Yeah, they certainly know how to achieve security.  Let's face
    it.  They're the only ones who could in a place like this.
COMMANDOS:  Hehh, heh.  Heh heh heh heh heh heh heh.
REG:  All right, but apart from GUIs, medical software, educational
    software, computer games, data security, IDEs, accounting systems,
    office suites, and public web access, what has the industry ever done
    for us?
XERXES:  Brought us high income.
REG:  Oh.  Income?  Shut up!
(...)
---------------------------------------------------------------------------

So, you want to make things better now? Let's see how we go about doing
this in "comp.lang.functional":

---------------------------------------------------------------------------
REG:  Right.  Now, uh, item four: attainment of world supremacy within the
    next five years.  Uh, Francis, you've been doing some work on this.
FRANCIS:  Yeah.  Thank you, Reg.  Well, quite frankly, siblings, I
    think five years is optimistic, unless we can smash the industrial
    empire within the next twelve months.
REG:  Twelve months?
FRANCIS:  Yeah, twelve months.  And, let's face it.  As empires go,
    this is the big one, so we've got to get up off our a**** and stop
    just talking about it!
COMMANDOS:  Hear!  Hear!
LORETTA:  I agree.  It's action that counts, not words, and we need action
    now.
COMMANDOS:  Hear!  Hear!
REG:  You're right.  We could sit around here all day talking, passing
    resolutions, making clever speeches.  It's not going to shift one
    industrial programmer!
FRANCIS:  So, let's just stop gabbing on about it.  It's completely
    pointless and it's getting us nowhere!
COMMANDOS:  Right!
LORETTA:  I agree.  This is a complete waste of time.    [bam]
JUDITH:  They've cut funding for Haskell!
REG:  What?
COMMANDOS:  What?
JUDITH:  They've discontinued research in it!  They're going to cancel it!
REG:  Right!  This calls for immediate discussion!
COMMANDO #1:  Yeah.
JUDITH:  What?!
COMMANDO #2:  Immediate.
COMMANDO #1:  Right.
LORETTA:  New motion?
REG:  Completely new motion, eh, that, ah-- that there be, ah, immediate
    action--
FRANCIS:  Ah, once the vote has been taken.
REG:  Well, obviously once the vote's been taken.  You can't act another
    resolution till you've voted on it...
(...)
---------------------------------------------------------------------------

I expect that this article will lead to a flood of another 200 followups
(and not a single practically useful library)... ;)

How about this: for every article you write in c.l.f. you contribute at
least 100 lines of code or documentation to a free software project that
makes use of functional languages. If you post one article per week (hm,
most people write many more ;) and if there are, say, 50 people who
regularly post here (or in "heretic" newsgroups ;), we could throw out 5000
lines of code per week (this would be a fine library!). We'd overrun
industry within 12 months! :-)

I'll start doing this - right now! Really! Honestly! I mean it!

Best regards,
Markus Mottl

-- 
Markus Mottl, mottl@miss.wu-wien.ac.at, http://miss.wu-wien.ac.at/~mottl