最好的Scheme解释器或编译器是什么?

发布于 2024-08-27 00:54:51 字数 91 浏览 6 评论 0原文

大家好,我想开始使用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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

盗琴音 2024-09-03 00:54:51

对于初学者,我强烈推荐 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 with chmod +x source.rkt.

云胡 2024-09-03 00:54:51

我知道您已经接受了答案,但对于未来访问此问题的访客,我推荐鸡计划。它往往会生成比 mzscheme 小得多的可执行文件。以下面的 hello world 应用程序为例:

(define (say-hello name)
  (print (string-append "Hello, " name))
  (newline))

(say-hello "Earthling")

使用 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:

(define (say-hello name)
  (print (string-append "Hello, " name))
  (newline))

(say-hello "Earthling")

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).

ㄟ。诗瑗 2024-09-03 00:54:51

我推荐 Gambit-C 方案:

  • 它符合 R5RS。
  • 它既有解释器又有编译器。您还可以编译为 ANSI C。
  • 它是开源的。
  • 它是便携式的。 (它可以在 Linux、Windows、Mac OS X 甚至 iOS 上运行。)
  • 它具有简单的外部函数接口 (FFI)。

粗略的检查显示,Chicken 似乎并不令人满意,而 Bigloo 可能是一个有力的竞争者。但我不能对他们做太多评论。

I'd recommend Gambit-C scheme:

  • It's R5RS-conformant.
  • It has both an interpreter and a compiler. You can also compile to ANSI C.
  • It's open source.
  • It's portable. (It runs on Linux, Windows, Mac OS X and even iOS.)
  • It has simple foreign function interfaces (FFI).

A cursory examination reveals that Chicken seems unsatisfactory, while Bigloo may be a serious contender. But I cannot comment too much about them.

Smile简单爱 2024-09-03 00:54:51

我建议不要关心它是作为编译器、解释器还是它们的组合来实现的——尤其是从一开始,帮助文件的质量(例如)比它的具体实现方式更重要。

就哪一个而言,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.

溇涏 2024-09-03 00:54:51

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文