You are not logged in.

#1 2009-10-18 23:29:05

umpalumpa1985
Member
From: America
Registered: 2007-12-05
Posts: 134

Lisp

So.  I've decided to learn Lisp.  Outside of some bash and python scripting, this will be my first programming language.  I don't know why i decided to learn Lisp.  Maybe it's because everything i read about it says it's immensely hard to use.  I do like a challenge.  Please don't try to convince me to learn a different language, or anything like that.  What I would like is pointers to good resources/tutorials/knowledge bases, etc.  And if anyone has any experience with it, please feel free to tell me what i'm getting myself into.  :-)

EDIT: Also, the historical aspect has a lot to do with my choice.  FORTRAN got some consideration, but Lisp actually still seems (kind of) widely used today.

Last edited by umpalumpa1985 (2009-10-18 23:32:49)


Never interrupt your enemy when he's making a mistake.    ~Napoleon Bonaparte

Offline

#2 2009-10-19 00:21:57

wuischke
Member
From: Suisse Romande
Registered: 2007-01-06
Posts: 630

Re: Lisp

I have only a little practical experience with Common Lisp and pretty good theoretical understanding due to a lot of reading about functional programming and Lisp, Erlang and Haskell in particular.

Based on what I know, I would recommend you to learn Scheme. I've heard excellent things about SICP as a text book, you can read it for free.

I personally didn't like Common Lisp's complexity, I felt I had to think about millions of things just to write a simple program. I used Paul Graham's ANSI Common Lisp book and wrote the solutions to the problems on paper - when I later tried them at the interpreter, I always had to make many adjustments, because my mental model of Lisp was different from actual Common Lisp functions. Also many function names are very long, like for instance "multiple-value-bind" which leads to a lot of noise in the code. At least for me

a,b,c = (1,2,3)

is a lot easier to read than

(multiple-value-bind
    (a b c)
    (values 1 2 3))

.

Although I'm personally using mostly Python these days (the language is OK and batteries included is a killer argument), I can recommend learning Erlang, too. It has an - imho - nice syntax with features like pattern matching and guards and I found it easier to understand than Haskell. I used the book "Programming Erlang" by Joe Armstrong to learn and I had a good experience. There used to be a website with the whole text of the book (used to get feedback while the book was written), but I'm unable to find it now.

Apart from that: C, Smalltalk.
I don't know good resources for C (I learned by doing), but for Smalltalk I enjoyed Squeak by example

C# is quite nice, too, and I would prefer it over C++ and Java. I would look what documentation the mono guys have.

Offline

#3 2009-10-19 00:26:09

keenerd
Package Maintainer (PM)
Registered: 2007-02-22
Posts: 647
Website

Re: Lisp

Here's my three favorites, in recommended order of reading.

Common Lisp First Contact
Casting SPELs in Lisp
Practical Common Lisp

There are also gobs of good Scheme books, someone asked about that in the forums recently.

On a similar note, Lisp has taught me that Aaron can lift a car over his head, but only if he can also fold a cdr into the tail.

Offline

#4 2009-10-19 00:40:54

madalu
Member
Registered: 2009-05-05
Posts: 217

Re: Lisp

Though emacs lisp is admittedly a niche (and somewhat obsolete) dialect of lisp, emacs is an absolutely fantastic environment in which to learn the basics of lisp because everything is so nicely documented and you can evaluate stuff right in the editor.

That said, emacs lisp is fairly different from the more standard lisps and lacks some of their features.

Offline

#5 2009-10-19 00:46:15

chpln
Member
From: Australia
Registered: 2009-09-17
Posts: 361

Re: Lisp

[Note: the majority of my experience is with Emacs Lisp and Common Lisp.]

I wouldn't say Lisp is difficult to use or learn, it does however encourage you to think differently about the way you approach a problem.  Also consider which Lisp you'd like to learn.  Scheme, Common Lisp and, more recently, Clojure are general-purpose and well documented dialects.

For Common Lisp, I recommend Practical Common Lisp which provides an excellent introduction to the language and OnLisp which gives an interesting insight into techniques possible with Lisp. Another which is often recommended is SICP, keep in mind though its focus is on Scheme.  Then once you get comfortable with CL, you'll likely find you'll be referring to the Hyperspec quite a bit.

