Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Compiler

Reply
Thread Tools

Compiler

 
 
Steven
Guest
Posts: n/a
 
      04-26-2004
Hi folks,

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

Regards,

Steven
 
Reply With Quote
 
 
 
 
Peter Hansen
Guest
Posts: n/a
 
      04-26-2004
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
 
Reply With Quote
 
 
 
 
Maurice LING
Guest
Posts: n/a
 
      04-27-2004
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
 
Reply With Quote
 
Roger Binns
Guest
Posts: n/a
 
      04-27-2004
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


 
Reply With Quote
 
Terry Reedy
Guest
Posts: n/a
 
      04-27-2004

"Maurice LING" <(E-Mail Removed)> wrote in message
news:408db4fb$(E-Mail Removed)...
> 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




 
Reply With Quote
 
Rick L. Ratzel
Guest
Posts: n/a
 
      04-27-2004

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


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Compiler Error Message: The compiler failed with error code -1073741819 Ram ASP .Net 0 09-13-2005 09:52 AM
Why is a JIT compiler faster than a byte-compiler RickMuller Python 4 03-26-2005 04:30 PM
Compiler compiler with C++ as output Andrey Batyuck C++ 3 05-17-2004 08:17 PM
Can we use <compiler> tag to avoid RunTime Compiler error? Jack Wright ASP .Net 5 01-19-2004 04:36 PM
Compiler Error Message: The compiler failed with error code 128. Yan ASP .Net 0 07-21-2003 10:49 PM



Advertisments