473,480 Members | 4,939 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Compiler

Hi folks,

Just curious, is there a python compiler?
Or something that creates bytecode, like java?

Regards,

Steven
Jul 18 '05 #1
5 1655
Steven wrote:
Just curious, is there a python compiler?
Or something that creates bytecode, like java?


Yes. They are the same thing. Javac compiles Java source
to Java bytecode. C compilers compile C source to
machine-specific bytecode (called machine code). Python
compiles Python source to Python bytecode. The main
difference is that Python does this transparently behind
your back whenever the source has change, while many other
languages that do it require a separate manual step...

-Peter
Jul 18 '05 #2
Peter Hansen wrote:
Steven wrote:
Just curious, is there a python compiler?
Or something that creates bytecode, like java?

Yes. They are the same thing. Javac compiles Java source
to Java bytecode. C compilers compile C source to
machine-specific bytecode (called machine code). Python
compiles Python source to Python bytecode. The main
difference is that Python does this transparently behind
your back whenever the source has change, while many other
languages that do it require a separate manual step...

-Peter


hi,

i was wondering just how different is the python bytecode from the java
bytecode? is there a specification for python virtual machine or sort? i
can foresee a lot of interesting projects and uses that can stem from
this specification.

maurice
Jul 18 '05 #3

"Maurice LING" <ma*********@acm.org> wrote in message
news:40********@news.unimelb.edu.au...
i was wondering just how different is the python bytecode from the java
For Jython, 'python bytecode' is jave bytecode.

bytecode? is there a specification for python virtual machine or sort?


For CPython, see the documentation for the CPython-specific dis (assembly)
module. Note that the details are x.y version specific, subject to change,
and not part of the language specification. For 'interesting projects'
that have been posted, try googling for Python bytecode hacks.

Terry J. Reedy


Jul 18 '05 #4

You can do this:

python -c "import py_compile; py_compile.compile( \"foo.py\", \"foo.pyc\" )"

...which will create foo.pyc *only*, and will not compile any other
..py files imported by foo.py.

Steven wrote:
Hi folks,

Just curious, is there a python compiler?
Or something that creates bytecode, like java?

Regards,

Steven


Jul 18 '05 #5
Maurice LING wrote:
i was wondering just how different is the python bytecode from the java
bytecode? is there a specification for python virtual machine or sort? i
can foresee a lot of interesting projects and uses that can stem from
this specification.


I recommend reading all the posts in this earlier thread:

http://groups.google.com/groups?th=f20ad34ef1157bcb

It largely overlaps with what you are thinking and what your next
questions would be :-)

Roger
Jul 18 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
2306
by: Jeff Epler | last post by:
Hello. Recently, Generator Comprehensions were mentioned again on python-list. I have written an implementation for the compiler module. To try it out, however, you must be able to rebuild...
13
2535
by: Bryan Parkoff | last post by:
You may notice that switch (...) is much faster than function that can gain a big improved performance because it only use JMP instruction however function is required to use CALL, PUSH, and POP...
10
2529
by: Bjorn | last post by:
I'm using interfaces in C++ by declaring classes with only pure virtual methods. If then someone wants to implement the interface they needs to inherit from the class. If the implementing class...
7
3088
by: Tao Wang | last post by:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi, I saw cuj's conformance roundup, but the result is quite old. I think many people like me want to know newer c++ standard conformance test...
14
3097
by: joshc | last post by:
I'm writing some C to be used in an embedded environment and the code needs to be optimized. I have a question about optimizing compilers in general. I'm using GCC for the workstation and Diab...
16
2827
by: pj | last post by:
(Was originally, probably wrongly, posted to the vc subgroup.) (This doesn't appear to be a c# problem, but a problem with a bug in the Visual Studio c# compiler, but, any help will be welcome...)...
0
2382
by: rollasoc | last post by:
Hi, I seem to be getting a compiler error Internal Compiler Error (0xc0000005 at address 535DB439): likely culprit is 'BIND'. An internal error has occurred in the compiler. To work around...
3
5238
by: Mark Rockman | last post by:
------ Build started: Project: USDAver2, Configuration: Debug .NET ------ Preparing resources... Updating references... Performing main compilation... error CS0583: Internal Compiler Error...
6
2922
by: toton | last post by:
Hi, Anyone have a link to comparative study of different C++ compilers and how much they conform to C++ language standard? Most of the big platforms I know have GCC which well supports C++...
41
18047
by: Miroslaw Makowiecki | last post by:
Where can I download Comeau compiler as a trial version? Thanks in advice.
0
7040
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7041
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
6736
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
6908
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5331
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4772
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4478
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
1299
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
178
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.