Message Of The Day

Sat, 27 Mar 2004

00:00 [zork(~)] cat stallman-lisp-experiences.txt

RMS's Lisp Experiences and the Development of GNU Emacs

There's a new transcript of an RMS LISP talk up on Some choice tidbits:

on TECO:

Actually, there were some rather sophisticated facilities; I think that Lisp got its unwind-protect facility from TECO.

on EMACS LISP features:

I implemented Common Lisp once on the Lisp machine, and I'm not all that happy with it. One thing I don't like terribly much is keyword arguments. They don't seem quite Lispy to me; I'll do it sometimes but I minimize the times when I do that.

Thu, 18 Mar 2004

04:15 [zork(~)] cat why-he-likes-plt-scheme.txt

Why Jacob Likes PLT Scheme

He likes the scheme.

Beaujolais for starting with a threaded example, but that while macro is bogus. The comments seem to range between "Y NOT UZ PERL HUK HUK HUK" and "Pardon me good sir, but wouldn't ML be more indubitable and minimize undue perspicacity?"

threaded-map is supafly, though.

Wed, 08 Oct 2003

08:22 [zork(~)] cat sicp_videos.txt

All Hail MIT for releasing to us the videos of the 1980s!


That's all I can keep saying! Dude!

It's a set of 6.001 lectures videotaped by HP so that they could have SICP on file for all future students! It's released under the attribution/share-alike creative commons license!

It was recorded in 1986! Think of that! It was done for version 1 of SICP, and probably used Common LISP instead of Scheme (though that doesn't really matter).

But it's 1986! The students all have perms, bowl cuts, square-frame glasses, and izod shirts! Sussman actually wears a pocket protector with no irony whatsoever!

Gödel, Escher, Bach had been published only a few years prior to this, so that they were still all giddy about Bach and technology and Wendy Carlos and stuff, so the intro music is Jesu, Joy of Man's Desiring played on a synth keyboard. Hell, it's probably a casio!

I was looking at the leather case on Sussman's belt, and realized that there's no way in 1986 that it could be a cellular telephone. that leaves me with a few basic possibilities:

Man oh man I hope it was a slide rule.

But Dude!

I'm busy mirroring all the divx files (about 9G total), and I'm watching them one by one. So far I'm on section three of day two part a, but I have through day four downloaded. It's amazing how smooth everything flows when it's being written up on the blackboard, and the student questions really are the most pressing ones.

It's fun to note that they have a weird 1980s teleprompter screen for the actual slides they do want to put up (usually images and fully-formed page-long programs). But the real strength of the lectures comes from the fact that Abelson and Sussman have a many-paneled chalkboard on which to write their terse chunks of LISP. There's something about the ability to narrate as you write that gets lost in slide-presentation lectures.

At any rate, this is the last piece I needed to make any sort of lisp hacker initiation club complete. I'm still jazzed about its very existence. Dude!

Sat, 04 Oct 2003

23:38 [zork(~)] cat call-with-current-continuation.txt

Call/cc Considered Harmful

I just spent two days studying call-with-current-continuation.

I scratched my head trying to figure out what sort of execution-flow magic was going on, trying to see what made this one of the most powerful features of scheme. I spent hours trying to decipher the scheme jargon and heady compsci technobabble.

Today someone explained that I was reading too much into things, that it's really quite simple. A short tutorial reading later and the light bulb went on:

call/cc is just GOTO

The scheme community is so caught up in their own self-important pontifications and pedagogy that they can't just admit that one of the most powerful features in their belovedly pure language is just GOTO.

I'm still picking my jaw up off the floor.

In 1968, the Communications of the ACM published a text of mine under the title "The goto statement considered harmful", which in later years would be most frequently referenced, regrettably, however, often by authors who had seen no more of it than its title, which became a cornerstone of my fame by becoming a template: we would see all sorts of articles under the title "X considered harmful" for almost any X, including one titled "Dijkstra considered harmful". But what had happened? I had submitted a paper under the title "A case against the goto statement", which, in order to speed up its publication, the editor had changed into a "letter to the Editor", and in the process he had given it a new title of his own invention! The editor was Niklaus Wirth.

—Edsger W. Dijkstra

Fri, 09 May 2003

07:41 [zork(~)] cat paulgraham.txt

Paul Graham

Man, I would definitely include all of Paul Graham's Web site in any hacker reading group.

Mon, 03 Mar 2003

02:02 [zork(~)] cat other_lisp.txt

Lists of Lists

So Siduri pointed me toward Lists and Lists, which is an inform implementation of LISP complete with a tutorial genie who checks your work. I'm not sure that it's proper scheme, and it's definitely not R5RS compliant. Still, it looks cute (once you look past the fact that it's proprietary software written in a language that has a proprietary runtime library).

Sun, 02 Mar 2003

02:33 [zork(~)] cat free_texts.txt

Free Scheme Texts On The Web

So Ed Lang got curious about all these books I listed the other day, but waffled about the cost. Aside from GEB, none of the books I listed are over US$20. Most of them are paperbacks -- slim little volumes.

