我应该学习哪种 Lisp?
我应该学习哪种 Lisp(方言),为什么?
CL 和Scheme 之间的碎片化减慢了吸收速度(至少对我来说是这样!)。
所以,请给我“真实答案”!
我尝试阅读功能比较,但它们似乎陷入了深奥(我不完全理解)的困境,比如方言是否完全尾递归等等。 我希望你们(集体)能够澄清不透明的差异。
我喜欢的东西
良好的库支持、良好的环境和 Unicode 支持。
我不喜欢
火焰战争的东西。 刚开始有用但会干扰长期学习的功能。
更新
我主要使用 MzScheme,一旦我获得了 readline 支持,我就很喜欢它。 我不在 Unix 上运行 GUI,所以它对我来说似乎是一个很好的环境选择。
我也很高兴 Clojure 在 debian 上有一个易于安装的 .deb 包,因此使用起来更容易。 这是一个巨大的胜利。 尽管下面有一些很容易生气的敌意,但低进入门槛是一个胜利。 我喜欢被填鸭式喂养。
在阅读了更多的SICP之后,我确实更好地理解了尾递归的问题。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(17)
Clojure 是一种积极开发的现代 Lisp 方言。 它基于 JVM,因此所有 Java 库都可以立即使用,因此还具有 Unicode 支持。
这是一种选择,而不是唯一的正确答案。
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.
如果您想避免争论并且喜欢库,请选择 Clojure。 它很小,速度很快,而且社区很有帮助而且不教条。 它是去掉了 20 世纪 80 年代荒谬的缺陷的 Lisp。 它有 BDFL,如果你有一个好主意,那么它很有可能会被实现到该语言中。
我尝试过 Common Lisp,它是一件美妙的事情。 我已经完成了 DrScheme 中 SICP 的前 3 章和 Metacircular Evaluator,这也是一件美妙的事情。 当然,学习这些你会受益匪浅。
但是,随着时间的推移,我开始珍视小语种。 我不会撒谎,我喜欢 Javascript,也喜欢 C(天哪,如果每种语言的核心都没有 C 核心),因为它们很小。
Clojure 很小。 它很优雅。 这是我们这个时代的语言。
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.
只需选择一个,然后学习它。 当你弄清楚差异时,如果你第一次选择得很糟糕,你就可以再次选择。
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.
相反 Chuck,Common Lisp 的一个优点是它有一个实现坚持并努力追求的标准,这样你就可以使用 SBCL(它具有出色的类型检查和推理)进行大量开发,然后部署为链接到的可执行文件C 库(使用 ECL 或其他)或使用 Java 库(使用 ABCL)的 .jar,或者使用 Mac 或 Windows 本地 GUI(Clozure,两者)。 Common Lisp 具有惊人的跨架构、跨实现、跨时间的可移植性,并且 Common Lispers 在该语言的支持下努力保持这种方式。 作为一个例子,非标准化行为的一个愚蠢的分歧是“这是一个特殊变量吗?”的问题。 所以我在我使用的实现中回答了这个问题:
在读取时,ABCL 上什么都没有(它已经有这个了),到
(defunspecial-variable-p (symbol) (si:specialp symbol))< ECL 上的 /code> 等等。 所以我可以将其放入我的 .rc 文件中并在 REPL 中使用通用函数。 但这并不是很重要:这不是 线程 或 各种支持的网络 或 通信顺序进程库。 最后一个示例只有一个
#+sbcl/#-sbcl
,即使它在五个实现上运行。 因为它依赖于经过精心移植的代码。但这种(和其他)优势的来源也给学习者带来了挑战:Common Lisp 是一门非常大的语言。 它不是你可以在一两周内掌握的东西,就像我对 Clojure 所做的那样(但我的 Clojure 已经随着即将推出的重大更改而衰退 - 这种语言虽然有其自身的优点,但通过对比提醒我很多我喜欢 Common Lisp 的地方。)所以你应该阅读很多这个页面,并保留只需按一下键即可获得 HyperSpec(对我来说,
Mx hyperspec RET do-symbols RET
就足够接近圣经了。),并考虑购买几本书。 我有实用Common Lisp,刚刚得到出租 Lambda,并将购买 PAIP 真实的很快。但即使 Common Lisp 是正确答案,你也不会通过“仅仅选择”一些具有欺骗性的华而不实的替代方案来完全浪费时间(--“具有欺骗性”,因为普通的 CL 并没有向你展示所有这些)它的宏可以做到这一点,而且它的宏类型比任何人都多。通常的比较是在坏的 CL 和坏的 CL 之间。语法优化的替代方案 X)。 您仍然会学习基础知识,仍然可以使用 SICP、On Lisp、小阴谋家等。 lisp,即使是错误的 lisp,仍然比非 lisp 好。 (但是你会花一些时间在错误的 lisp 中实现正确的 lisp 的部分内容,但很糟糕。Meta-Greenspun。)
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:
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.)
Clojure 是一种很棒的 LISP 方言,可促进函数式编程。 它在 JVM 上运行,因此您可以访问您可能习惯使用的任何 Java 库。 该网站有很棒的文档和截屏视频来帮助您学习。 另一个优点是它非常容易安装,与许多其他方言不同。
如果您只是想了解概念Emacs (EmacsLISP具体来说)是另一种选择。 它附带了令人难以置信的文档、教程和大量代码示例。 截屏视频也很容易找到。 Emacs 的一大好处就是编辑器是用 LISP 编写的,所以编辑器自然对 LISP 的运行、编辑和调试有很好的支持。 此外,您可以扩展编辑器,以便在您学习 LISP 的同时,使您的日常文本编辑需求变得更加轻松。。
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.
Lisp 最大的问题是没有一个所有人都遵守的压倒一切的标准。 您不仅需要在 Common Lisp 和 Scheme 之间进行选择; 你必须在 Common Lisp 的几个不兼容的实现和 Scheme 的几个不兼容的实现以及 Arc 和 Clojure 等其他小东西之间进行选择。
我建议从 MzScheme 开始。 它很受欢迎,得到了积极的开发,它有许多提供现代编程环境功能的库,而且Scheme 比 Common Lisp 更简单(不是说更好,只是更简单)。
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.
学习 elisp,以便您可以扩展 Emacs。
Learn elisp so you can extend Emacs.
使用 Clojure。 它是一种令人惊叹的语言,可以完全访问任何 Java 库。 它已经开发了两年多,并且已经有 3 个 IDE 插件正在开发中,并且四月份出版了一本关于它的书。 它非常快,非常优雅和美丽。 使用 Clojure 不会出错。
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.
对我来说,Scheme 的基础理论更有说服力。 PLTScheme(现在称为 Racket)是迄今为止我发现的开发最活跃的 LISP。 不幸的是,它的打字方式激增,掩盖了 Lisp 的美丽。
我很乐意看到像 arc 这样的东西成功,但这似乎不太可能。
For me, the foundational theory of Scheme is far more convincing. PLTScheme (now called Racket) 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.
查看 IronScheme。
Take a look at IronScheme.
推测:当学习你的第一个 lisp 时,不要学习你最终将用于最终开发的那个。
引理:学习 Arc。 这是 lisp 中所有“难以理解”的东西——闭包、宏、延续,没有 Clojure 的 Java 互操作复杂性、CL 的名称空间混乱或Scheme 的名称碎片。 如果你专注,你可以在一个周末学到所有这些东西。 如果你敏锐且专注,在一夜之间。
而且它会让学习所有其他 Lisp 变得更加容易。
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.
我不了解 Lisp,但这就是为什么我认为 PLT 方案(现在称为 Racket)是一个不错的选择:
非常好的文档
http://download.plt-scheme.org/doc/html/< /p>
DrScheme 是一个令人惊叹的编程环境,带有编译器、步进器、语法检查器、REPL、多种语言支持并且是可扩展的。 这使得整个体验变得有趣。 查看一些屏幕截图
来自社区的良好支持。
社区对他们的语言非常热情,也非常支持。 如果您有任何疑问,可以使用邮件列表、群组和论坛。 即使是作者也非常平易近人。
持续研究
PLT 非常活跃,并不断使他们的工具变得越来越好。 您可以期待实验室带来很多创新。 例如。 我对使用这个感到非常兴奋:http://blog.plt -scheme.org/2009/05/typed-scheme-20.html
免费书籍和有趣的教程帮助您入门。
http://www.htdp.org/
http://world.cs.brown.edu/
良好的模块和广泛的库。
http://www.cs.utah.edu/plt/develop/< br>
http://planet.plt-scheme.org/
另请参阅文档
如果您正在学习Scheme,请提供DrScheme 尝试一下。
I do not know Lisp but here's why I think PLT Scheme (now called Racket) 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.
你知道……当我对 Lisp 感兴趣时,我也认为我必须做出选择。 然后,在阅读和询问了很多之后,我最终选择了 Common Lisp。 并不是因为它绝对比Scheme“更好”,而是因为它具有我知道我可能会在未来2-3年的项目中使用的功能:
所以,如果我是你,我会开始学习每种语言的一点点,并找出每种语言的相对优势和劣势(我的意思是,那些与你的内容相关的优势和劣势)我最需要/最想做的事)这样你我就可以选择一个。 你可能会发现你稍后也会学习另一个(发生在我身上——我在学习 Common Lisp 一年后必须学习更多的Scheme)
至于 Arc、Clojure 和 Lush,而且不知道那些。 我想同样的论点也适用于它们......我不想在它们上投入太多的原因是:Arc 似乎对数值计算不感兴趣,而 P. Graham 似乎对代码大小很着迷(到使他的代码不可读); Clojure 看起来不错,但我不喜欢 JVM。 Lush...好吧,除了使用动态作用域之外,该语言的编译版本和解释版本非常不同——而且您无法编译递归函数。 所以,对我来说,要么是Scheme,要么是Common Lisp。
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:
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.
选择除 Clojure 以外的任何选项,然后使用它,这样您以后就能更好地进行评估。
您将这个问题表述为 Lisp 是学习 Lisp 的最佳媒介,对我来说,它必须包括由低级原语构建的 Lisp,而 Clojure 的大部分是用 Java 编写的。
如果您将这个问题表述为启动新项目的最佳 Lisp 是哪一个,那么 Clojure 可能是最佳选择。
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.
我想你要么想要 Common Lisp,要么想要 PLT 方案(现在称为 Racket)。
前者具有很大的自由度和功能(一开始可能会让您不知所措),而后者则提供了一堆库、匹配的教程和一个集成良好的 IDE。
I think you either want Common Lisp or PLT Scheme (now called Racket).
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.
我是Scheme的粉丝,但我已经有10多年没有用Scheme做过任何事情了。
就像其他人所说的那样 - 选择一个然后就可以了。
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.
真正的选择很少,要么是 SBCL、Clojure,要么是 PLTScheme。
There are very few real choices there, either SBCL, Clojure or PLTScheme.