For an editor, my preference is Emacs: since it is extensible in Lisp, and a significant portion of it is written in Lisp, its support for editing Lisp dialects is as good (if not better) than you might expect.  Take a look at Slime for common-lisp integration.  Marco Baringer has created an excellent screencast (55min; 149mb; quicktime encoded mpeg-4) to demonstrate Slime.

Last edited by chpln (2009-10-19 00:46:40)

Offline

#6 2009-10-19 02:44:18

Basu
Member
From: Cornell University
Registered: 2006-12-15
Posts: 296
Website

Re: Lisp

I'm actually learning Lisp myself right now. I've started using the Practical Common Lisp and I've found it very useful. There are a number of  projects of small size scattered throughout which help to understand the power and use of Common Lisp. However, it is a bit lacking on smaller exercises for you to cut your teeth on. For these exercises I suggest 99 Problems in Lisp. I'm currently about a third of the way through. They're challenging but not too hard and you get through them quite quickly once you get used to the functional-list-based way of thinking.

Once I'm done with Practical Common Lisp I plan to move on to On Lisp so that I can learn more about using macros.

Last edited by Basu (2009-10-19 16:27:51)


The Bytebaker -- Computer science is not a science and it's not about computers
Check out my open source software at Github

Offline

#7 2009-10-19 02:52:43

umpalumpa1985
Member
From: America
Registered: 2007-12-05
Posts: 134

Re: Lisp

Wow.  I wasn't expecting this amount of positive and helpful feedback so quickly.  Just shows the nature of individuals involved in Arch,  I suppose.  Thanks you for all the pointers.  I have already started reading Practical Common Lisp since my last post, and it is very informative.  I think that for starters, I will in fact learn Common Lisp, it being the most closely tied to "traditional" lisp, and once I have a good grasp of that, I will branch out into other dialects such as scheme.  I have never even tried to learn a language before, and I am very excited about the whole venture.  I did multitudes of reading/homework before I decided on this language, and I think it will be very rewarding once I start getting into the swing of things.  Once again, thank you for all the amazing feedback, it is very much appreciated.


Never interrupt your enemy when he's making a mistake.    ~Napoleon Bonaparte

Offline

#8 2009-10-19 03:53:35

HashBox
Member
Registered: 2009-01-22
Posts: 271

Re: Lisp

When you get to the scheme part, I would like to recommend trying out newLISP, which is basically a scheme with some very practical functions built in. This has been my main gateway to lisp/scheme so far.

Last edited by HashBox (2009-10-19 03:54:44)

Offline

#9 2009-10-19 04:05:03

umpalumpa1985
Member
From: America
Registered: 2007-12-05
Posts: 134

Re: Lisp

The only problem I'm having is that i'm very terrible at using emacs/slime.  I'm use to using vi or vim or even nano, and emacs is throwing me for a loop ( shame on me, i know).  Are there any other IDEs for lisp worth noting?


Never interrupt your enemy when he's making a mistake.    ~Napoleon Bonaparte

Offline

#10 2009-10-19 05:00:16

umpalumpa1985
Member
From: America
Registered: 2007-12-05
Posts: 134

Re: Lisp

i have done a lot mor reading in the last few hours, and have to agree with wuischke that scheme might be the dialect to go for.  only problem is that there are so many implementations of that that i dunno which one to use.  I'm definitely gonna go the scheme route instead of clisp, so any insight on a good scheme implementation to use/learn?


Never interrupt your enemy when he's making a mistake.    ~Napoleon Bonaparte

Offline

#11 2009-10-19 05:21:06

chpln
Member
From: Australia
Registered: 2009-09-17
Posts: 361

Re: Lisp

umpalumpa1985 wrote:

I'm use to using vi or vim or even nano, and emacs is throwing me for a loop.

You might find you can better adjust to Emacs with Viper Mode enabled ('Alt+x viper-mode').  However, if you're already used to vim, there's no need to use anything else.

umpalumpa1985 wrote:

so any insight on a good scheme implementation to use/learn?

I picked guile for dabbling in Scheme, as it is a mature, well supported and documented implementation.  That said, I never delved deeply enough into scheme to run into the intricacies of the implementation.

Last edited by chpln (2009-10-19 05:40:52)

Offline

#12 2009-10-19 05:33:19

juster
Forum Fellow
Registered: 2008-10-07
Posts: 195

Re: Lisp

I used DrScheme in school which was very very easy to use.  I am gradually learning CLISP.  Setting everything up and learning how different the compiler works compared to other languages was surprisingly difficult.

DrScheme in comparison was very nicely put together.  It's basically a bundle of everything integrated into an editor which runs PLT Scheme.

Offline

#13 2009-10-19 13:56:15

&#32 Greg
Member
Registered: 2009-02-08
Posts: 80

Re: Lisp

I feel the need to mention The Little Schemer... it's a nice introduction to thinking functionally.

Offline

#14 2009-10-19 16:34:18

Basu
Member
From: Cornell University
Registered: 2006-12-15
Posts: 296
Website

Re: Lisp

I second juster's idea of using DrScheme. It's a really nice tool and will save you from having to learn an editor and a language at the same time. That being said, if you do want to become a production Lisp coder (as opposed to just learning it), Emacs+SLIME is almost a must. Just approach it like any other thing that you need to learn.


The Bytebaker -- Computer science is not a science and it's not about computers
Check out my open source software at Github

Offline

#15 2009-10-19 23:14:06

umpalumpa1985
Member
From: America
Registered: 2007-12-05
Posts: 134

Re: Lisp

Let me say that scheme is great.  It feels very intuitive, and i have already coded a few simple programs.  The syntax flows very easily, and large-scale mathematical computations are a breeze.  And DrScheme is amazing.  @Basu:  i do see that emacs+slime is the de facto standard, but i'm not looking at production level code, just a learning experience.  who knows though, maybe one day. . . thanks for the help guys


Never interrupt your enemy when he's making a mistake.    ~Napoleon Bonaparte

Offline

#16 2009-11-12 07:48:09

mjunx
Member
From: Chicago
Registered: 2009-11-01
Posts: 17
Website

Re: Lisp

wuischke wrote:

...

a,b,c = (1,2,3)

is a lot easier to read than

(multiple-value-bind
    (a b c)
    (values 1 2 3))

...

Well, maybe you should check out common lisp instead:

(setf a 1
      b 2
      c 3)

Offline

#17 2009-11-12 10:01:28

wuischke
Member
From: Suisse Romande
Registered: 2007-01-06
Posts: 630

Re: Lisp

Uh? multiple-value-bind is a common lisp macro. Scheme calls it receive, if I'm not mistaken. (I already mentioned I'm not very experienced in Lisp.)

Anyway, your example would be 100% correct for my simplified example, but I believe it wouldn't work for the actual purpose of multiple-value-bind - receiving the return values of a function with multiple return values. You might be able to cheat around it using the Lisp equivalent of "yield", but this adds again complexity.

Last edited by wuischke (2009-11-12 10:01:47)

Offline

#18 2009-11-12 12:56:13

sr
Member
Registered: 2009-10-12
Posts: 51

Re: Lisp

It's probably call-with-values or let-values that you're looking for.

@umpalumpa1985: if you're using DrScheme, do look at the plt-scheme mailing lists too: some amazingly knowledgeable and helpful people there (well, I suppose it helps that they are all teachers smile )

Offline

#19 2009-11-12 14:42:30

umpalumpa1985
Member
From: America
Registered: 2007-12-05
Posts: 134

Re: Lisp

Thanks for the tip.


Never interrupt your enemy when he's making a mistake.    ~Napoleon Bonaparte

Offline

#20 2009-11-13 03:00:34

tomd123
Developer
Registered: 2008-08-12
Posts: 565

Re: Lisp

umpalumpa1985 wrote:

So.  I've decided to learn Lisp.  Outside of some bash and python scripting, this will be my first programming language.  I don't know why i decided to learn Lisp.  Maybe it's because everything i read about it says it's immensely hard to use.  I do like a challenge.  Please don't try to convince me to learn a different language, or anything like that.  What I would like is pointers to good resources/tutorials/knowledge bases, etc.  And if anyone has any experience with it, please feel free to tell me what i'm getting myself into.  :-)

EDIT: Also, the historical aspect has a lot to do with my choice.  FORTRAN got some consideration, but Lisp actually still seems (kind of) widely used today.

If you want historical aspects, get youself some punch cards smile BTW, I learned some lisp (common lisp) a while back and really liked it. The problem with it is that it doesn't have any standardized modern libraries, fi, no standard threading library. But I think it is definitely worth learning it, just for learning a language that doesn't have "normal" syntax tongue

Offline

Board footer

Powered by FluxBB