可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
Which Lisp (dialect) should I learn, and why?
The fragmentation between CL and Scheme slows uptake (at least for me!).
So, give me the "true answer", please!
I have tried to read feature comparisons, and they seem to get bogged down in esoterica (that I don't fully understand) like whether the dialect is fully tail-recursive, and the like. I'm hoping you all (collectively) can make the opaque differences clear.
Things I like
Good library support, good environments, and Unicode support.
Things I dislike
Flamewars. Features that are useful at the beginning, but interfere with long-term learning.
Updates
I've been mostly using MzScheme, which I'm enjoying just fine, once I got readline support going. I don't run a GUI on Unix, so it seemed to be a fine environment option for me.
I'm also very happy that Clojure has an easy to install .deb package on debian, so it's much easier to play with. This is a big win. Despite the hostility of some rather easy-to-anger below, low barrier to entry is a win. I like being spoonfed.
After reading a lot more of SICP, I do understand the issues around tail recursion much better.
回答1:
Clojure is an actively developed, modern dialect of Lisp. It's based on the JVM, so all the Java libraries are immediately available, and therefore also has Unicode support.
This is one alternative, not the One True Answer.
回答2:
If you want avoid flamewars and you enjoy libraries go with Clojure. It's small, it's fast, and the community is helpful and non-dogmatic. It's Lisp minus the absurd cruft of the 1980s . It has a BDFL and if you have a good idea there's a damn good chance it will get implemented into the language.
I have toyed around with Common Lisp, it's a beautiful thing. I've completed the first 3 chapters and the Metacircular Evaluator in SICP in DrScheme, and that is beautiful thing as well. Of course, you will benefit greatly from learning these.
But, over time I have come to hold small languages dear to my heart. I won't lie, I love Javascript and I love C (and goddammit if every language doesn't have a C core at it's heart) because they are small.
Clojure is small. It is elegant. It is a language for our times.
回答3:
Contra Chuck, an advantage of Common Lisp is that it has a standard that implementations stick to and strive for, such that you can develop largely with SBCL (which has excellent type checking and inference) and then, say, deploy as an executable linked with C libraries (with ECL or others) or as a .jar making use of Java libraries (with ABCL), or with a Mac or a Windows-native GUI (Clozure, both). Common Lisp is amazingly portable across architectures and over implementations and over time, and Common Lispers make efforts to keep things this way, with the support of the language. As an illustration, one silly divergence of unstandardized behavior is the question "is this a special variable?" So I answered it across the implementations I use:
#-abcl
(defun special-variable-p (symbol)
#+ecl(si:specialp symbol)
#+ccl(proclaimed-special-p symbol)
#+sbcl(equal '(:special t)
(multiple-value-list-int:info :variable :kind symbol)))
which reduces, at read time, to nothing on ABCL (it has this already), to (defun special-variable-p (symbol) (si:specialp symbol))
on ECL, and so on. So I can put this in my .rc files and use the common function at the REPL. But this isn't very important: this isn't threading or variously-backed networking or a Communicating Sequential Processes library. This last example just has one #+sbcl/#-sbcl
even as it runs on five implementations. Because it relies on code that's been carefully ported.
But what permits this (and other) advantages also poses its own challenge to the learner: Common Lisp is a very big language. It isn't something you can slurp up in a week or two, like I did Clojure (but my Clojure is already decaying with the breaking changes set to roll out - that language, although heavy with its own merits, reminded me by contrast of a lot of what I like about Common Lisp.) So you should read a lot of this page, and keep the HyperSpec a keypress away (for me, M-x hyperspec RET do-symbols RET
is sufficient nearness to the Bible.), and think about buying a few books. I have Practical Common Lisp, just got Let Over Lambda, and will buy PAIP real soon now.
But even if Common Lisp is the True Answer, you won't completely waste your time by 'just picking' some deceptively flashy alternative (-- 'deceptive' because commonplace CL doesn't show you all that its macros can do, and it has more kinds of macros than anybody. The usual comparison is between bad CL and syntax-optimized alternative X). You'll still learn the basics, you can still use much of what you can read in SICP, On Lisp, The Little Schemer, etc. A lisp, even the wrong lisp, is still better than a non-lisp. (But you'll spend some of your time implementing parts of the right lisp, poorly, in the wrong lisp. Meta-Greenspun.)
回答4:
Clojure is a great dialect of LISP that promotes functional programming. It runs on the JVM so you have access to any Java libraries you might be used to using. The site has great documentation and screencasts to help you learn. Another advantage is that it's really easy to install, unlike a lot of other dialects.
If you're just looking to grok the concepts Emacs (EmacsLISP specifically) is another alternative. It comes with incredible documentation, tutorials, and lots of code samples. Screencasts are fairly easy to find as well. One of the great benefits of Emacs is that the editor is written in LISP so the editor naturally has very good support for running, editing and debugging LISP. In addition, you can extend the editor to make your every day text editing needs easier while you learn LISP.
回答5:
Just pick one, and learn it. By the time you figure out the differences, you'll be in a position to choose again, if you chose badly the first time.
回答6:
Lisp's biggest problem is that there's no overriding standard everyone sticks to. You don't just have to pick between Common Lisp and Scheme; you have to pick between several incompatible implementations of Common Lisp and several incompatible implementations of Scheme, as well as other little things like Arc and Clojure.
I would recommend starting with MzScheme. It's popular, it's actively developed, it has many libraries offering the features of a modern programming environment, and Scheme is somewhat simpler (not to say better, just simpler) than Common Lisp.
回答7:
Learn elisp so you can extend Emacs.
回答8:
Go with Clojure. It's an amazing language with full access to any Java library. It has been in development for just over 2 years and already has 3 IDE plugins in development and a book being published in April about it. It's very fast, very elegant and beautiful. You can't go wrong with Clojure.
回答9:
For me, the foundational theory of Scheme is far more convincing. PLTScheme is, by far, the most actively developed LISP I've found. Unfortunately, it has a proliferation of typing that obscures the beauty of Lisp.
I'd love to see something like arc succeed, but it seems unlikely.
回答10:
Take a look at IronScheme.
回答11:
Conjecture: when learning your first lisp, don't learn one you'll end up using for end development.
Lemma: learn Arc. It's all of the "hard to grok" things in lisp - closures, macros, continuations, with none of Clojure's Java interop complexity, CL's namespace confusion, or Scheme's name fragmentation. If you're dedicated, you can learn all of these things in a weekend. If you're sharp and dedicated, in a night.
And it'll make learning all the other lisps a lot easier.
回答12:
I do not know Lisp but heres why I think PLT Scheme is a good choice:
Really Good Documentations
http://download.plt-scheme.org/doc/html/
DrScheme
DrScheme is an amazing programming environment that comes with a compiler, stepper, syntax checkers, REPL, myriad of languages support and is extensible. This makes the entire experience fun. See some screenshots
Good Support from the community.
The community is very enthusiastic about their language and very supportive too. If you have any questions, mailing lists, groups and forums are available. Even the authors are very very accessible.
Continuing Research
PLT is very active and continue to make their tool better and better. You can expect a lot of innovations from the labs. eg. Im pretty excited about using this: http://blog.plt-scheme.org/2009/05/typed-scheme-20.html
Free Books and interesting tutorials to get you started.
http://www.htdp.org/
http://world.cs.brown.edu/
Good modules and extensive libraries.
http://www.cs.utah.edu/plt/develop/
http://planet.plt-scheme.org/
also see docs
If you are learning Scheme, give DrScheme a try.
回答13:
You know... When I got interested in Lisp I also thought I'd have to choose. Then, after reading and asking a lot, I ended up choosing Common Lisp. Not because it's "better" than Scheme in an absolute way, but because it had features I knew I'd probably use in the next 2-3 years in my projects:
- A very efficient compiler for numerical computation (SBCL),
- The condition system, and...
- I have to admit that SLIME also played an important role in this decision. :-)
So if I were you, I'd start learning a tiny bit of each language, and find out what are the relative strengths and weaknesses of each (I mean, those related to what you'll need/want to do most often) so you I could pick one. You may just find out that you'll learn the other later also (happened to me -- I had to learn more Scheme after one year studying Common Lisp)
As to Arc, Clojure and Lush, and don't know those. I suppose the same argument could apply to them too... The reasons I didn't want to invest too much on them were: Arc does not seem to be interesting for numerical computing, and P. Graham seems obssessed by code size (to the point of making his code unreadable); Clojure seems nice, but I don't like the JVM. And Lush... Well, besides using dynamic scope, the compiled and interpreted versions of the language are very different -- and you can't compile recursive functions. So, it was either Scheme or Common Lisp to me.
回答14:
I think you either want Common Lisp or PLT Scheme.
The former comes with a lot of freedom and power (that might overwhelm you at first) and the latter comes with a bunch of libraries, matching tutorials and a well-integrated IDE.
回答15:
Pick anything but Clojure, go with it, and you will be in a better position to evaluate later.
You phrased this question as which Lisp is the best medium for learning Lisp, and to me that has to include a Lisp that is built up from low level primitives, whereas large parts of Clojure are written in Java.
If you had phrased this question as which is the best Lisp to start a new project in, then Clojure may be the best choice.
回答16:
I am a fan of Scheme, but it has been more than 10 years since I did anything with Scheme.
like others have said - just pick one and go.
回答17:
There are very few real choices there, either SBCL, Clojure or PLTScheme.