Comments on Lisp

Discussion of chess software programming and technical issues.

Moderators: bob, hgm, Harvey Williamson

Forum rules
This textbox is used to restore diagrams posted with the [d] tag before the upgrade.
User avatar
sje
Posts: 4675
Joined: Mon Mar 13, 2006 6:43 pm

Comments on Lisp

Post by sje » Wed May 09, 2007 9:27 pm


Michael Sherwin
Posts: 3041
Joined: Fri May 26, 2006 1:00 am
Location: WY, USA
Full name: Michael Sherwin

Re: Comments on Lisp

Post by Michael Sherwin » Wed May 09, 2007 11:47 pm

sje wrote:See: http://lispers.org/
I will go there and read as I am interested in Lisp, however, after downloading the mathematical language Haskell and reading all about it I am sold on it. It has most of the speed of c and as much expressive power of Lisp. The learning curve for Haskell is going to be very steep, maybe twice as steep as for Lisp. But, in the end I believe that it will be worth it!

You can do more with Haskell in one line of code than any other language that I have seen so far. Haskell has no for loops or while statements and even the if statement seems limited to just returning one value or another. The syntax is pure mathematical and processes 'streams' (my term) of data that comes from a list or a function as needed. My understanding of Haskell is very limited and new, so some of what I have just written may be in error.

Mike
I hate if statements. Pawns demand if statements. Therefore I hate pawns.

User avatar
sje
Posts: 4675
Joined: Mon Mar 13, 2006 6:43 pm

Re: Comments on Lisp

Post by sje » Thu May 10, 2007 12:04 am

Michael Sherwin wrote:You can do more with Haskell in one line of code than any other language that I have seen so far.
APL has them all beat for potential brevity. Example: a chess program in three lines. (Didn't play very well, though.)

On the referenced file, my favorite quote is "Lisp is like taking the red pill." But there are even better sayings, many with a Zen style:

"Lisp is like a ball of mud."

bob
Posts: 20562
Joined: Mon Feb 27, 2006 6:30 pm
Location: Birmingham, AL

Re: Comments on Lisp

Post by bob » Thu May 10, 2007 12:19 am

Michael Sherwin wrote:
sje wrote:See: http://lispers.org/
I will go there and read as I am interested in Lisp, however, after downloading the mathematical language Haskell and reading all about it I am sold on it. It has most of the speed of c and as much expressive power of Lisp. The learning curve for Haskell is going to be very steep, maybe twice as steep as for Lisp. But, in the end I believe that it will be worth it!

You can do more with Haskell in one line of code than any other language that I have seen so far. Haskell has no for loops or while statements and even the if statement seems limited to just returning one value or another. The syntax is pure mathematical and processes 'streams' (my term) of data that comes from a list or a function as needed. My understanding of Haskell is very limited and new, so some of what I have just written may be in error.

Mike
If you want power in a few statements, look at "APL". Blows everything else away.

bob
Posts: 20562
Joined: Mon Feb 27, 2006 6:30 pm
Location: Birmingham, AL

Re: Comments on Lisp

Post by bob » Thu May 10, 2007 12:20 am

sje wrote:
Michael Sherwin wrote:You can do more with Haskell in one line of code than any other language that I have seen so far.
APL has them all beat for potential brevity. Example: a chess program in three lines. (Didn't play very well, though.)

On the referenced file, my favorite quote is "Lisp is like taking the red pill." But there are even better sayings, many with a Zen style:

"Lisp is like a ball of mud."
When I was working on my Ph.D., I infuriated one of the faculty I was working under when I glibly (an a seminar presentation) called LISP "A write-only language..." :)

User avatar
sje
Posts: 4675
Joined: Mon Mar 13, 2006 6:43 pm

Re: Comments on Lisp

Post by sje » Thu May 10, 2007 12:58 am

Lisp, like APL, is one of the very few computer languages that is autoiconic; that is, has the capability of self representation. And Lisp does it much better than APL as the self-rep was part of the original design. So Lisp can talk about itself, much like Godel's Incompleteness Theorem has mathematics talk about itself to show that there are unprovable truths and irrefutable falsehoods.

While it is true that some Lisp programs are quite hard to read, much of the blame can be placed on the Lisp coders who tend to be smart but undisciplined. Also, there are some programmers who think that just because a feature is present in a language, it must be used. And Lisp has a lot of rope here, like the run time macro facility that's often abused.

Dan Andersson
Posts: 442
Joined: Wed Mar 08, 2006 7:54 pm

Re: Comments on Lisp

Post by Dan Andersson » Thu May 10, 2007 8:00 pm

Iverson teamed up with Hui to better APL. Chucking out the special symbols and adding ideas from Backus paper 'Can Programming Be Liberated From the von Neumann Style?' they created J.
Available for free from http://www.jsoftware.com/.

MvH Dan Andersson

Dan Andersson
Posts: 442
Joined: Wed Mar 08, 2006 7:54 pm

Re: Comments on Lisp

Post by Dan Andersson » Thu May 10, 2007 9:56 pm

After reading your post I can only write: Welcome to the dark side, young Skywalker!
What study material are you using?
If you are looking for books I would recommend the recently published 'Programming in Haskell' for a solid and easy introduction if you are just aiming to learn the language.
For the more mathematically inclined mind I would say that nothing tops 'The Haskell Road To Logic, Maths And Programming'. The last one was my foundation.

MvH Dan Andersson

smcracraft
Posts: 671
Joined: Wed Mar 08, 2006 7:08 pm
Location: Orange County California
Full name: Stuart Cracraft
Contact:

Re: Comments on Lisp

Post by smcracraft » Sun May 13, 2007 12:43 pm

sje wrote:See: http://lispers.org/[/quote

Humorous and enjoyable - thanks for posting that.

My experiences with Lisp have been three-fold.
I took a class from its inventor John McCarthy at
Stanford and did enjoy it. He was mostly concerned
at the time (this was in the 70's-80's about programs
that could write programs. I remember his delivery
as a speaker being quite a bit different than normal
speakers.

Another class I took, that used Lisp heavily, was
Ed Feigenbaum's A.I. class at Stanford. A colleague
and I did a three-dimensional tic-tac-toe program,
which unfortunately I've lost the source to. Feigenbaum's
delivery as a speaker is tremendously inspirational.

The other Lisp-related activity I did was work with
my old boss when I was at Toshiba 20 years 15
years ago (we stil have lunch about 1-2x per year)
and designed 'SPR' a software-problem-reporting
system for the company using GNU Emacs Lisp.
That was a lot of fun. I really enjoy the linkage
in GNU Emacs and its embedded Lisp. The system
worked pretty well.

I find that Lisp encourages me to think at a higher
cognitive level. I honestly feel that regular Lisp programming
could be one way of slowing cognitive decline
and declining mental functioning as we all age.

I would encourage everyone who interacts with
children or has children to expose those children
to Lisp if they get identifiied as mathemtically
inclined.

Lisp is a profoundlly seminal and and critical
contribution from Professor McCarthy
to the computer community.

--Stuart

User avatar
sje
Posts: 4675
Joined: Mon Mar 13, 2006 6:43 pm

The J language

Post by sje » Sun May 13, 2007 3:40 pm

Yes, J is an ASCII form of a cleaned up APL. And although a free version has been around awhile, it really hasn't caught on. I think part of the reason for this is that the old time APL fans just didn't want to give up the original funky character set complete with all its overstrike gylphs. In the Old Days I used APL on a 1970s Teleray CRT terminal with an APL keyboard and character ROM, and it was a lot of fun.

Anyway, the real successor of APL is not J, but rather the commercial product Mathematica.

Post Reply