Is Haskell Failing?
October 18, 2008 11:38 AM   Subscribe

Haskell has a sort of unofficial slogan: avoid success at all costs says one of its inventors, Simon Peyton-Jones. But will the advanced purely functional programming language[, a]n open source product of more than twenty years of cutting edge research remain true to its roots? Things look rather bleak for the obscurity of Haskell. In the wake of Peyton-Jones's own A taste of Haskell, and with the imminent publication of Real World Haskell by O'Reilly and the emergence of the Haskell Platform, comes BONUS's fun, colorfully illustrated Learn You a Haskell for Great Good!.

(Somewhat reminiscent of why's (poignant) guide to Ruby [previously], but a little less, er, exhuberant.) If you read Proggit and LtU, you've already seen all this. Also, sorry inverted-pyramid lovers.
posted by Monday, stony Monday (61 comments total) 40 users marked this as a favorite
 
The first CS course I took in undergrad was all Haskell, and despite my general love for all things coding-related, using that language was such a miserable experience that I decided to switch from computer science to a liberal arts major.

So thanks, Haskell.
posted by spiderwire at 11:43 AM on October 18, 2008 [5 favorites]


Does Haskell precompile into C? If so, I'll stick with C, thanks. The website had me asking myself if the Onion did satires on programming languages.
posted by StickyCarpet at 11:47 AM on October 18, 2008


ghci> 1892 - 1472
420
That choice of example explains a thing or two...
posted by 7segment at 11:56 AM on October 18, 2008 [2 favorites]




Interesting post, thanks. I've for years promised myself to learn a different language, and always tought that would be Lisp or Eiffel, but Haskell looks to be a good candidate too. I have a C, C++, Java, C# background like most everybody else...
posted by Harald74 at 12:00 PM on October 18, 2008


Was Haskell named after the character Eddie Haskell in "Leave It to Beaver"? If so, I wouldn't trust it.
posted by wendell at 12:06 PM on October 18, 2008


Harald74, go for Lisp. It's a religious experience.
posted by StickyCarpet at 12:06 PM on October 18, 2008


In purely functional programming you don't tell the computer what to do as such but rather you tell it what stuff is.

I had much the same experience as spiderwire with Lisp/Scheme, another functional programming language, in an intro CS class. Although I had significant programming experience prior to that, and it did not deter me from continuing afterward, I just found almost everything about the language awkward, unfriendly, and non-intuitive. I didn't say it wasn't powerful, because it was, but given the choice I would rather use something else. There is a clear reason why these languages have remained in academia as research projects and been consistently rejected by commercial developers. It's because they are a pain in the ass and frankly I would rather tell the computer what to do than "what stuff is" when I want to get something done.

StickyCarpet: It is common or functional languages to evaluate themselves, see the metacircular evaluator. In Haskell it seems that the compiler itself is written in Haskell and the runtime is written in C and C-- , with something similar called bootstrapping. The common open source compiler written by the the designer of the language is called the GHC.
posted by sophist at 12:07 PM on October 18, 2008


I had much the same experience as spiderwire with Lisp/Scheme, another functional programming language, in an intro CS class.

The old canard.

Neither Common Lisp nor Scheme are purely functional programming languages. You can have side effects! Not a monad in sight. You can have state! Global state, even. You can be as imperative as you choose. They teach it wrong in CS classes! That is, they teach it for the theory, but they don't teach you how people write Lisp in the real world, perpetuating the understandable misconception that Lisp is unsuited for real programming. Read Practical Common Lisp if you want to learn ... practical Common Lisp. It is perfectly effective for getting things done, and is additionally one of the most flat-out pleasant programming languages you will ever find to work in.
posted by enn at 12:17 PM on October 18, 2008 [4 favorites]


I've for years promised myself to learn a different language

Learn Lisp. You don't learn languages just because they're different. If that's your criteria, just go for Piet or another esoteric language like Brainfuck. Lisp is useful.
posted by spiderwire at 12:30 PM on October 18, 2008


main = putStrLn "Gee, Mrs. Cleaver, you sure look nice today!"
posted by pracowity at 12:31 PM on October 18, 2008 [1 favorite]


I don't have a Mac so I don't know how to install it on OS X but it probably involves using the mouse with only one button.

Yes, the snarkiness will surely draw in new users. Also, the description of the drop list operation is wrong.
posted by ladd at 12:31 PM on October 18, 2008


I've not had the chance to learn Haskell yet, but for my undergrad "principles of programming" class we did Standard ML. At first, writing ML was a very painful experience, but midway through the course, a bunch of us suddenly began to "see" how it was supposed to be done. It felt very much like I had been enlightened in some sense, because I don't think I've seen coding in the same light from that point onwards. Needless to say I kind of fell in love with functional programming the way most programming language (GL) geeks do and took a bunch of courses in the PL area.

My exposure to PL was very much steeped in type theory though, no doubt due to the presence of various luminaries in the field in my colleage (CMU). Quite different from Lisp, and indeed my professor once spent half a lecture showing how you can build a language pretty similar to Lisp through the use of type theory (i.e. ML), and thus Lisp is less expressive than ML. It must be noted that this professor co-authored the definition of Standard ML, and said many times in class that "ML is a gift from God".

But really, I find how programming languages, mathematics and logic intersect and interact extremely intriguing... for example the Curry-Howard isomorphism between programs and logical proofs. Its a bit of a pity that the majority of programmers out there don't get much exposure to all this... I guess a lot of them are just plain not interested. I think a good analogy is like playing a musical instrument without understanding any musical theory.
posted by destrius at 12:32 PM on October 18, 2008 [7 favorites]


I haven't touched functional programming since implementing most of LISP in SML in college, but I found that experience very enlightening. After the first few painful days of struggling to Get functional programming, the way it finally clicked and I could almost feel my brain working in a different way was awesome.

I also credit my college's tact of "learn a new language every few weeks" in some of the core CS classes with how easy it is for me to learn a new one now. Once you've switched amongst java, c, c++, SML, LISP, sparc assembly, and others I've forgotten, picking up the newest iteration of microsoftland is almost trivial, at least for the essentials.
posted by flaterik at 12:45 PM on October 18, 2008


Forget Haskell, 2008 is Smalltalk's time to shine amirite?
posted by PenDevil at 1:16 PM on October 18, 2008 [1 favorite]


ladd: I don't think the author meant to be snarky, just to highlight that installing GHC (and most other language implementations these days) is a walk in the park.
posted by Monday, stony Monday at 1:20 PM on October 18, 2008


Was Haskell named after the character Eddie Haskell in "Leave It to Beaver"?

That's a very nice dress you're wearing, Mrs. Lovelace.
posted by gimonca at 1:29 PM on October 18, 2008 [1 favorite]


At Berkeley they used to make all students learn scheme before they could take any other CS classes, and there was no way to test out of the class. I found it really interesting how angry it made some students. Over and over again you'd here, "why are they making me learn this stupid language, it's not going to have any use in the real world?" Those were the people who didn't understand that, unlike a vocational program, there are lots of skills to being a computer scientist, and knowing how to get a computer is just one such skill. A relatively minor skill at that. Learning scheme as a tiny little freshman blew my mind. I had to rethink so many preconceptions I had about what it meant to program a computer, and there is no doubt it made me a much better engineer, and not just as a programer.

I learned Haskell over a decade later. I'd known of it for a while, and it seemed interesting, but also so crazy. On a whim I picked up a book from amazon and wow. It was amazing. Learning Haskell compares directly with being forced to learn scheme way back when. Anyone who has pride in their engineering chops owes it to themselves to at least learn the basics. There's no way you can really grok the language and be a better engineer.
posted by aspo at 1:50 PM on October 18, 2008 [1 favorite]


Haskell is named after Haskell B. Curry. His surname had already been appropriated as a term for chaining single argument functions together to make a function that takes many arguments (Currying), so they used his first name instead.
posted by pharm at 1:51 PM on October 18, 2008


I actually used a Curry-Howard Isomorphism sort-of icon on several bulletin boards for years (I originally wanted to use a Lambda Cube but BB icons were/are too small). I'm a child (grandcousin?) of that theorem, and the old fella has paid the bills for many many years now.

These days I'm more over the ML dark side, but still... Go Haskell and FP. *waves a little Lambda flag*
posted by Iosephus at 1:59 PM on October 18, 2008


The "Argh, WTF is THIS?!" reaction to Lambda-calculus based language seems very common: my cousin who had to learn Scheme from Marc Feeley thought it was completely crazy.

Does anyone know if they teach Common Lisp to 1st years anywhere? That would seem crazy me.
posted by Monday, stony Monday at 2:03 PM on October 18, 2008


my intro cs class was all scheme. it's part of why i ended up majoring in cs. minimal syntactic cruft, command line interpreter, naturally recursive solutions-- all of this drew me in. if the class had been taught in c++ or java or whatever i'd probably have given the whole thing a miss. with scheme i felt like it was more about learning how to think.

in recent years python has reawakened that same joy of programming in me. like scheme but with useful libraries :)

