(sys-admin) shell 脚本的最佳方案实现是什么?
我已经阅读了学术计划的内容(阅读 SICP、The Little计划者、经验丰富的计划者、TSPL),并且将计划作为玩具玩了一段时间。
但我想变得实用。 今天我需要编写一个shell脚本来进行一些批处理文件处理,并想“为什么不在Scheme中这样做呢?”。我做到了,这是一种快乐。
现在我不得不想知道 shell 脚本类型的最佳实现是什么。 我知道所有实现都在 R5RS 之外的实现方面有所不同。 (基本上,它们在脚本语言中所需的所有有用且实用的扩展方面有所不同)。
所以我想选择一种实现并坚持下去。我正在寻找以下东西:
- 跨平台(Linux、OS X、Windows)。
- 具有在日常 shell 脚本编写中有用的扩展,这些扩展是基本安装的一部分。
- 易于安装。 (例如,有许多预构建的二进制文件,和/或它是许多发行版上的标准包。)
- 正在积极开发,有一个活跃的社区。
- 有 Unicode 支持。
到目前为止我一直在使用Gambit。似乎满足上述约束条件。 PLT 似乎有点矫枉过正。想知道 Guile、MIT/GNU 等。
I've gone through the academic Scheme stuff (read SICP, The Little Schemer, The Seasoned Schemer, TSPL) and been playing with Scheme as a toy for a while.
But I want to get practical.
Today I needed to write a shell script to do some batch file processing, and thought "why not do it in Scheme?". I did, and it was a joy.
Now I'm forced to wonder what the best implementation is for shell script type stuff.
I know all implementations differ in terms of what they implement beyond R5RS. (Basically, they differ in all the useful and practical extensions you'd want in a scripting language).
So I'd like to pick one implementation and stick to it. I'm looking for something that:
- Is cross platform (Linux, OS X, Windows).
- Has extensions that are useful in day-to-day shell scripting, and those extensions are part of the base install.
- Is easy to install. (e.g. there are a number of pre-built binaries, and/or it is a standard package on many distros.)
- Is actively developed, with an active community.
- Has Unicode support.
I've been using Gambit so far. It seems to satisfy the above constraints. PLT seems like overkill. Wondering about Guile, MIT/GNU, etc.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
PLT 方案满足您的所有标准。既然看起来您已经知道了,您应该使用 MzScheme 包。 MzScheme 是所有 PLT 构建于其之上的运行时。
如果您要下载完整的 PLT 方案安装,它看起来会很大,因为除了运行时之外,它还包含大量文档和 IDE。
PLT Scheme meets all of your criteria. Since it looks like you know that already, you should to use the MzScheme package. MzScheme is the runtime on top of which all of PLT is built.
If you were to download the full PLT Scheme install it would seem large as it includes a lot of documentation and an IDE in addition to the runtime.
您听说过 scsh 吗?我没用过,但听起来很像你想要的。
Have you heard of scsh? I haven't used it, but it sounds a lot like what you want.
我推荐 Gauche,即:
Cygwin 和其他一些 类 UNIX
平台,
符合 POSIX 标准的系统库和
有用的模块,例如
网络协议、文件系统、
DBM、多线程等...
(或者只是说
configure
、make
和make install
),I recommend Gauche, which is:
Cygwin and some other UNIX-like
platforms,
POSIX-compliant system libraries and
useful modules such as
network protocols, file system,
DBM, multithreading, etc...
(or just say
configure
,make
andmake install
),