LWN.net Logo

Lacking manageability

Lacking manageability

Posted May 2, 2007 12:22 UTC (Wed) by man_ls (subscriber, #15091)
Parent article: The Rise of Functional Languages (Linux Journal)

I'm not sure why, but I cannot find examples of large programs written in functional languages. I mean million-line-plus projects; the closer examples I found are Emacs and XEmacs (in Lisp), but they don't get there (650k and 130k). It is however very easy to find large programs in C, C++ and Java. (Note: compilations like CPAN or XEmacs-Packages are not what I'm looking for.)

Is it because functional languages are somehow less manageable?; in other words, is it harder to keep large functional programs understandable? Or maybe they are there, but are harder to find -- or are not free software?


(Log in to post comments)

Lacking manageability

Posted May 2, 2007 14:02 UTC (Wed) by robertm (subscriber, #20200) [Link]

Or, a third possibility, is that functional languages are simply more compact than C++ or Java. Another data point for you is Maxima, which comes in at under 600kloc of Lisp. It would be interesting to do a proper study of "large" programs in various languages though. Of course, one would have to define "large" in a way that doesn't count amount-of-code, since that's the metric under question.

For what it's worth, my own experience (with Java, C++, Common Lisp, OCaml, and Erlang) suggests that you spend a lot less time writing near-boilerplate scaffolding in functional languages than in object-oriented ones.

Lacking manageability

Posted May 2, 2007 14:24 UTC (Wed) by man_ls (subscriber, #15091) [Link]

There is such a measure; it is called, confusingly enough in this context, functional metrics and it revolves around function points. Still, it says otherwise:
Statements per function point:
  • C: 128
  • C++: 53
  • Java: 32
  • Lisp: 64
Lisp would be a lower-level language than Java and slightly lower than C++. I don't know if those figures can be trusted though; your experience would seem to say otherwise.

Lacking manageability

Posted May 3, 2007 3:58 UTC (Thu) by robertm (subscriber, #20200) [Link]

Interesting. And, as you say, counter to my personal experience. I wonder where those numbers came from, exactly. The paper isn't exactly clear -- "We developed these numbers empirically using our Web applications database because the IFPUG numbers did not seem to be consistent with our current experience. This count includes the volume of work required to program Java scripts and beans on both the client and server, assuming that an appropriate Java environment were available for this distributed application."

To be somewhat facetious, I'm not terribly surprised Java does the best at creating Java beans. More seriously, I suspect from this that what the numbers measure is really "library availability", something which most functional programmers will readily admit is not (yet) a strong suit of their favorite languages. Useful if you're just gluing web browsers to databases (a large fraction of real development work, alas), but less so if you're striking out in new directions.

Lacking manageability

Posted May 3, 2007 6:09 UTC (Thu) by man_ls (subscriber, #15091) [Link]

Capers Jones in "Applied Software Measurement" (1991), p.76 shows the same values for C and Lisp. Java did not exist, and C++ does not appear on its own; object-oriented default is listed at 29.

You are not alone at pointing out that functional code does more with less. Maybe the numbers are all wrong, but they were extracted for exactly this purpose: make high-order trends evident. So maybe object-oriented code does "even more with less", thanks to libraries and such. After all, code reuse has been sold as a major winning point for objects all along.

Lacking manageability

Posted May 2, 2007 14:19 UTC (Wed) by pharm (guest, #22305) [Link]

Is it because functional languages are somehow less manageable?; in other words, is it harder to keep large functional programs understandable? Or maybe they are there, but are harder to find -- or are not free software?

Most functional languages tend to have less boiler plate than the 'traditional' languages like C+ +.

Handwave follows: There's probably more conceptually complexity in 10 lines of Haskell than in 100 lines of C++. (Unless the C++ is drawing heavily on TR1, Boost lambdas etc etc, in which case things are probably more like 2:1)

The largest 'program in a functional language' I'm aware of is the Ericsson telecoms switch code which I believe clocks in at over 1.7 million lines of code.

Lacking manageability

Posted May 2, 2007 14:20 UTC (Wed) by pharm (guest, #22305) [Link]

s/conceptually/conceptual/

sigh.

Copyright © 2008, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds