最好的Scheme解释器或编译器是什么?
大家好,我想开始使用Scheme,有两个问题。首先,您会建议使用Scheme 的解释器或编译器吗?为什么?其次,您会推荐哪种Scheme 解释器或编译器,为什么?谢谢!
Hey everyone, I want to start using Scheme and I have two questions. First, would you recommend using an interpreter or a compiler for Scheme and why? Second, which interpreter or compiler for Scheme would you recommend and why? Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
对于初学者,我强烈推荐 DrRacket (以前称为 Dr.Scheme),因为它为您提供了一个非常好的工作环境,支持多种方案方言,并提供非常好的故障和调试信息。我相信大多数Scheme 的实现都是解释器,尽管可能有一个编译器。
如果您像我一样是命令行迷,您可能会考虑的另一种选择是直接运行 racket 解释器,这本质上是与 Dr. Racket 相同,但没有图形环境和命令行界面。或者,以
#! 开头您的源文件/usr/bin/envracket
并使用 chmod +x source.rkt 使其可执行。For a beginner, I would highly recommend DrRacket (formerly Dr. Scheme), since it gives you a really nice environment to work in, supports many dialects of Scheme, and gives very good failure and debugging information. I believe most implementations of Scheme are interpreters, although it is possible that there is a compiler out there.
If you are a commandline junkie like me, an alternative you might consider is to run the racket interpreter directly, which is essentially the same thing as Dr. Racket, but without the graphical environment and a commandline interface. Or, start your source file with
#! /usr/bin/env racket
and make it executable withchmod +x source.rkt
.我知道您已经接受了答案,但对于未来访问此问题的访客,我推荐鸡计划。它往往会生成比 mzscheme 小得多的可执行文件。以下面的 hello world 应用程序为例:
使用 mzc --exec mztest hello.scm 编译:3.3M
使用 csc hello.scm -o ctest: 16k 编译
如果您需要库支持,Chicken 提供 Eggs Unlimited,就像 mzscheme 的 PlaneT(或者 ruby 的 gems)。
I know you already accepted the answer, but for future visitors to this question, I recommend Chicken Scheme. It tends to produce much smaller executables than mzscheme does. Take the following hello world application, for instance:
Compiled with mzc --exec mztest hello.scm: 3.3M
Compiled with csc hello.scm -o ctest: 16k
And if you're after library support, Chicken provides Eggs Unlimited, which is like PlaneT for mzscheme (or gems for ruby).
我推荐 Gambit-C 方案:
粗略的检查显示,Chicken 似乎并不令人满意,而 Bigloo 可能是一个有力的竞争者。但我不能对他们做太多评论。
I'd recommend Gambit-C scheme:
A cursory examination reveals that Chicken seems unsatisfactory, while Bigloo may be a serious contender. But I cannot comment too much about them.
我建议不要关心它是作为编译器、解释器还是它们的组合来实现的——尤其是从一开始,帮助文件的质量(例如)比它的具体实现方式更重要。
就哪一个而言,DrRacket 是我(到目前为止)最常使用的。
I'd recommend not being concerned about whether it's implemented as a compiler, interpreter, or combination thereof -- especially to start with, the quality of help files (for one example) will matter far more than exactly how it's implemented.
As far as which one, DrRacket is what I use (by far) the most often.
PTL Scheme 已更名为 Racket (http://racket-lang.org/),但它仍然很漂亮大致相同。 Dr. Racket 是一个非常漂亮的带有 shell 的开发环境,要在 Scheme 中编写,您只需要在文件顶部添加
#lang schema
即可。PTL Scheme has been renamed to Racket (http://racket-lang.org/), but it's still pretty much the same. Dr. Racket is a very nifty development environment with a shell, and to write in Scheme all you need is
#lang scheme
at the top of your file.