lately i've been thinking about learning erlang... it's the future mayne
posted by jcruelty at 2:16 PM on October 18, 2008


Haskell has been on my list of languages to learn for a few years.

For those of you who are advocating learning lisp or scheme instead of haskell maybe you should consider pushing ocaml, or it's close cousin F#. It's got a time travel debugger and type safety. Like scheme it's not a purely functional language but it does support a functional programming style. To me it seems like sits at a comfortable midway point between the forest of imperative languages and the sparse desert of almost pure functional languages.
posted by rdr at 2:22 PM on October 18, 2008


As an OCaml hacker, I find myself drawn to Haskell's purity and concise syntax... and the type classes are a pretty sweet innovation as well. But I think lazy evaluation will be the one feature that ultimately prevents Haskell from enjoying serious use in production coding environments. Lazy evaluation makes it very difficult to reason about the complexity and memory requirements of certain algorithms; in a production environment, that's simply not an acceptable risk.

I think OCaml strikes the better compromise here: strict evaluation, with the option to capture expressions as lazy thunks whenever there is a tangible benefit. But secretly, I long for some variant of Strict Haskell to take over and steal all the mindshare of the ML/Haskell community.
posted by Galvatron at 2:26 PM on October 18, 2008


Haskell has a sort of unofficial slogan: avoid success at all costs

