TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Scheme vs Common Lisp

15 点作者 qwph超过 16 年前

4 条评论

herdrick超过 16 年前
This is oddly over-critical of Scheme.<p>Macros: All the main Scheme implementations offer Common Lisp style macros, so in Scheme you can use either style. (Good thing, because I like the Common Lisp style.)<p>The section on numeric types is a long-winded and bizarrely negative-sounding way to say that Scheme wins. "In a good implementation, numerics (capabilities and correctness) are better than most CLs; on average, they are worse." Ok... why would you use a bad implementation?<p>As for Common Lisp having a well-defined module system consistent across implementations... that was not my experience. I was very irritated by that stuff when going through Peter Seibel's "Practical Common Lisp" book, as the book used different terminology than the implementation of CL I had.<p>I guess it's still true that Common Lisp has better libraries, but Scheme has sure been doing well there lately.<p>This is not to say that I don't like Common Lisp. In fact there are a lot of things about it that I wish I had in Scheme.
评论 #312559 未加载
harshavr超过 16 年前
On the whole macro debate, whatever one thinks the default behavior should be with respect to variable capture, the syntax-case macro system in scheme works on a representation of program code which is at a higher resolution than what lisp macros works on.<p>The macro can find out for instance, if an identifier used in its input is a free-variable, or if two identifiers share the same binding. Hence, it is possible to write a relatively short program to define defmacro in terms of define-syntax &#38; syntax-case, but not the other way round. (a pretty short implementation &#38; most of it is error checking - <a href="http://svn.plt-scheme.org/plt/trunk/collects/mzlib/defmacro.ss" rel="nofollow">http://svn.plt-scheme.org/plt/trunk/collects/mzlib/defmacro....</a>)<p>This also strikes me as a inconsistency in arc(albeit easily correctable), as it goes against the rule of not imposing restrictions on the user, by default. Even, if the default macro interface is something simple, the user should be able to write macros which work with syntax at a higher resolution if needed.<p>Also, if you use the most popular distribution, PLT scheme, you have all of reader macros, native hash tables, keyword arguments, a package repository. There is a really nice module system, along with other neat stuff like contracts, lazy modules, frp &#38; of course the continuation based web-server. For OOP, there is Swindle, an analog of CLOS(not having used it, i don't know if it's just as good).<p>After R6Rs, there is a common module system and standard libraries for hash-tables even in the scheme spec.<p>The main flaw, it seems, is the relative lack of libraries as compared to other mainstream languages. In particular, what i miss is something like wxPython for scheme.<p>EDIT : turns out i spoke too soon, defmacro does have an environment object(<a href="http://www.lispworks.com/documentation/HyperSpec/Body/03_aad.htm" rel="nofollow">http://www.lispworks.com/documentation/HyperSpec/Body/03_aad...</a>) as a parameter, so it has some access to lexical info of its input form. To implement define-syntax, one would also need some way to output a syntax object and not just a s-expr. Couldn't find any defmacro implementation of define-syntax on the net.
kylec超过 16 年前
I'd like to see this updated for R6RS. There are several deficiencies of Scheme (like a module system) addressed in the new standard.
rw超过 16 年前
This gets posted here every few weeks...