But if you're genuinely not able to buy any books, but want to learn scheme, here's what there is on the net.

For starters, there's Teach Yourself Scheme in Fixnum Days. It's a very practically minded tutorial, and it doesn't hide the OS-interface features that have side effects. Most texts present lisp as an ethereal function evaluator, and give you no I/O beyond the REPL (Read, Eval, Print Loop) itself.

I haven't worked my way through that tutorial, but I'll probably give it a try sooner or later. It even lists CGI programming examples, which is kind of a trip. It seems to use mzscheme as the implementation for all the code examples.

If you're looking more for the no-math no-computers liberal arts oriented approach that TLS had, you may find How To Design Programs useful. It's actually the textbook to a course that uses DrScheme, which is a nice GUI scheme IDE with graphics libraries and other goodies. The trick to DrScheme is that it initially presents you with restricted feature sets of the language to keep beginners from getting too confused. It's really a classroom tool. It's actually based on mzscheme, if I remember correctly.

If you're a little more hardy, and are looking for an in-depth coverage of CS, there's always The Structure and Interpretation of Computer Programs. It's an amazing book! Although it's designed with portability across scheme implementations in mind, the course designed around it uses MIT Scheme.

Finally, if you're looking for a big Scheme reference, the canonical book is The Scheme Programming Language, 2nd Edition.

While not specifically about Scheme (it uses Common Lisp for most of the examples), the book On LISP has been recommended to me as a good way to learn how to think about macros. No, not like the goofy preprocessors that come with 1970s compiled languages, but a truly dynamic modification of the LISP evaluator! I'll let Paul Graham tell his own tale about the power of LISP macros.

Most of these are available in HTML format, except for On LISP. I have them all mirrored locally so I can read them on my zaurus and maybe print them all out some day. It irritates me that the images most TEX-to-HTML generators spit out are 1-bit. Why not take advantage of ghostscript to anti-alias?

Mon, 24 Feb 2003

05:41 [zork(~)] cat degree_sequence.txt

Graph Theory

I've had this recurring theme in my life where I try to get my brother into some technical topic or other. Typically I'm trying to get him into programming of some sort. I never know how much of it is me being a pestering brute and how much is him actually enjoying and understanding the lesson.

So my latest push was accepted rather warmly. I mentioned that graph algorithms are usually big list manipulations, and the sort of thing that has all sorts of rich algorithm analysis behind it. Lots of good science code out there.

So he sent me this way to determine if a sequence of the degrees of unique vertices is graphical. That is, can we say that in a reasonable universe, all of these vertices are connected in a single structure.

(1 2 2 1) is a valid graph, since it is just four nodes strung together in a line. (7 2 2 1) is invalid, since there's simply not enough nodes for any one of them to have 7 connections.

I'm not sure he followed my explanations, or really spent much time reading my long mails on the subject. I encouraged him to trace the various functions to see how they work. The trace function is simply fantastic for learning how a system is behaving without going into the debugger. It's much like the strace and ltrace tools, but it's easier to be selective.

I'm not a great schemer, so likely this is done in a stupid or redundant way. I do think it's done in a portable way, and is straightforwardly implemented so that a new schemer can understand it.

So here's the code, all commented and supafly. The latest version lives at

; Functions for analyzing degree sequences in an undirected graph