Why don't they just call it "Indie"?
posted by namespan at 2:53 PM on October 18, 2008 [1 favorite]


At Berkeley they used to make all students learn scheme before they could take any other CS classes, and there was no way to test out of the class. I found it really interesting how angry it made some students.
This was the case at MIT until the class of 2010, except students were angry when they changed the requirements and eliminated 6.001 (the scheme class) completely. I was sad because the stories I'd heard about scheme, and the course in general had a huge influence on my decision to apply to MIT in the first place.
posted by martinX's bellbottoms at 4:12 PM on October 18, 2008


I took Haskell more seriously when I heard about Pugs.

Programming programming languages is complicated: "Pugs is an implementation of Perl 6 written in Haskell. It is currently the closest thing to a full implementation of Perl 6. It will be used for bootstrapping, providing a platform on which to write the Perl 6 compiler in Perl 6, and the test suite to validate it."

Is Pugs the official Perl 6? "Pugs is expected to be an official Perl 6, but not necessarily the only one."
posted by Pronoiac at 5:34 PM on October 18, 2008 [1 favorite]


I've been a heavy Haskell user for years now, and it is easily my favorite language. Am I the only Mefite who's had more than a dalliance with it?

"Avoiding success at all costs" is one of the major keys to it's decency — Both Smalltalk and Common Lisp were neutered by corporate pettiness — ossification, inherited bloat, sales.

It's 21 years old, but still feels like there's so much unexplored territory, especially when most languages feel nearly finished at 10. Totally novel constructions have been introduced every few years since the beginning, seriously growing the language each time. Having to perennially explain Monads to people is a small price to pay!

Learn You a Haskell for Great Good! seems to be going pretty well so far, but the major test will be how he tries to explain Monads — there are a great many disagreements and misconceptions about metaphors.


Galvatron: Lazy evaluation makes it very difficult to reason about the complexity and memory requirements of certain algorithms

