
Marvin Minsky – The beauty of the Lisp language - fxbois
http://www.webofstories.com/play/marvin.minsky/44
======
maaku
Please resubmit with the actual story, not your G+ profile link:

[http://www.webofstories.com/play/marvin.minsky/44](http://www.webofstories.com/play/marvin.minsky/44)

------
kirkthejerk
I got great grades in college, but could never wrap my head around LISP (Lost
In Stupid Parentheses). For anything non-trivial, I cheated and handed in
somebody else's work.

There, I said it.

~~~
calibraxis
I get the impression Lisp tended to be taught awfully, uninspiringly. Maybe
even worse than other programming languages. Cheating sounds like a reasonable
response to such a farce of "education"; sad to hear when exposure to Lisp is
a soul-crushing experience.

I've seen a few old AI books where Lisp code is formatted unreadably. I wonder
why.

~~~
Jtsummers
Georgia Tech, one of the top schools in the US, couldn't even teach lisp. They
tried scheme with SICP (IIRC, not sure what else would have been used in
2001). It ended with a major cheating scandal [1]. I was convinced at the time
the issue was a lack of understanding on the parts of the TAs. Very few of
them had a background in scheme, it was the blind leading the blind according
to friends who had started that year (2001, I started in 2000). Since so many
students took intro to computing and there were only a few lecturers, the TAs
had to do the bulk of the real instruction (that is, non-200+ student
lectures). This resulted (at least for a time) in a fragmenting of the
introductory programming material, and it leaving the hands of the College of
Computing. Non-CS/EE/CMPE engineering students ended up in courses using
matlab, without ever actually studying algorithm design/analysis (which is
what CS 1311/1321/1511/whatever other numbers they'd used previously) used to
cover.

[1] [http://www.cavalierdaily.com/article/2002/01/cheating-
scanda...](http://www.cavalierdaily.com/article/2002/01/cheating-scandal-
shocks-ga-tech/)

~~~
rayiner
At least as far as I can tell, the problem was that they required _everyone_
to learn scheme, including the non-CS majors.

~~~
Jtsummers
I don't think that was _the problem_ , but it was _a problem_. I still contend
the inability of the instructors to do their job was _the problem_. If the TAs
had been prepared to teach scheme, and not come out of a year with a
background in pseudocode (based on Pascal for CS 1311/1321/1511/too many other
numbers) and Java (CS 1312/1322/1512/too many more numbers), but instead had a
background in functional programming and scheme in particular, they might have
been able to help their students out. That transition period from the
pseudocode based intro to computing to the scheme/SICP based course should
have been more gradual. Which leaves the ultimate failure on the part of the
faculty who decided on an abrupt transition for their students, and ultimately
failed the students in the process.

------
ISL
What does he mean when he says that it's not possible to write a C program
that can write other C programs?

Seems like there are counterexamples here:
[http://www.nyx.net/~gthompso/quine.htm](http://www.nyx.net/~gthompso/quine.htm)

Furthermore, it's possible to encode another programs' code into a single
print statement, thereby writing one piece of code with another. As that's
trivial, I suspect he meant something else. What was it? :).

~~~
weland
Quines are not quite the same thing.

Reasonably simple illustration: in Common Lisp, it is possible to write a
function that takes a mathematical expression as an argument and returns
another expression, as its derivative.

So basically I can write (pseudo-lisp-ish):

(defun diff (f) ... )

then call it like this:

(diff '(+ (pow x 2) x)

and I'd get the expression

(+ (* 2 x) 1)

as a result. The point is, however, that this expression is Lisp-callable
code. If I already have a function p, I can write:

(setq dp (diff p))

and dp is now the function computed by (diff p).

This is not necessarily the most practically-useful example, but I think it's
closest to being a strong illustration of the principle. In a nutshell, you
can do symbolic manipulation with code from within your code.

Edit: I just read your other post from this thread. It's important to note
that this happens _at runtime_ , not at compile time.

This isn't impossible to do in C if you _really want_ , but it wouldn't be
portable (the reason for this is left at the user's discretion). Think about
how you would do the same in C: write a function that takes a pointer to a
function f, and returns a pointer to another function g, so that g is the
derivative of f. It's obviously ok to restrict f to common mathematical
operators.

I can think about ways of doing it, but it ain't pretty.

~~~
aufreak3
And then there is this whole other category of self-modifying programs -
programs that know about their own structure and can change themselves at
runtime. This is (almost) in the "unthinkable" category for non-homoiconic
languages.

~~~
vinceguidry
I think you could solve most of the problems that you'd need this property for
with closures. If the bulk of the execution is defined with them, and you have
closures defining which other closures to run, you can have them swap each
other out.

~~~
weland
I'm not sure I understand what you have in mind. Assuming I have something
like this:

int foo(void) { return bar(1) + 2; }

is there any way in which I could arbitrarily modify this function? E.g. to
dynamically turn it into

int foo(void) { return bar(2) * 4 }

using closures?

I get how you could do that, assuming you had a function defined for each of
the possible operations you needed. But what about arbitrary modifications?

~~~
vinceguidry
You wouldn't want to modify the function in-place, that would violate
immutability of data. Each of these closures would themselves be generated, by
a factory method. When you're ready to modify, you'd invoke the factory to
generate another closure, then you'd use whatever infrastructure you built to
assign them in the first place to re-assign them to the new closures.

~~~
weland
Ah, got it. Thanks!

~~~
vinceguidry
If you wanted to get really sophisticated, you could generate the factory
methods, too.

------
brudgers
The Minsky clip was great, but I just spent an hour watching parts of the
interview with Knuth. 50 years writing a book - there's a book about the book
in there waiting.

[http://www.webofstories.com/play/donald.knuth/47](http://www.webofstories.com/play/donald.knuth/47)

