Friday, September 2, 2011
Thursday, September 1, 2011
prog: language translator
such as a compiler or interpreter
Python: Symbol table
http://eli.thegreenplace.net/2010/09/18/python-internals-symbol-tables-part-1/
In computer science, a symbol table is a data structure used by a language translator such as a compiler or interpreter, where each identifier in a program’s source code is associated with information relating to its declaration or appearance in the source, such as its type, scope level and sometimes its location.
A high-level view of the front-end of CPython is:
In computer science, a symbol table is a data structure used by a language translator such as a compiler or interpreter, where each identifier in a program’s source code is associated with information relating to its declaration or appearance in the source, such as its type, scope level and sometimes its location.
A high-level view of the front-end of CPython is:
- Parse source code into a parse tree
- Transform parse tree into an Abstract Syntax Tree
- Transform AST into a Control Flow Graph
- Emit bytecode based on the Control Flow Graph
prog: bytecode
http://en.wikipedia.org/wiki/Bytecode
Python source code is compiled into bytecode, the internal representation of a Python program in the CPython interpreter. The bytecode is also cached in .pyc and .pyo files so that executing the same file is faster the second time (recompilation from source to bytecode can be avoided). This “intermediate language” is said to run on a virtual machine that executes the machine code corresponding to each bytecode. Do note that bytecodes are not expected to work between different Python virtual machines, nor to be stable between Python releases.
(http://docs.python.org/glossary.html#term-bytecode)
Python source code is compiled into bytecode, the internal representation of a Python program in the CPython interpreter. The bytecode is also cached in .pyc and .pyo files so that executing the same file is faster the second time (recompilation from source to bytecode can be avoided). This “intermediate language” is said to run on a virtual machine that executes the machine code corresponding to each bytecode. Do note that bytecodes are not expected to work between different Python virtual machines, nor to be stable between Python releases.
(http://docs.python.org/glossary.html#term-bytecode)
Python: Coding style
http://www.python.org/dev/peps/pep-0008/
Subscribe to:
Posts (Atom)