Perl 的 C 翻译后端有什么用?

发布于 2024-10-01 15:55:53 字数 78 浏览 0 评论 0原文

除了纯粹明显的:“它将 Perl 翻译为 C。”; Perl 编译器的优化 C 翻译后端 B::CC 在现实世界中是否有任何用途(又名黑客)?

Other than the purely obvious: "It translates Perl to C."; are there any real world uses (a.k.a. hacks) for the Perl compiler's optimized C translation backend, B::CC?

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

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

发布评论

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

评论(2

指尖上得阳光 2024-10-08 15:55:53

并不真地。这意味着您可以将(小)Perl 脚本转换为(大)C 程序,这对于接收者来说将更难进行逆向工程。在某些偏执的圈子里,这可能被认为是一种优势(例如,如果您的 Perl 代码糟糕得令人尴尬,而您宁愿向付费客户隐瞒这一事实)。但大多数情况下它仅限于负值。

Not really. It means you can convert a (small) Perl script into a (big) C program, which will be much harder for the recipient to reverse engineer. In some paranoid circles, this might be accounted an advantage (for example, if your Perl code is embarrassingly bad and you'd rather conceal that fact from your paying customers). But mostly it is of limited to negative value.

沉鱼一梦 2024-10-08 15:55:53

将 Perl 程序编译为 Optree,然后可以执行,有时可能需要一段时间。您可以通过将 perlcc 与其任何后端一起使用来节省一些时间。这将以一种或另一种方式序列化已编译的 optree,并在稍后执行已编译的二进制文件时加载它,速度会更快一些。我可以看到它在例如 CGI 环境中很有用,但是对于这些环境,可以使用更好的替代方案来避免启动成本。

与流行的看法相反,perlcc 并不会让对生成的二进制文件进行逆向工程变得非常困难,如 如何对使用 perlcc 编译的 Perl 程序进行逆向工程?

Compiling a Perl program to an optree, which can then be executed, can take a while sometimes. You can safe some of that time by using perlcc with any of its backends. That'll, in one way or another, serialise the compiled optree and make loading it later, when executing your compiled binary, somewhat faster. I can see that being useful in, for example, CGI environments, for which, however, much better alternatives of avoiding startup costs are available.

Contrary to popular believe, perlcc doesn't make it very hard to reverse-engineer the resulting binary, as discussed in How can I reverse-engineer a Perl program that has been compiled with perlcc?

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