如何分发用解释性语言构建的项目?
我已经用解释语言(Tcl/Tk)启动了一个项目(开发人员文本编辑器),另一个用 Perl(两者都是开源的),但是随着时间的推移,当它进入 Beta 版本时,我将需要分发它是为用户(当然是开发人员)提供的,但我想知道一些关于此的事情:
- 可以将其编译为可执行文件吗?
- 如何?
- 我可以针对其他平台进行编译吗?
- 或者在这种情况下,使用编译语言或解释语言更好?
- 平常的事情都是这样吗?
- 在用户的机器上,他需要有Tcl/Tk还是Perl?
I've started a project(developer text editor) in a interpreted language(Tcl/Tk) and another with Perl(both are open-source), but with some time, when it gets in a Beta version, I will need to distribute it for the users(developers of course), but I want to know some things about this:
- It's possible to compile it to a executable?
- How?
- Can I compile for other platforms?
- Or in this case it's better to use a compiled language or a interpreted?
- Is usual things like this?
- In the users machine, he will need to have Tcl/Tk or Perl?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
Tcl 和 Perl 都可以编译成可执行文件。对于 Windows,有用于运行 UNIX 风格操作系统的系统的 perl2exe 和 perlcc。至于Tcl,有freewrap和starpacks。
如果您这样做只是为了单个可执行文件的利益,并消除安装 Perl 和其他依赖项的需要,那么没有真正的理由您不能这样做。这是一种非常好的测试应用程序的方法,无需不断编译,尽管首先就违背了使用解释性语言的目的。
另请查看最简单的步骤将 TCL TK 转换为独立应用程序,此页面也很有用,如何编译 Tcl 类型脚本转换为二进制代码
Both Tcl and Perl can be compiled into executables. For windows, there's perl2exe and perlcc for systems running UNIX style operating systems. As for Tcl, there is freewrap and starpacks.
If you're just doing this for the benefit of a single executable, and eliminating the need for installing Perl and other dependencies, then there's no real reason you can't do this. It's quite a nice method for testing your application without having to constantly compile, though defeats the point of using an interpreted language in the first place.
Also take a look at The Simplest Steps to Converting TCL TK to a Stand Alone Application, this page is also useful, How can I compile Tcl type scripts into binary code
此类脚本的常用方法是分发源代码。二进制文件只能在某些非常特定的系统上运行,但 Tcl/Tk/Perl 可以在如此多的系统上运行,因此这将是一个非常大的限制,没有真正的原因。它还可以帮助其他开发人员以某种好的方式重用您的脚本。在大多数情况下,即使有人可以执行您的二进制文件,如果没有源代码,它也没有多大帮助。
The usual and common way for such scripts is to distribute the source. A binary would only work on some very specific systems but Tcl/Tk/Perl runs on so many systems, so that would be a really big restriction for no real reason. It also helps other developers more to reuse your scripts in some good way. In most cases, even when somebody could execute your binary, it wouldn't be of much help without the source.