Skip to main content
gamedev.net
🔒 Locked

Python -> Native

Started by daerid 4 replies 200+ views
Original Post
daerid
daerid
Is there a compiler that can convert interpreted python code to native x86 code? I haven''t been able to find one, but that would be really nice to have
daerid@gmail.com
SabreMan
SabreMan
You could check out the Python distutils and py2exe (sorry don''t have the links to hand but very easy to find on Google). A word of warning though: by the very dynamic nature of Python it is necessary to always have the runtime available, even when distributing in exe format. This means any binary distribution of a Python application will have the Python runtime concealed somewhere about its person. If it''s a statically linked version of the runtime, you will be distributing as many versions of the runtime as you are packaged scripts. I strongly recommend you to review other means of distribution before deciding py2exe is the way to go.
daerid
daerid
cool, thanks for the info and suggestions!
daerid@gmail.com
Viro
Viro
Is it safe to assume that its just like java?
"Linux is not about free software, it is about community," -- Steve Balmer, Microsoft Chief Executive.
mutex
mutex
Python code is not compiled to native x86, even with py2exe. All py2exe does is embed the compiled Python bytecode inside an exe that also contains the Python interpreter. As far as I know, a Python to x86 compiler does not exist. All Python code is interpreted. A JIT compiler doesn''t exist either (I think).

SabreMan
SabreMan
quote:
Original post by Viro
Is it safe to assume that its just like java?

It''s never safe to assume that anything other than yer Dad is like Java.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.