Fold Must Fold!

The Fate Of LAMBDA in PLT Scheme v300
Lambda the Ultimate Design Flaw

About 30 years ago, Scheme had FILTER and MAP courtesy of Lisp hackers who missed them from their past experience. To this collection, Scheme added a lexically-scoped, properly-functioning LAMBDA. But, despite of the PR value of anything with Guy Steele's name associated with it, we think these features should be cut from PLT Scheme v300.

We think dropping FILTER and MAP is pretty uncontroversial; (filter P S) is almost always written clearer as a DO loop (plus the LAMBDA is slower than the loop). Even more so for (map F S). In all cases, writing the equivalent imperative program is clearly beneficial.

Why drop LAMBDA? Most Scheme users are unfamiliar with Alonzo Church (indeed, they don't even know that he was related to Guy Steele), so the name is confusing; also, there is a widespread misunderstanding that LAMBDA can do things that a nested function can't -- we still recall Dan Friedman's Aha! after we showed him that there was no difference! (However, he appears to have since lapsed in his ways.) Even with a better name, we think having the two choices side-by-side just requires programmers to think about their program; not having the choice streamlines the thought process, and Scheme is designed from the ground up to, as much as possible, keep programmers from thinking at all.

So now FOLD. This is actually the one we've always hated most, because, apart from a few examples involving + or *, almost every time we see a FOLD call with a non-trivial function argument, we have to grab pen and paper and imagine the *result* of a function flowing back in as the *argument* to a function. Plus, there are *more* arguments coming in on the side! This is all absurdly complicated. Because almost all the examples of FOLD we found in practice could be written as a simple loop with an accumulator, this style should be preferred, perhaps with us providing a simple helper function to abstract away the boilerplate code. At any rate, FOLD must fold.

--The PLT Scheme Team

This from the PLT Scheme mailing list. Clearly Guido's visionary thinking is having repercussions outside the world of Python. I, for one, welcome this change that can only benefit the Scheme language.

Reproducing Programs implement Lazy Lists

Along the lines of the quine discussion happening in another thread, Manfred von Thun wrote a new page for the Joy site, Reproducing Programs implement Lazy Lists. This connects nicely with Jeremy Gibbons spigot algorithms paper, one example of which is his IOHCC 2004 submission PiSpigot.

Defining new infix operators in Python

This is an absolutely blinding hack. See if you can guess how it's done before looking at the recipe...

The Little JavaScripter

In 1974, Daniel P. Friedman published a little book called The Little LISPer. It was only 68 pages, but it did a remarkable thing...

JavaScript has much in common with Scheme. It is a dynamic language. It has a flexible datatype (arrays) that can easily simulate s-expressions. And most importantly, functions are lambdas.

Because of this deep similarity, all of the functions in The Little Schemer can be written in JavaScript.

Show your Javascripting friends the light...

Amazon Web Services in Scheme

Phil Windley is having fun with Scheme and XML (SSAX). His latest set of examples show how to use Amazon Web Services from DrScheme, and how to write DrScheme servlets.

Continuations must be next, right? :-)

Killer Props for Computer Scientist!

Who is the most thanked person in Computer Science? No, it's not Ehud Lamm, or Superman! It's...Olivier Danvy, famous PL researcher. PL research does pay (in...umm...intangible rewards).

Read the full story on Nature

Choosing a Language for Interactive Fiction

Link: Can't recall that we've ever discussed programming languages that are dedicated to authoring text adventures (much less MUDs). These languages are geared towards constructing worlds that have a built-in english language like parser. Kind of Lisp meets Prolog aspects, where the emphasis is on a declarative type of programming.

What is Universal about the Representation of Color Experience?

A study in the importance of language. We've had posts before that discuss whether and how language shapes experience, but I don't think this paper has appeared.

Only vaguely related to programming, I know, but there is a tradition here for this kind of thing (I hope!). From painquale on mefi.

Cool Python "spreadsheet"

Use eval() to drive spreadsheet style logic. The sleeper feature of Py2.4 is the ability to use any object with a mapping interface as the locals argument to eval().

Cute Python language hack.

Languages that allow you to hook into their variable lookup logic open the door to many cool hacks.

Lazy K

Lazy K is a garbage-collected, referentially transparent functional programming language, with a simple stream-based I/O system. What distinguishes Lazy K from other such languages is its almost total lack of other features.

It's SKI combinators all the way down...

Thanks, Pont!

XML feed