是否有一些小型 Perl 可以在大小很重要的嵌入式系统中使用?

发布于 2024-08-25 10:02:47 字数 38 浏览 4 评论 0原文

是否有一些小型 Perl 可以在大小很重要的嵌入式系统中使用?

Is there some tiny perl that I can use in embedded system where the size would matter?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(3

念三年u 2024-09-01 10:02:47

请参阅 Simon Cozens 关于 Microperl 的文章。

microperl 是一个真正的、诚实的 Perl 解释器; Perl 语言的核心元素没有被删除。正则表达式引擎完全相同,语言完全相同,具有相同的 Unicode 支持,等等。唯一被删除的是完全特定于系统的函数,例如 crypt 和 readdir。

另请参阅 README.micro

microperl 应该是一个真正最小的 Perl,甚至更多
miniperl 最小。构建 microperl 不需要配置,
另一方面,这意味着 Perl 和你的程序之间的接口
操作系统保留得非常少。

所有这些都是实验性的。如果您不知道如何使用 microperl
你可能不应该。不要报告 microperl 中的错误;修复错误。

根据大小限制,您可能不需要走那么远,只需使用 miniperl(它是在编译 perl 的过程中构建的)就足够了。

See Simon Cozens' article on Microperl.

microperl is a real, honest-to-goodness Perl interpreter; no core elements of the Perl language have been removed. The regular expression engine is exactly the same, the language is exactly the same, it has the same Unicode support, and so on. The only things that have been removed from it are functions that are completely system-specific, like crypt and readdir.

See also README.micro:

microperl is supposed to be a really minimal perl, even more
minimal than miniperl. No Configure is needed to build microperl,
on the other hand this means that interfaces between Perl and your
operating system are left very -- minimal.

All this is experimental. If you don't know what to do with microperl
you probably shouldn't. Do not report bugs in microperl; fix the bugs.

Depending on size constraints, you may not need to go that far, just using miniperl —which is built in the process of compiling perl— might be enough.

怀念你的温柔 2024-09-01 10:02:47

不想这么说,我可能会得到很多反对票,但是...

如果大小是一个问题,请选择 C。如果您想要 Perl 的特定功能,您会发现一个 C 库,通过一些搜索可以给出你类似的功能。

如果需要简单的脚本能力和快速周转,您可能应该获得能够运行 perl 的更大的 CPU 或尝试占用空间较小的语言,例如 Lua

Hate to say it and I will probability get lots of down votes but ...

If size is a problem go with C. If there is a specific functionality you want from perl you will find a C library with a bit of searching that will give you similar functionality.

If easy script-ability and quick turn around is required may be you should get a larger CPU able to run perl or try a language with a smaller footprint like Lua.

寻梦旅人 2024-09-01 10:02:47

现代 Perl 是一种用于快速创建问题解决方案的出色语言。
然而,它并不完全很小。

Perl 的早期版本有点小……谷歌搜索“16 位 perl”显示一些疯狂的人设法获得了 perl 版本 3 和 4 来编译 16 位 dos。

Perl 4 的源代码仍然在网络上流传,如果您确实需要,您可能可以重新创建那些人的工作,并使 Perl 在新的 16 位嵌入式系统上运行。

然而,这种古老的语言和现代 Perl 之间存在足够的差异,因此不值得这么麻烦。最明显的区别是包分隔符是 ' 而不是 :: ,除此之外还有更多区别。

我建议不要乱搞像 perl4 这样古老而神秘的东西,我建议只用现代 perl(最新版​​本 5.22)编写程序,然后用可移植的 C 或 C++ 重写它,并将其交叉编译到您的嵌入式系统。

我意识到原来的问题有点老了,但我想我应该为其他考虑在嵌入式系统上运行 perl 的人提供一个扩展的答案。

Modern Perl is a fantastic language for quickly creating solutions to problems.
However, it's not precisely tiny.

The earlier versions of perl were a bit smaller ... googling for "16 bit perl" shows that some crazy people managed to get versions 3 and 4 of perl to compile for 16 bit dos.

The source for perl 4 is still floating around the web, and if you really really needed to, you could probably recreate the work of those people, and make perl run on a new 16 bit embedded system.

However, there are enough differences between that ancient language and modern perl to make it not worth the trouble. The most visible difference is that the package separator was ' instead of :: , and there are many more differences besides that.

Instead of messing around with something as ancient and arcane as perl4, I would suggest just writing your program in modern perl (version 5.22 is the latest), and then rewrite it in portable C or C++ , and cross compile it to your embedded system.

I realize that the original question is a bit old, but I figured I'd provide an expanded answer for others considering running perl on embedded systems.

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