Knights of the Lambda Calculus

The Knights of the Lambda Calculus is a semi-fictional organization of expert LISP and Scheme hackers. The name refers to the lambda calculus, a mathematical formalism invented by Alonzo Church, with which LISP is intimately connected, and references the Knights Templar.
There is no actual organization that goes by the name Knights of the Lambda Calculus; it mostly only exists as a hacker culture in-joke. The concept most likely originated at MIT. For example, in the Structure and Interpretation of Computer Programs video lectures, one of the lecturers presents the audience with the button, saying they are now members of this special group. However, a “well-known LISPer” has been known to give out buttons with Knights insignia on them, and some people have claimed to have membership in the Knights.

Here is a local copy.
(via Wikipedia)

Art and Code and Visualizing Data

I went to two of Ben Fry’s talks at Art and Code, and bought his book Visualizing Data (O’Reilly) and downloaded his dissertation, so I can guess how his presentation went. To get the real flavor of what happens in those first ten minutes, though, besides waiting for the NEU ACM video (great ACM chapter, by the way!), you can also wait for the Art and Code videos, which are not up yet, but will be at some point, here: http://www.vimeo.com/artandcode

(via PLT)

On FP and Graphics Processing

Oddly, graphics processing is very functional, yet procedural languages are used to teach it. In a nutshell, matrices operate on matrices operate … . In between some of the stages, drawing takes place; the rightmost argument is the beginning of the scene. Years ago, I gave up learning OpenGL because it was so tedious. Now that I am enlightened by FP, I understand and enjoy graphics programming so much more that I wrote an API just for the fun of it.

(via PLT)

Why MIT switched from Scheme to Python

Costanza asked Sussman why MIT had switched away from Scheme for their introductory programming course, 6.001. This was a gem. He said that the reason that happened was because engineering in 1980 was not what it was in the mid-90s or in 2000. In 1980, good programmers spent a lot of time thinking, and then produced spare code that they thought should work. Code ran close to the metal, even Scheme — it was understandable all the way down. Like a resistor, where you could read the bands and know the power rating and the tolerance and the resistance and V=IR and that’s all there was to know. 6.001 had been conceived to teach engineers how to take small parts that they understood entirely and use simple techniques to compose them into larger things that do what you want.
But programming now isn’t so much like that, said Sussman. Nowadays you muck around with incomprehensible or nonexistent man pages for software you don’t know who wrote. You have to do basic science on your libraries to see how they work, trying out different inputs and seeing how the code reacts. This is a fundamentally different job, and it needed a different course.
So the good thing about the new 6.001 was that it was robot-centered — you had to program a little robot to move around. And robots are not like resistors, behaving according to ideal functions. Wheels slip, the environment changes, etc — you have to build in robustness to the system, in a different way than the one SICP discusses.
And why Python, then? Well, said Sussman, it probably just had a library already implemented for the robotics interface, that was all.

(via wingolog)

Literate Programming in Scheme

The release notes here for PLT Scheme 4.1.5 mention support for literate programming. Not being familiar with the term; I read more about it on Wikipedia here.
I have wanted in-code documentation generation tools to serve this purpose; but I have never succeeded with them. It had always felt like I was battling the intent of the tool. Even Eiffel’s notion of different views on code-as-documentation never quite fit for me. This approach is fascinating; it allows for you to tell a story about the code as you write the code. Having posted to the PLT list asking about it here; two folks replied with details on this style and Scheme.
PLT Scheme recently added literate programming support; documented here. One example of its application is in Chat Noir here; and the source code for it may be viewed here (Thanks Robby).
A tool for literate programming in Scheme called is schemeweb located here (Thanks Phil).

The contentment of content

A few weeks on a PBS television show hosted by Alan Alda the scientists being interviewed were talking about the “Contentment of Content”. They said the the research shows that most humans learn the bulk of their knowledge (in particular their approach for all sorts of problem solving) younger in life and never learn any new approaches later on because it would just show them how much they don’t know. In other words; it would require the act of learning and that takes work. They go on to explain that in fact, this approach not only happens at the macro level in life but also in the macro level for particular areas of expertise. For sake of discussion, I would focus on programming.
The idea is that once you learn how; you are very, very unlikely to learn “new ways of doing it”, and why would you? It makes you feel bad since it makes you look like you don’t know what you are doing. It is also very, very unpopular to admit that you don’t know everything (I wonder if it has always been this way?). This is unfortunate because most of us really never learned how to program well and in fact seems to be the complete antithesis of the behavior and approaches that are likely to have made you successful as a programmer in the first place.

Random Art

Suppose we take an expression in x and y, built by nesting simple primitives: product, average, sin(pi*_), and cos(pi*_). These four operations map arguments in the range -1 to 1 to results in this same range. Thus, at any point with -1 <= x,y <= 1, our expression built from these primitives will return a value between -1 and 1. By scaling the answer to a grayscale value 0-255, we can plot the function in this 2-by-2 square. (From three such expressions, we can get red, green, and blue values for each point.)

What you get is some very nifty art!
(via PLT)
Addendum: 03/11/09
Noel posted some PLT Scheme code for implementation here:

#lang scheme/gui
(define (make-plotter drawing-fn size)
  (lambda (canvas dc)
    (for* ((x (in-range size))
           (y (in-range size)))
      (let* ([intensity (inexact->exact (round (* (/ (add1
                                                      (drawing-fn x y)) 2) 255)))]
             [colour (make-object color% intensity intensity intensity)])
        ;;(printf "~a ~a ~a\n" intensity x y)
        (send dc set-pen colour 1 'solid)
        (send dc draw-point x y)))))
(define (draw-grayscale size drawing-fn)
  (define frame (new frame%
                     [label "Random Art"]
                     [width size]
                     [height size]))
  (define canvas (new canvas%
                      [parent frame]
                      [paint-callback (make-plotter drawing-fn size)]))
  (send frame show #t))
(define (example1 x y)
  ;; some random stuff
  (sin (* (sin (* (cos x) y))
          (cos (*
                (sin (* (sin y) (cos x)))
                (cos (*  (cos (* y x)))))))))
(define (example2 x y)
  (if (> x 200)
      1
      -1))
;;(draw-grayscale 400 example1)