What to learn Scheme vs Lisp [closed]
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
开发者_运维百科Closed 5 years ago.
Improve this questionScheme vs Lisp ? What to learn, I need language for functional programming .
I think it's objectively true to say that Scheme is a bit more consistent and symmetrical when it comes to names and conventions. Trivial example: True and false are #t and #f, not T and nil as in Lisp. Are details like this a deal-breaker? Of course not. But the fewer weird exceptions you have to remember, early on, the less distracted you'll be from the important stuff.
Although you may use recursion in Scheme, you can also do things that don't smell like recursion -- such as the ever-popular named-let idiom, where everyone seems to name it `loop': (let loop () ...) -- or even explicit looping constructs.
Like CL, Scheme doesn't force you to be functional or immutable. But if you come from an imperative background, it's rewarding to push through and finally have it "click" how you write things without re-assigning values to variables. However if you don't want that light bulb experience, feel free to set! things imperatively.
I would suggest you start with Scheme, and more specifically with Racket (formerly "PLT Scheme"). It comes with a wonderful IDE, very good documentation, and a very helpful mailing list. It has libraries that let you write real-world programs, as well as work your way through great books like SICP or HtDP.
Already answered here on SO : Comparison Lisp vs Scheme
Best answer from Vinko Vrsalovic:
Excerpt from Practical Common Lisp
If you've used Lisp in the past, you may have ideas about what "Lisp" is that have little to do with Common Lisp. While Common Lisp supplanted most of the dialects it's descended from, it isn't the only remaining Lisp dialect, and depending on where and when you were exposed to Lisp, you may very well have learned one of these other dialects.
Other than Common Lisp, the one general-purpose Lisp dialect that still has an active user community is Scheme. Common Lisp borrowed a few important features from Scheme but never intended to replace it.
Originally designed at M.I.T., where it was quickly put to use as a teaching language for undergraduate computer science courses, Scheme has always been aimed at a different language niche than Common Lisp. In particular, Scheme's designers have focused on keeping the core language as small and as simple as possible. This has obvious benefits for a teaching language and also for programming language researchers who like to be able to formally prove things about languages.
It also has the benefit of making it relatively easy to understand the whole language as specified in the standard. But, it does so at the cost of omitting many useful features that are standardized in Common Lisp. Individual Scheme implementations may provide these features in implementation-specific ways, but their omission from the standard makes it harder to write portable Scheme code than to write portable Common Lisp code.
Scheme also emphasizes a functional programming style and the use of recursion much more than Common Lisp does. If you studied Lisp in college and came away with the impression that it was only an academic language with no real-world application, chances are you learned Scheme. This isn't to say that's a particularly fair characterization of Scheme, but it's even less applicable to Common Lisp, which was expressly designed to be a real-world engineering language rather than a theoretically "pure" language.
If you've learned Scheme, you should also be aware that a number of subtle differences between Scheme and Common Lisp may trip you up. These differences are also the basis for several perennial religious wars between the hotheads in the Common Lisp and Scheme communities. I'll try to point out some of the more important differences as we go along.
Two other Lisp dialects still in widespread use are Elisp, the extension language for the Emacs editor, and Autolisp, the extension language for Autodesk's AutoCAD computer-aided design tool. Although it's possible more lines of Elisp and Autolisp have been written than of any other dialect of Lisp, neither can be used outside their host application, and both are quite old-fashioned Lisps compared to either Scheme or Common Lisp. If you've used one of these dialects, prepare to hop in the Lisp time machine and jump forward several decades.
I suggest Scheme. It is fairly simple and pure-functional. CL is big, complex and harder to learn, it supports multiple paradigmas, you won't use most of it's power if you want language strictly for functional programming.
精彩评论