Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Should I use Python or Ruby for creating a cross-platform, compiled application? [closed]

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!

like image 573
cbmeeks Avatar asked Jan 24 '26 12:01

cbmeeks


1 Answers

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.

like image 115
Josh Kelley Avatar answered Jan 26 '26 01:01

Josh Kelley