我应该使用 Python 还是 Ruby 来创建跨平台的编译应用程序?

发布于 2024-12-23 15:04:26 字数 434 浏览 3 评论 0原文

我是 Ruby 的粉丝,但我并不反对 Python。 (我有 2 年以上的 Ruby 经验,也许还有 2 个月的 Python 经验)。

不管怎样,我需要为 Mac 和 Windows(实际上还有 Linux)创建一个服务,从不同的目录获取某些文件并将它们发送到 S3。我可以在 Windows 上使用 .NET,但我不想使用 Objective-C,并且我希望在所有平台上保持代码库相同。

因此,经过一番研究后,我似乎应该能够将 Ruby 或 Python 编译为字节码,并分发一个解释器来运行代码。

但是,我假设 Python 对编译代码有更好的支持是错误的吗?就像 .pyc 字节码一样?

另外,我希望最终用户能够阅读我的源代码,但我不会到世界末日去尝试阻止他们。

谢谢!

I'm a fan of Ruby but I don't oppose Python. ( I have 2+ years of Ruby experience and maybe 2 months of Python ).

Anyway, I need to create a service for both the Mac and Windows (and Linux, actually) that takes certain files from different directories and sends them to S3. I could use .NET on Windows but I don't want to use Objective-C and I would love to keep my code-base the same on all platforms.

So after digging around a little, it looks like I should be able to compile either Ruby or Python to byte-code and distribute an interpreter to run the code.

But, am I wrong in assuming that Python has better support for compiling code? As in .pyc byte code?

Also, I would prefer the end user not be able to read my source code but I'm not going to the end of the world to try and stop them.

Thanks!

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

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

发布评论

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

评论(2

探春 2024-12-30 15:04:26

您确实可以分发 Python 字节码(.pyc 文件)以避免分发 Python 源代码。

根据 这个答案 ,一些 Ruby 实现也支持编译为字节码。

听起来,根据您选择的 Ruby 实现,您可能会发现使用 Python 和 Ruby 之间几乎没有什么区别。

请记住,字节码并不难反汇编,因此有动力的用户仍然能够了解有关程序内部的很多信息。使用混淆器会使对字节码进行逆向工程变得更加困难(但并非不可能)。 这个 Python 问题这个 Ruby 问题

You can indeed distribute Python bytecode (.pyc files) to avoid distributing your Python source code.

According to this answer, some Ruby implementations also support compiling to bytecode.

So it sounds like, depending on which Ruby implementation you pick, you may find very little difference between using Python and Ruby.

Keep in mind that bytecode isn't hard to disassemble, so a motivated user would still be able to find out quite a bit about your program's internals. Using an obfuscator can make it harder (but still not impossible) to reverse engineer your bytecode. This is discussed more in this Python question and this Ruby question.

知你几分 2024-12-30 15:04:26

使用您熟悉的任何语言,我知道 python 并使用它来开发 Windows 桌面应用程序,最终用户无法将其与 C# 或 C++ 应用程序区分开来

Use whatever language you know well, I know python and use that to develop windows desktop applications and end user can't distinguish it with say a C# or C++ app

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