I don't find that to be true at all — it's very much a matter of mindset. Non-strict semantics are the foundation of everything special about Haskell that distinguishes it from ML (except for the lack of ML's insane module system).
posted by blasdelf at 5:53 PM on October 18, 2008


Pronoiac: A couple years ago I wrote a programming language runtime parser-generator² in a templating language on top of Haskell. Not many languages are suited to this sort of thing!
posted by blasdelf at 6:02 PM on October 18, 2008 [1 favorite]


Learning Haskell is like starring opposite Cary Grant in a romantic comedy. I hate you, I hate you, I hate you... damn it, why do I love you?!
posted by No-sword at 6:21 PM on October 18, 2008 [4 favorites]


What kind of an idiotic, sadistic professor teaches Lisp, Scheme or Haskell to a first year undergrad in an intro course?

Oh, a Computer Science professor.
posted by DU at 6:22 PM on October 18, 2008


DU: As someone who's spent a lot of time both teaching and debating CS curricula in academia, the benefits are many:
  • Focus on computation, not ceremony (at least for a semester or two).
  • Charm and fascinate the target audience of future Computer Scientists
  • Shake out the help-desk contingent that are really out of their element.
  • Instantly piss off the vocationalists and 'gamer scum' that would hate you anyway eventually.
  • Handicap the whippersnappers who think they know what they're doing and would otherwise disrupt teaching. A level playing field in an environment that does not have vocational outlets can really do wonders for teaching. Paul Graham's prominent evangelism has eroded Lisp's usefulness for this a bit, especially as his religious weenies take obnoxiousness to a whole new level.
posted by blasdelf at 7:08 PM on October 18, 2008 [5 favorites]


Haskell simply isn't very hard (says them mathematician).

If some Haskell course made you quit programming, then said course was well designed for weeding out the unsuitable candidates. I'll recommend it next time I'm chatting with some CS professor. I mean, calc 1-4 simply can't catch all the future failures.

I don't see why "avoiding success" is desirable for Haskell. I'd enjoy a Haskell practical derivative.
posted by jeffburdges at 7:22 PM on October 18, 2008


I honestly can't feel why people find Haskell so difficult, but I use map frequently in perl. Well, my point above was that functional languages feel more natural for casual interaction. An educated clever person thinks "I want map { function} list" quickly, but still must preform unnatural intellectual work for designing loops.

Ideally we want all application front ends written in Haskell, calling C backends, but exposing their inner working to the user, allowing the user to enter arbitrary front end commands. I want an Applescript level Haskell shell interface for all applications. Ever seen the older Autocad's hybrid of scripting and menus?
posted by jeffburdges at 7:36 PM on October 18, 2008


The C-derived languages are my bread and butter, but I often long for things I know from my occasional dabbling in Haskell. The Hindley-Milner type system, the referential transparency. sigh

That Haskell supports interesting research like Peyton-Jones' composable transactional memory stuff also recommends it.
posted by hattifattener at 7:44 PM on October 18, 2008


jeffburdges: Right, because it's not about teaching the students, but weeding out the ones who aren't able to go it alone for lack of decent instruction.

I functional programming languages like Haskell are really neat and a fun way to think about computation. Fundamentally they are sort of based on a strange conceit though...

Computers actually do things to get their results. Potentials vary as currents flow in time and answers are sifted out of a lot of clockwork. Sets and functions that map between them are abstractions that have no physical analog I'm aware of, and certainly can't be compared to computers. Fundamentally, the practical business of computing is about machine states and the progression thereof. Imperative languages reflect the mechanisms by which their interpreted. Assembly language has essentially no pretense - each command corresponds to an action to occur in the processor. If I order a bit to be flipped for a variable, a charged region will actually change polarity.

So yes, it's fun for us to think in terms of lamba calculus, but in the end haskell programs are being evaluated by the occurance of actions affecting states. Haskell's model is based in a sort of computational platonism - the desire to make real and deal with the abstractions of statements/sets/maps. It's quite the realization of the idea that "computer science isn't about computers". It's interesting to think about what a functional computer would look like, as oppose to the computers we use today, which are imperative.

Functional programming as I understand it has no sense of time or sequence (until you involve monads, which force your beautiful logical structures back in to the land of actions and states). In a sense, functional programming is programming at all - you just set up your mappings of infinite sets, and ask for a slice of the infinite amount of computation implied by those mappings, at which point it reduces things back to plain old imperative programming.

It doesn't surprise me that Haskell doesn't perform very well.

I'm probably a bit warped in perspective because I'm an EE student who would probably be better at CS.
posted by phrontist at 8:11 PM on October 18, 2008 [1 favorite]


phrontist: It doesn't surprise me that Haskell doesn't perform very well.

Well it's silly, but the Benchmark Game says otherwise.

In a sense, functional programming is programming at all - you just set up your mappings of infinite sets, and ask for a slice of the infinite amount of computation implied by those mappings, at which point it reduces things back to plain old imperative programming.

That reminds me of Excel.
posted by Monday, stony Monday at 8:28 PM on October 18, 2008


jeffburdges: Success is felt to be best avoided because it makes things go to shit, it's a coffin for a language that is very much alive. The trappings of 'success' have historically been:
  • Commercial users/implementors who bring with them not just a hyper-conservative outlook, but hordes of incurious idiot 'developers'
  • Feature-freezes and ossification: Look at Alan Kay's histories of Smalltalk, where he had to keep starting over every time he got any popularity. Guy Steele's "Growing a Language" keynote/paper is the finest treatise ever written on this subject.
  • Fanboys. I am hopeful that Haskell can abide its newfound 'fans' (who've usually never used it and have facile understandings of it) much better than Lisp has.
The best way I see for a "practical derivative" is to add ML and Haskell features to mainstream languages, something that's been happening in various forms for a while.
  • Python took whitespace for scoping, adopted List Comprehensions along with several practical forms of laziness (like generators).
  • Ruby took paren-less function application syntax, though it's fucked up without currying or partial-application, and having 5 kinds of function objects is seriously ass.
  • Microsoft has funded much of the research in the field, and employs many of the principals. C# has taken some typeclass stuff, Monads and comprehensions (in the form of LINQ), some type-inference, and some lambda-calculus. F# is ML in wolf's clothing!
  • Java's generics implementation came from a series of papers by Phillip Wadler (a Haskell O.G.), though generics were easily the least interesting feature of Pizza.
  • Scala is bringing full-on type-inference and some general decency to the Java masses
It's better to beautify the shit instead of shitting on the beautiful.
posted by blasdelf at 8:43 PM on October 18, 2008 [5 favorites]


functional programming languages like Haskell are really neat and a fun way to think about computation.
Which is precisely why they have a place in a CS curriculum; you want students who can (or can be given the inspiration to) reason about computation, students who are interested in more than just cranking out code. Languages like Haskell allow you to reason about your code; what's more, they allow you to write programs which reason about your code (and one of the most important habits for a practicing programmer is the urge to make the computer do the work you were doing yesterday). Learning languages based on different abstractions also gives you a richer set of cognitive tools with which to approach your problems, even if you're only writing c++ or php all day.

It would be silly to have a CS curriculum which didn't include any of the Algol-descended languages that dominate industry (C, Java, etc). But it would be equally silly not to teach a pure-functional language, a declarative language, assembly language, etc.

You mention that computers don't behave in a functional way— the thing is, they don't contain "variables" or "functions" or "loops" or "objects" either (exotic architectures aside); those are all abstractions provided to you by the language/compiler/interpreter. Once you accept the idea of writing in an HLL at all and not explicitly commanding every register transfer and ALU operation, you're already halfway to things like Haskell or Prolog. And on many machines, even machine language is an abstraction provided to you by the real cpu executing the microcode, which is doing register renaming and speculative execution and all sorts of little tricks that, to me, smell awfully similar to functional programming…
posted by hattifattener at 8:51 PM on October 18, 2008 [3 favorites]


Well, the thing about Haskell and lazy, non-strick programming languages in general is that they're well suited for parallel and even distributed programming. It may take a preponderance of multi-core boxes for one of them to see a more mainstream presence. In my experience, Haskell and friends often seem more difficult, but that's because they make it easier to talk about more difficult things. And I think the lack of parenthesis is worth the trade-off.
posted by cytherea at 8:56 PM on October 18, 2008


That reminds me of Excel.

A spreadsheet is a constraint-based programming environment. It's declarative, like Haskell, Prolog etc

I love learning new programming languages. Some languages are easier to learn than others, but Haskell was the first language I've learned since I first started programming that put me back into my seventh-grade self, staring at the screen completely unable to imagine a way to make the computer do what I wanted. If you're an imperative programmer like I was, it will violate assumptions that you don't realize you hold.

My understanding of the relationship between data structures and control flow is one lesson that no other language has taught me as palpably. Haskell has at once almost no control flow constructs, yet control flow is one of its strongest features. Afterward I realized that the standard imperative control structures, e.g. for and while loops, are almost never the abstractions that you want, we've just gotten used to writing what we really want in terms of them, at the expense of readability and code reuse.

Haskell's also a great language to build a compiler, translator, or interpreter in. Write Yourself a Scheme in 48 Hours is a great read if that interests you, though you might want to follow along with another Haskell tutorial as you go, 'cause it doesn't teach much about Haskell itself.
posted by Rictic at 9:20 PM on October 18, 2008


phrontist: There are purely functional computers


Right, because it's not about teaching the students, but weeding out the ones who aren't able to go it alone for lack of decent instruction.

You unintentionally hit the nail on the head — the students being 'weeded out' want instruction instead of teaching, training instead of learning. Academia is the wrong place for them.


Functional programming as I understand it has no sense of time or sequence

You are confused, what you're thinking of is only true of non-strict call-by-need languages ("lazy" ones), and even then it's not really true. Monads don't forcibly sequence anything, they are used for "interacting with the world" in two orthogonal ways (sometimes simultaneously):
  1. To bind the free environment typefully for functions, both for argument and return value. In impure systems there are all sorts of implicit interactions with the environment that affect results — Monads are just algebraic data structures, in this case used to capture these things explicitly.
  2. A consequence of the the way the arguments to monad constructors are evaluated is that lift/bind/return functions can be written so that one argument will need to be evaluated first — you can use this to sequence, and thus to be sure that the missiles are launched in the correct order.
It doesn't surprise me that Haskell doesn't perform very well.

If you had any real experience using Haskell you would know this to be categorically false. There are all sorts of compiler optimizations that depend on features like: non-strictness, call-by-need, purity of essence, no aliasing problem, fully static typing, etc.
posted by blasdelf at 9:23 PM on October 18, 2008


Monads don't forcibly sequence anything, they are used for "interacting with the world" in two orthogonal ways (sometimes simultaneously)

A bit of a nitpick, as I imagine you put it this way for simplicity's sake, but this kind of thing gave me trouble when I was learning Haskell. I think you're only talking about the IO Monad, it's the only special one, the one that needs to be provided by the Haskell implementation. The others: List, State, Maybe, the various parsers, etc can and are written in ordinary pure Haskell. Monad is just a type class, like any other.

Monads aren't just for IO and side effects, they're also a fantastic tool for building control structures by the way. If you think they're only good for bringing imperative programming into functional land, take another look, you're in for a treat.
posted by Rictic at 9:57 PM on October 18, 2008


There is a clear reason why these languages have remained in academia as research projects and been consistently rejected by commercial developers. It's because they are a pain in the ass and frankly I would rather tell the computer what to do than "what stuff is" when I want to get something done.

I use XSL transformations in my work. XSL is essentially a functional programming language. It makes possible creation of tools that I can guarantee to work to spec. It's is one helluva lot more powerful than what I'd accomplish using other languages. It's a bit of a bugger to grok, but by god does it make the impossible possible.
posted by five fresh fish at 10:49 PM on October 18, 2008 [3 favorites]


phrontist: Haskell's model is based in a sort of computational platonism - the desire to make real and deal with the abstractions of statements/sets/maps.

It's my understanding that computational platonism is the focus of one whole branch of computer science. Some computer scientists don't even build programs as part of their research. They use dozens of notebooks trying to understand, using the language of mathematics, the limits and possibilities of the barebones computational systems which underlie all the complex systems that we use to build interfaces at a high level.

Which is something that us script monkies take for granted.
posted by KirkJobSluder at 12:12 AM on October 19, 2008


Am I the only Mefite who's had more than a dalliance with it?:

I've written, um, a few thousand lines in my time. But then I do work in Oxford, so it's probably mandatory.
posted by pharm at 2:00 AM on October 19, 2008


Ritic: Perhaps I misphrased that a bit, it should have been: when they are used for "interacting with the world"

I know perfectly well how wonderful and widespread Monads are, what I was trying to emphasize is that their usefulness for sequencing/IO is a consequence, not a property of Monads. These consequences do touch a great many uses of monads unrelated to IO: every time you use (=<<) or (>>=) you're still causing sequencing to occur in the bind.

It is awfully difficult to discuss Monads without introducing misconceptions and mixing metaphors, especially for a lay audience. Witness the panopoly of poorly conceived tutorials on the subject! I think a large part of the problem is the wooly name, the fact that they were named before being introduced into Haskell, and the fact that the Haskell project started before they were discovered. I think they would not be so difficult if they were more anonymous, more a part of the environment.


pharm: Bravo, I am not alone in this world! There are not many languages where a few thousand lines would even be spoken of.

People would tend to recoil when I told them I spent hundreds of hours over three months writing 265 lines of GH (>10kb) for a novel language implementation. When templated out for a simple algebraic datatype representing Boolean Expressions, it ballooned into 3175 lines (170kb) of vanilla Haskell! It's awful hard to impress upon people how big a Haskell program that is…

To paraphrase Obama, In no other language is my story even possible — while writing that project in Java/C#/C++ etc. wouldn't have taken a full order of magnitude longer timewise, it certainly would have taken many orders of magnitude more code, and would have produced a much less generative result. It's all about spending more time thinking than typing!
posted by blasdelf at 4:20 AM on October 19, 2008


spiderwire: Learn Lisp. You don't learn languages just because they're different. If that's your criteria, just go for Piet or another esoteric language like Brainfuck. Lisp is useful.

I meant "based on a different paradigm", not just "different". Sorry. English is my second language.

There are enough testimonials to the brain-expanding experience of learning Haskell/Lisp/whatever here already that I can feel my motivation rising. One of the great things about the Internet is that finding compilers, tools and even communities is a snap. I still have shivers when I think about my 15-year-old self trying to teach himself Fortran from a manual that came with his Commodore 64 (on a cartridge). Put me off Fortran for life...
posted by Harald74 at 7:00 AM on October 19, 2008


You unintentionally hit the nail on the head — the students being 'weeded out' want instruction instead of teaching, training instead of learning. Academia is the wrong place for them.

It is exactly this sort of pretentious bullshit that should be weeded out of computer science. It is not to our discipline's best interest to treat everyone that does not immediately get it ("it" being whatever your particular pet area of CS might be) as unworthy of association with the field. Your clear disdain for students that do not meet your particular standards of CS interest is really appalling.
posted by ch1x0r at 9:49 AM on October 19, 2008 [3 favorites]


blasdelf: Of course, I have a sneaking suspicion that I could have crushed at least one of those programs by a factor of four or so with suitable application of Template Haskell, Generics, Data.Derive or some other magic Haskell code generation scheme.

harald74: Having to deal with godawful Fortran 77 compilers that couldn't even manage half-decent syntax errors is what put me off Fortran for life.

ch1x0r: That depends on whether you think the purpose of CS degrees is a source of well programmed programnmers for industry to plug into their existing processes, or a source of prospective PhD students. Most academics seem to go for the latter every time! I suspect this is true of most academic subjects personally: any economically useful training is an unintentional side effect.
posted by pharm at 10:22 AM on October 19, 2008


That depends on whether you think the purpose of CS degrees is a source of well programmed programnmers for industry to plug into their existing processes, or a source of prospective PhD students. Most academics seem to go for the latter every time! I suspect this is true of most academic subjects personally: any economically useful training is an unintentional side effect.

It absolutely does not depend on that. I do not believe the purpose of a CS degree needs to be "programmers for industry to plug into their existing process." I think there is not only room, but a clear NEED for CS majors of all stripes; those that want to be PL geeks, those that love writing operating systems, those that want to go on to be damn good software engineers. I am absolutely a fan of exposing all CS students to functional programming as part of their curriculum, but expecting that every single CS undergrad is going to really truly "get" functional programming or else they aren't worth having as a student seems short-sighted and naive. By the by, you do not even really need to "get" functional programming to be a good CS PhD candidate. There are people making important advances in the more applied areas of CS that do not have much if any pure theory (of the PL or algorithmic type) in their background. Those people don't meet your particular standards for "good" computer scientists? Good thing you cannot impose your standards on the world, because we would all be much poorer off for it.
posted by ch1x0r at 11:01 AM on October 19, 2008


My first programming classes in college were in C++, which was nice because I already knew it. I did learn Scheme in a class on programming language theory. I've always thought it would be fun to learn Haskell, but there is actually a lot of flux right now in the programming language area.

Scala, Clojure and Groovy are all JVM based programming languages that are pretty advanced and have a lot functional features. I havn't worked with any of them (but I have read an intro to Scala). One of them could become pretty popular later on. I'm sort of conservative in terms of what new technologies I use, since you never know if something could be buggy or unsupported later on if it goes out of use, which is annoying.

Learning new programming languages was fun when I was younger, but right now I can express any idea I have in Java, and I don't have too much trouble programming in languages I've never looked at before (at least in C-like languages like C#, Javascript, actionscript, etc. I suppose Haskell might be more of a challange)

Right now I'm more interested in learning how to have better ideas, specifically by learning more math. I've been studying linear algebra using MIT's open course wear, which I never took in college. I want to tackle statistics and differential equations next.

I also have the small project problem. Any project small enough be good for a new programming languages is small enough to code in java in a couple hours.

It is exactly this sort of pretentious bullshit that should be weeded out of computer science. It is not to our discipline's best interest to treat everyone that does not immediately get it ("it" being whatever your particular pet area of CS might be) as unworthy of association with the field.

I disagree. Try spending some time maintaining code written by these idiots and you'll be reaching for your weed-wacker in no time.
posted by delmoi at 11:06 AM on October 19, 2008 [1 favorite]


I disagree. Try spending some time maintaining code written by these idiots and you'll be reaching for your weed-wacker in no time.

I've spent plenty of time maintaining code written by both code drones and academic gasbags. Neither is particularly pleasant, and they could both stand to learn something from each other. But I still don't think that culling more people out of the field is the solution to the problem of bad coders. Spending some effort learning how to teach people effectively and inspire smart people that might otherwise be turned off by this pretentious attitude problem would be a better use of our time. I am shocked again and again by the short-sightedness of people that seem to think that discouraging interest in computer science is somehow good for the field. It is not going to preserve its purity, it is going to stifle innovation. Want jobs to go overseas? Great, let's make CS in the united states an elitist area that only a few interested in the very abstract concepts can tolerate long enough to graduate with a degree. If somehow this does not manage to chase the remaining sparks of industry out of the US, it will ensure that there are even MORE crappy programmers of the self-taught or applied degree sort. Not that you can't self-teach to be a great programmer, but I would like to think that CS programs at major universities can produce graduates that have a thoughtful grasp of the fundamentals without raking them over the coals.
posted by ch1x0r at 11:30 AM on October 19, 2008 [1 favorite]


c1hx0r: Your cries of jobs going overseas does not inspire any confidence in you.

Besides, have you actually explored standard CS undergraduate curricula in the US? The 'elitism' you decry is exceedingly rare, and hard to find or maintain. Even MIT has given up Scheme, though Berkley is keeping up the fight for now. A student in a well-regarded program would be lucky now to get most of the ACM material, exclusively in Java. You're reacting to activism for change, not reality.

There is plenty of agitation for CE and IT degree programs, which seems to be what you want. They would potentially lift much of the outside pressure on CS curricula — but I fret that they provide a way for incurious careerists to avoid the rigor of liberal academia to cuddle up with conservative industry, while still getting the trappings of academia on the diploma.


you do not even really need to "get" functional programming to be a good CS PhD candidate

You don't have to be able to write a practical program, but if you can't understand even untyped Lambda Calculus, you don't have a grounding in the very basics of Computability, and have no business being a CS PhD candidate.


people that seem to think that discouraging interest in computer science is somehow good for the field.

They (and I) think it'd be good for the field if students with no interest in Computer Science were not pressured into CS programs. Did you drop out because of the big bad abstract concepts and oppressive professors? What's the source of all your pent-up animosity?
posted by blasdelf at 2:38 PM on October 19, 2008 [1 favorite]


God I wish more people with CS degrees actually had the kind of foundation I would expect that to bring.

The number of people I interview that haven't a faintest clue what big O notation is (very important when you work on high traffic systems) or can't even tell me the difference between a critical section and a semaphore is incredibly disheartening. It's not like I'm asking about lambda calculus (which I would need a refresher on myself) or to prove the correctness of an algorithm.

ch1xor, I think you're railing against a non-existent standard. Only a small handful of places even begin to approach the "elitism". Please, let me get more people from Berkeley and MIT and Harvey Mudd and RPI. The Real World field could use some more people with strong academic backgrounds.

(Not that having attended one of those guarantees you're not a jackass. I went to HMC and graduated alongside people I would never in a million years hire. But they're still less painfully unqualified as most of the incredibly uncurious undriven program-by-numbers wankers out there)
posted by flaterik at 3:59 PM on October 19, 2008


Did you drop out because of the big bad abstract concepts and oppressive professors? What's the source of all your pent-up animosity?

Heh. I graduated from one of the best CS undergraduate programs in the country, have an MS from another and several years of experience at some of the biggest players in the industry. So my animosity has nothing to do with my fear of big bad abstract concepts or oppressive professors, but rather with intimate experience with insufferable pricks like you that are so narrow-minded in their vision of the field that they are unable to see the harm they do in their pathetic attempts to protect it from what they view as corruption. You quite clearly have absolutely no perspective on this issue and little experience with much of academia outside your sphere, given your comments about what CS PhD candidates should and should not know.

News flash kid, it's a big field and not everyone agrees with your priorities. I am actually not at all in disagreement with the idea that undergrads should be exposed to functional programming as part of a complete curriculum. But the tone you take in describing those that come to the field because they think it would be a good way to get a job is so nasty I feel incredibly sorry for any student that has the misfortune of crossing your path. There is nothing wrong with coming in interested in learning the practical application of the field, and if you truly believe that learning functional programming has real importance you should make an effort to impart that to your students instead of looking down on them for coming from a different perspective. Instead of concentrating on getting rid of the kind of students you don't like, why not concentrate on expanding their understanding? It's all in the framing.

ch1xor, I think you're railing against a non-existent standard. Only a small handful of places even begin to approach the "elitism". Please, let me get more people from Berkeley and MIT and Harvey Mudd and RPI. The Real World field could use some more people with strong academic backgrounds.

I'm sorry, where did I say I didn't want people with strong academic backgrounds? I would like to see elite educations without the elitist attitude, that is all.
posted by ch1x0r at 5:00 PM on October 19, 2008 [2 favorites]


I'm sorry, where did I say I didn't want people with strong academic backgrounds? I would like to see elite educations without the elitist attitude, that is all.

I guess there's a fine line there. At what point does wanting people to have learned a wide variety of programming techniques and languages go from "wanting a strong academic background" to "elitism"? I recognize that there is a need for variety in the field, but... I'm certainly not happy with which direction the distribution tilts.

So I guess I'm not sure that the elitism - that definitely is out there - is actually doing the harm you suppose. There are different institutions for different kinds of students, and I think there are FAR more programs out there that tilt towards the not-rigorous than those that are "elitist".
posted by flaterik at 5:23 PM on October 19, 2008


Chixor, I was rereading your posts because I don't think we really disagree and I'm trying to figure out where the schism in this discussion is. I think maybe it's here:

"I am absolutely a fan of exposing all CS students to functional programming as part of their curriculum, but expecting that every single CS undergrad is going to really truly "get" functional programming or else they aren't worth having as a student seems short-sighted and naive?"

I don't think that in order to complete a single semester of functional programming you need to really truly "get" it. But you should be able to figure it out enough to pass it if you're going to get a degree in computer science.

Of course others in this thread might not have the same attitude as me.
posted by flaterik at 5:30 PM on October 19, 2008


I took a class in 1989 about the implementation of functional programming languages, which used a textbook written by Peyton Jones on the language Miranda. It was an antecedent to Haskell and currying was the first mind-bender in the language. OK, you get used to that the same way one gets used to RPN - it's a notational convenience.

Then we covered how ultimately a functional program could be represented as a graph of nodes, and the act of running the programming is tantamount to reducing the graph to single node, and further there was a straightforward algorithm that could do this reduction in parallel with a minimum of monitor conflicts. That was pretty mind blowing in that if there were an end to Moore's Law, parallelism would ultimately win out.

Some students went a little further and wrote code that could compile Scheme into Miranda and then the underlying virtual machine to run the Miranda program - inherently parallel scheme was a possibility (there were some rules for what you could and could not do - set! and set-cdr! were verbotten IIRC).

To our surprise, Mr. Peyton Jones ended up being the honors examiner that year and did a fascinating talk about parallelism and when he heard about our work immediately dismissed it as being based on the old miranda stuff. Apparently Haskell had ushered it out.

Now, I haven't really written any Haskell, but I could follow the long video that Peyton Jones did about it well enough and found that they could write an X Window manager in a relatively few number of lines very cool - except comparing it to the C versions was a bit of a canard because the Haskell window manager looked like pure, unadulterated garbage and provided a fairly hellish UI and user experience - and that's where most of the code in any decent window manager goes. I found that disappointing as a selling point. Oh well, can't have everything.
posted by plinth at 8:03 PM on October 19, 2008


Hey, I use XMonad, and all tiling window managers look like that.

XMonad is tiny, has many unique features, has better UI, and is much more extensible than any other tiling window manager. I found it right as I was about to write my own window manager to get a particular feature¹, and it saved me that great shame.

1 It treats virtual desktops as a list of layouts, so if you have multiple monitors they independently page through that shared list. I find multimonitor virtual desktops absolutely useless without it, and only XMonad can do this.
posted by blasdelf at 4:26 PM on October 20, 2008


And it just happens to be written in Haskell.
posted by grouse at 7:53 AM on November 2, 2008 [1 favorite]


« Older Enron: The Smartest Guys in the Room   |   Indian royalty Newer »


This thread has been archived and is closed to new comments