Simon Thompson is an amazing teacher

Submitted by metaperl on Mon, 04/04/2005 - 9:36am.

After tripping and stumbling through "Gentle" and "YAHT", I am worlds grateful for "Craft of Functional Programming" He is not just teaching Haskell, he is teaching you how to think about problem solving.

The reason I am so excited is he gave the following exercise:

Give a function orderTriple which puts the elements of a triple of three integers into ascending order.

Ok, so far, just an ordinary question. And in most other cases that's all you would get. In YAHT, you would have copious exercises like what you just saw. In Gentle, he would show you the solution and keeping moving. It is the next sentence in this exercise that sets Thompson apart from the crowd:

You might like to use the maxThree, middle, and minThree functions defined earlier.

Kapow! After reading the first part of the exercise, my mind immediately began to scramble over how to maintain state and iterate through the elements, deleting them as I found their place.

But then Thompson *decomposed* the problem into 3 simpler problems for me!

Trackback Spam

Submitted by jgoerzen on Wed, 03/30/2005 - 6:42am.

After spending some time deleting this morning's spam, I'd like to suggest that trackbacks be disabled on this site for now. I haven't seen any people using them legitimately, and Drupal's spam module -- while excellent in fighting comment spam -- doesn't do anything about trackback spam yet. Comments?

In the meantime, if you see spam that's been on the site for 24 hours or more, please e-mail me.

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.

Fun with sections

Submitted by boggle on Mon, 03/21/2005 - 6:14pm.

Still being quite a haskell newbie, I just got a lesson about sections and argument order. I wrote something like the following code in a small program for calculation the maximume queueing time of packets on a CAN bus system. Try out for a mild smile:

some_list = [0..5]

pifilter p i = filter (p (some_list !! i))

main = do
{ putStrLn $ show $ pifilter (<) i some_list;
putStrLn $ show $ filter (< si) some_list
} where i = 2; si = some_list !! i

While at first glance the two lines look like they should do the same, they include two inverse filter predicates (si <) and (< si).

BTW why does indentation get messed up inside <code></code> blocks?

Programming Guidelines

Submitted by metaperl on Mon, 03/21/2005 - 2:42pm.

[14:38] [ibid] metaperl: there is a guideline - often forgotten in popular programming - that a subroutine be either a mutator or an inspector but not both
[14:38] [ibid] metaperl: if pop returned the element, it'd be both

Your stage of Haskell Evolution?

Submitted by shapr on Mon, 03/21/2005 - 9:08am.
49% (150 votes)
5% (15 votes)
10% (31 votes)
3% (10 votes)
1% (4 votes)
6% (20 votes)
0% (0 votes)
4% (12 votes)
1% (3 votes)
Boy Scout
3% (10 votes)
3% (8 votes)
0% (1 vote)
1% (3 votes)
1% (2 votes)
Beginning graduate
2% (6 votes)
3% (8 votes)
0% (1 vote)
3% (10 votes)
1% (3 votes)
Tenured professor
4% (11 votes)
Total votes: 308

Haskell puts the complexity of programming in the right place

Submitted by metaperl on Sun, 03/13/2005 - 8:39am.

Every useful programming language has an area of complexity that you must overcome to become comfortable with the language. For Perl, you need to relax your ideas about regularity and consistency and learn to read and write Perl instinctively and trust that all of the exceptions and special cases will make as much sense in Perl as in English.

Haskell is very much a "back-end" language. What I mean is that the language just sits back and waits until you have everything lined up in a clean chain of well-typed functions. It won't do anything but keep spitting back your code at your until you have your problem reduced to something expressible in expressions.

This means you spend a lot of time with the type checker. And possibly a lot of time with making sure that your IO can make it through the snake's tube of a Monad before getting into yor program.

So, Haskell can be a big turn-off to someone who needs a language which, by Haskell standards, oversteps it bounds. If you want to mix IO and your program, If you want to quickly setup a webshop and need easy CGI processing, or any of a number of things that are highly available in languages like Perl, Python, Ruby, Tcl, PHP, then Haskell seems like a huge stumbling block.

But the way that Haskell quarantines I/O. The hurdles that it puts you through are there for some very very good reasons. The more experienced you become with it's advanced features such as Monads and combinators, the more you see how to crisply and accurately separate wheat from chaff, cause from effect, and smoke from fire.

Bored? Want that Haskell fix? check out http://del.icio.us/tag/haskell

Submitted by shapr on Wed, 03/02/2005 - 7:40am.

Advice from an input addict, check out http://del.icio.us/tag/haskell to get that Haskell fix.
Or see this addict's infrequently updated del.icio.us feed.

New Site Name (and URL fragment)

Submitted by jgoerzen on Tue, 03/01/2005 - 7:00am.
The Haskell Sequence (sequence)
53% (10 votes)
The Haskell Thunk (thunk)
0% (0 votes)
The Haskell Continuation (continuation)
5% (1 vote)
The Haskell Sequents (sequents)
0% (0 votes)
The Haskell SideEffect (sideeffect)
11% (2 votes)
\Haskell (backslash)
5% (1 vote)
\Haskell (lambda)
11% (2 votes)
\. (backslashdot)
16% (3 votes)
Total votes: 19

Haskell interesting to Perl6 developers

Submitted by jgoerzen on Thu, 02/24/2005 - 6:57am.

Autrijus Tang seems to have caused some interest in the Perl community due to his rapid development of a working Perl6 compiler/interpreter written in Haskell. Quite a few Perl6 hackers have been hanging out in #haskell of late.

Pugs, at present, works by compiling the input to an AST and then interpreting (evaluating) that AST. Autrijus expects this to be expanded to a true compiler down the road, with possible outputs being Perl 6, Haskell code (which could lead to a Perl-to-C compiler), and Parrot.