PDA

View Full Version : LISP programming



ssharish2005
10-10-2007, 10:23 AM
Hi, Just started my new AI module at uni. And they started teaching LISP ( God i am confused with all those brackets everywhere in the code lol). Its totally different compared to other programming language. It looks like that I need to forget all my other programming exp and start fresh with this one lol.

Any way, has anyone else worked with LISP before. How do u feel about it. Any advice please, since i am just a beginner. Any link for good compiler, IDE and book reference.

I was looking for a good compile and i came up with this CLISP. Has any one used that before?

Thanks

ssharish

hk_mp5kpdw
10-10-2007, 11:03 AM
I've worked with it before in an AI class (also Prolog I think). I hated it. Too many parenthesis everywhere. It was just so different from everything else I'd done before. I did OK, but I never felt comfortable with it. Maybe I could get used to it, but not for just a one semester class.

Advice? Not really... sorry. I try to avoid it and not think about it (traumatic experience and all ;))

ssharish2005
10-10-2007, 11:35 AM
lol if your expereince was like that, thinking of me in am just a beginner. So which compiler did u use? And more over my teacher is more confused as well on LISP lol. I wonder what is he going to do.

ssharish

matsp
10-10-2007, 11:58 AM
Lisp is generally not a compiled language, but uses an interpeter.

Many years ago, I wrote my own lisp interpreter (not quite a "full" version, but it works).

Perhaps this one:
http://directory.fsf.org/project/gcl/

More LISP-related here:
http://directory.fsf.org/category/lisplang/

--
Mats

pianorain
10-10-2007, 02:04 PM
Aye, Lisp looks terrible when you're used to looking at C or C++, but after you learn what you're looking at, it's not so bad. CLISP is the interpreter I usually use; it's not too bad. If you're looking for a book, I'd recommend ANSI Common LISP (http://www.amazon.com/exec/obidos/ASIN/0133708756) by Paul Graham. It did a pretty good job of translating me from C++ to Lisp; granted, the chapters on closures and macros took a few times.

DavidP
10-10-2007, 04:00 PM
I have only done a little bit of true Lisp, but I have done quite a lot of Scheme (which is virtually the same thing).

I use DrScheme as my interpreter.

I don't think Lisp/Scheme is that bad though....but that may be because I was exposed to it very early. Although I am taking a Scheme class right now in uni, and this is the first time they have exposed it to us (being a junior), I had a good high school computer science teacher who exposed me to Lisp during my first year of learning C++, so I already had an idea of the parentheses and prefix notation.

Rashakil Fol
10-10-2007, 05:22 PM
Common Lisp is a fine language, and Scheme is ok too. SBCL is a good free Common Lisp compiler. Lisp is a lot different than languages like C++, since everything that C++ adds to C is a lame attempt to add some ability that Lisp provides with no effort at all.

brewbuck
10-10-2007, 05:55 PM
Lisp is a lot different than languages like C++, since everything that C++ adds to C is a lame attempt to add some ability that Lisp provides with no effort at all.

I've really got to disagree with that. C++ allows you to easily break into a pseudo-functional or Lisp'ish style of coding when it makes sense, and go right back to procedural and traditional object oriented techniques when it doesn't make sense. Yeah, you could probably write more "elegant" code in pure Lisp, or Haskell or Prolog for that matter but good luck finding a seasoned development team for anything large-scale.

I do not denigrate Lisp whatsoever -- I love it. But I had to respond to the claim that everything in C++ is just a lame imitation of something else. C++ is deliberately required to be interoperable to a large degree with existing C code. That really constrains how certain things have to be implemented in the language.

Rashakil Fol
10-10-2007, 08:50 PM
I don't see why you perceive that as an attack on C++, when it's just an explanation of how Common Lisp doesn't suck. And CL is not an elegant language. It's a big, monstrous language.

brewbuck
10-11-2007, 11:52 AM
I don't see why you perceive that as an attack on C++, when it's just an explanation of how Common Lisp doesn't suck.

You said: "everything that C++ adds to C is a lame attempt ."


And CL is not an elegant language. It's a big, monstrous language.

I didn't say anything about the elegance of the language. I was talking about the elegance of solutions written in the language. If you don't like the inelegant parts of the language, don't use them.