The Very Slow Jython Project¶
A project to re-think implementation choices in the Jython core, through the gradual, narrated evolution of a toy implementation.
Contents¶
- 1. Background to the Very Slow Jython Project
- 2. A Tree-Python Interpreter
- 2.1. Some Help from the Reference Interpreter
- 2.2. An Interpreter in Java for the Python AST
- 2.3. Type and Operation Dispatch
- 2.3.1. Operation Dispatch in CPython
- 2.3.2. Operation Dispatch in Jython 2.7.1
- 2.3.3. A Java Object Approach
- 2.3.4. Dispatch via overloading in Java
- 2.3.5. Dispatch via a Java
MethodHandle - 2.3.6. Caching Type Decisions
- 2.3.7. Extension to Unary Operators
- 2.3.8. Dispatch with Multiple Implementations
- 2.3.9. Progress so far
- 2.4. Simple Statements and Assignment
- 3. A Generated Code Interpreter
- 3.1. Introduction
- 3.2. An Interpreter for CPython Byte Code
- 3.2.1.
PyObjectas an Interface - 3.2.2. Basic types
int,floatandstr - 3.2.3. Objects for
bytesandtuple - 3.2.4. Implementing
dict - 3.2.5. A Python
exceptionas a JavaThrowable - 3.2.6. Runtime Support:
Py - 3.2.7. Implementing
code - 3.2.8. Implementing
frame - 3.2.9. The
frameas an Interpreter - 3.2.10. Program Examples
- 3.2.1.
- 3.3. Type and Arithmetic Operations
- 3.4. Sequences and Indexing
- 3.5. Built-in Inheritance
- 3.6. Comparison and Loops
- 3.7. Refactoring for
evo3 - 3.8. Function Definition and Call
- 3.9. Refactoring for
evo4 - 3.10. Access to Attributes
- 3.11. Attributes Defined in Java
- 3.12. Attributes Defined in Python
- 4. A Plain Java Object Interpreter
- 5. The Plain Java Object Model Extended
- 6. Performance
- 7. Architecture
- 7.1. Java
Objectas Pythonobject - 7.2. Object Implementation
- 7.3. Type Slots
- 7.4. Access to Attributes
- 7.5. Interpreter Structure
- 7.6. Types of
codeandframeObject - 7.7. Compiled Code (Python to JVM)
- 7.8. Functions Defined in Java
- 7.9. Descriptors
- 7.9.1. Introduction
- 7.9.2. Descriptors and
__getattribute__ - 7.9.3. Methods in Python (
PyFunction) - 7.9.4. The @classmethod Decorator (
PyClassMethod) - 7.9.5. The @staticmethod Decorator (
PyStaticMethod) - 7.9.6. Descriptors for Built-in Types
- 7.9.7. Members (
PyMemberDescr) - 7.9.8. Attributes (
PyGetSetDescr) - 7.9.9. Built-in Methods (
PyMethodDescr) - 7.9.10. Special Methods (
PyWrapperDescr) - 7.9.11. Built-in Class Methods (
PyClassMethodDescr) - 7.9.12. Built-in Static Methods (
PyStaticMethod)
- 7.1. Java
- 8. Writing Code