; list-satisfies? is a list analyzer function.  It accepts a predicate
; function and a list.  If any element of the list should fail the
; predicate, then list-satisfies? fails as a whole.  Put another way, it
; succeeds *only* when all elements of the list satisfy the predicate.
(define list-satisfies?
  (lambda (predicate l)
    (cond ((null? l) #t)
          ((predicate (car l)) (list-satisfies? predicate (cdr l)))
          (else #f))))

; decrement-n-elements accepts an integer n and a list of numbers.  It
; subtracts 1 from the first n elements of the list.  No data validation
; is done, so all atoms must be numbers.  In the event that there aren't
; enough elements in the list to decrement n elements, the function will
; simply return a list with all elements decremented.
(define decrement-n-elements
  (lambda (n l)
    (cond ((null? l) '())
          ((zero? n) l)
          (else (cons (- (car l) 1)
                      (decrement-n-elements (- n 1) (cdr l)))))))

; valid-degree-sequence? is a predicate that analyzes a list of integers
; representing the degree of connectedness of unique nodes in an
; undirected graph.  It returns true if the sequence is all zeroes or
; reduces to same, and false if it contains a negative degree or reduces
; to a sequence with a negative degree.
(define valid-degree-sequence?
  (lambda (sequence)
    (cond ((list-satisfies? zero? sequence) #t)
          ((list-satisfies? (lambda (x) (not (negative? x))) sequence)
           (valid-degree-sequence? (reduce-sequence sequence)))
          (else #f))))

; reduce-sequence does the actual work of reducing the degree sequence.
; If the sequence d1,d2...dn has enough elements such that n >= d1, then
; it will decrement the first d1 elements of d2...dn.  If there are not
; enough elements for this to be performed, the list reduces to the bogus
; sequence (-1), which will fail any valid-degree-sequence? test.
(define reduce-sequence
  (lambda (sequence)
    (cond ((> (length (cdr sequence)) (car (sort sequence >)))
           (decrement-n-elements (car (sort sequence >))
                                 (cdr (sort sequence >))))
          (else '(-1)))))

Sat, 22 Feb 2003

00:53 [zork(~)] cat reading_club.txt

A Reading Club to Form New Hackers

If I were to run a hacker book club, I would screen out anyone who codes, especially for a living. I'd also not be too keen on anyone who was big on numbers, since the goal would be to catch Liberal Arts types and high school kids and so forth. I always imagine advertising this in the classifieds or something.

Here's the reading list I'd use:

Hackers: Heroes of the Computer Revolution

Hackers Start out with Hackers. It's a great read, and every hacker I know who read it as a child envied the people described in it. It's an inspiring story, and really gets across the notion of hacking, as opposed to mere development, or even work.

It covers the old guard of MIT, and lists many names that come up in anyone's study of LISP. It puts LISP into a historical context, which is useful.

Modern editions even end up with RMS, which can lead into...

Free as in Freedom: Richard Stallman and the Free Software Foundation

Free as in Freedom

It's the natural sequel to Hackers, and it covers a lot more of the philosophical angles. It helps put Free Software into historical perspective as well, and provides a context for EMACS the way Hackers does for LISP.

It's possible to skip this book, and cover Free Software in other ways, or to merely put this book on the list of subsequent reading the members might want to do on their own time.

Once the history and ethical questions are out of the way, move on to some more technical topics.

The Pattern on the Stone: The Simple Ideas That Make Computers Work

The Pattern on the Stone

Hillis makes a great explanation of the core principles of computer hardware and logical design. It's perhaps a GEB-lite, and references Hofstadter in one of the chapters. It's quite possibly the best introduction of the actual technology of computation for the lay reader.

It's a super-slim book, and can be covered in its entirety in a single session.

He talks about everything in terms of functional decomposition, which lets us lead into an application of functional decomposition: LISP itself.

The Little Schemer

The Little Schemer

This book above all others is why I love scheme. It's like a catechism for lisp programmers, or a dialogue between master and novice. It's Socratean intellectual midwifery -- 200 pages of leading questions and answers forcing you to work out the process of computation in your head or on paper.

It's quite possibly the best way to learn computer programming, and it requires absolutely no computers whatsoever to do so. It doesn't even mention particular operating environments, or teach you how to run the expressions on any sort of machine. It instead teaches you how to think about computation in a way that hack C and Perl programmers never get.

It's designed for people who are perhaps a touch innumerate, or can't get their multiplication tables down, or panic at long division. It assumes only basic arithmetic or algebraic skills, and even then only for a chapter. The whole book is structured around the manipulation of lists of names of food items (though many will note that the book is decidedly not vegetarian, lumping "turkey" in with "peanut butter and jelly", it never advises the reader to eat any meat).

This book would be covered less like a book club reading group, and more like a recitation session or laboratory. It'd be good to have a blackboard at this point, to illustrate and discuss each step of the question-answer cycle. I bet you I could teach even my dad to understand Y. It's all just linguistics.

Gödel, Escher, Bach: An Eternal Golden Braid

Gödel, Escher, Bach

I simply cannot describe this book. It's a book about thought, and it covers the topic with music, biology, psychology, and logic. It covers art and computing and linguistics and everything. I have no idea how one would cover a book like this in a book club, but you can't help but have long involved discussions after reading it.

Everyone I know who has read this book has been able to use it practically in their respective everyday lives. I pity the other Pulitzer candidates the year this book was was published, because it was an obvious shoo-in.

It's also long, and dense in parts (most notably when Hofstadter brings his boring graduate work in some sort of fractals into the tale, but do not give up!), but well worth it. The very structure of the book tells a tale, in the end, and context becomes message becomes medium again.

It's an endlessly rising canon!

Fri, 21 Feb 2003

01:50 [zork(~)] cat scheme.txt

So I have been heavy sick-on into scheme lately.

It's an obsession.

Over the weekend I read Paul Graham's treaties on the social order of adolescent nerds. I started bouncing through his site some more, and reading the history of T and the magic of macros and so on and so forth. It must have struck a scheme funnybone or something, because I picked up my copy of SICP and started reading.

Now I'm in the middle of chapter two (there are only five chapters), and I've already read through chapter ten of TLS a long time ago. I grok Y, but never really got around to building any real apps in scheme.

I realized that I had MIT-Scheme already installed on zork, and started fiddling in edwin. It's almost enough to make me start using EMACS.

So now I have a project in mind: integrate libguile into nwall. This way people can write scheme scripts to add features to nwall.

I also want to start a reading club for fledgeling hackers, but that's another story, and I have to BART off to an evening class now.

[zork(~)] cal
[zork(~)] tree
[zork(~)] cat README