How is Python designed?

L

Limin Fu

Hello,
Is there any technical description on internet of how
python is designed? Or can somebody give a short
description about this? I'm just curious.
Thanks in advance,
Limin




__________________________________
Do you Yahoo!?
Yahoo! Mail - You care about security. So do we.
http://promotions.yahoo.com/new_mail
 
T

Timo Virkkala

Limin said:
Hello,
Is there any technical description on internet of how
python is designed? Or can somebody give a short
description about this? I'm just curious.

Do you mean the structure and design of the language, or the process of
designing the language?

Well, in either case, you'll probably find your answer at http://www.python.org

Take a look at the Docs -> Language Reference and PEP sections.
 
T

Terry Reedy

Limin Fu said:
To clarify, I mean the internal structure and design
of python interpreter. Any hint? Thanks.

Ah... The interpreters (plural) are a separate issue from the language
itself (a Python program is a list of Python statements, etc). We'll
presume that you specifically mean the CPython interpreter, as opposed to
Jython, Viper, Ironman, PyPy, Parrot, or the human brain. For CPython:

human or other source code generator ==> Python source code

CPython compile phase:
lexer ==> tokens
parser ==> ast tree
byte code generator ==> byte codes for Python virtual machine
(see the Lib Ref chapter on the dis module for VM commands)

CPython runtime phase:
code evaluator ==> computations
(see source file ceval.c for the link between byte codes and C
functions)

CPython is currently both the reference implementation and the most
commonly used implementation. Both facts could change in the future,
possibly even with divergence between the two roles. Since Python is meant
to be a practical computer language as well as an abstract algorithm
language (for humans), a reference implementation is needed to show that
proposed language features can be sensibly implemented.

Terry J. Reedy
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,754
Messages
2,569,527
Members
44,998
Latest member
MarissaEub

Latest Threads

Top