4 ms·
I AM a Python beginner, and I was amazed recently to discover that there was no way for me to assemble an executable for an OS I'm not on that didn't involve bu
by thenomad 9y ago
I AM a Python beginner, and I was amazed recently to discover that there was no way for me to assemble an executable for an OS I'm not on that didn't involve buying a computer running said OS.
I'm on Win10, and pyinstaller made it easy to create an .exe for Windows, but I could find no way on Earth to assemble an executable for Mac.
As it happened I just asked a tech-savvy colleague on a Mac to use pyinstaller on their machine, and it worked, but still - I'm really impressed with Python generally, but this seems like a surprising and considerable oversight.
- scriptkiddy 9y agoTo be fair, Python programs aren't really designed to be compiled into a single executable. They are designed to be run through an interpreter. Therefore, multi-target compiling isn't really something the core developers focus on. The fact that you were unable to compile for multiple sources is more a failing of whatever third-party tool you were using.
- thenomad 9y agoMakes perfect sense, yes. And that's what I use Python for 99% of the time. I just thought it was interesting quite how hard it turned out to be! As someone who's usually on the games/VR side of things, I may have taken some of the magic that Unity, for example, uses to compile to all sorts of platforms for granted.
- scriptkiddy 9y agoIf your into building games and want a language that can easily cross-compile to multiple platforms, you may want to take a look at Nim: https://nim-lang.org https://nim-lang.org. You'll get better performance than with Python as well. It's definitely a little less intuitive than Unity although.
- pmoriarty 9y agoNot disagreeing with your main point, but it has historically been possible to run Mac OS in a VM. It might take some tinkering that is definitely not as straightforward and easy as some other OS's, and you might be breaking Apple's Terms of Service which require Mac OS to run only on Apple hardware, but it was usually possible. Other operating systems apart from Mac OS should be much easier to run in a VM, and where they're not, I'd blame that more on the creators of the OS's themselves rather than on Python.
- thenomad 9y agoAh, interesting. I did think of using a VM but my understanding was that Mac OS VMs were an absolute pain in the ass to set up ;)
- coldtea 9y ago>I AM a Python beginner, and I was amazed recently to discover that there was no way for me to assemble an executable for an OS I'm not on that didn't involve buying a computer running said OS. Are you a beginner in general maybe? Because that's either arcane, damn difficult to setup or nigh impossible in tons of other languages too -- even ones that actually do produce executables to work (which Python by default does not). (And of course you can always just create the executable on a vm -- no need to buy a computer running the other OS).
- thenomad 9y ago20+ years of working in the tech industry and adjacent, so not so much, no. But my work has, until this year, rarely involved compiling software for other people to use. So that may be the noobness you're detecting.
- coldtea 9y agoBasically, why I asked, is because you seemed to imply that you expected that cross compiling would be easy. Whereas, from my experience, it's usually a pain in the ass to set up.
- KirinDave 9y agoThis is one of the reasons golang has a growing share of popularity right now, a lot of people want to hit the linux compile target without a VM. But hey, you can use VMs to hit a lot of these targets.