|
Improving the GraalPy interpreter
Hrbáč, Adam ; Smrčka, Aleš (oponent) ; Kozák, David (vedoucí práce)
GraalPy is a Python implementation for the Java Virtual Machine, designed for easy embedding into Java applications. Such embedding is primarily useful for adopting 3rd party Python packages in existing Java codebases. GraalPy also often has greater performance compared to CPython, the canonical implementation of Python. This work implements two major features. First, the async API, one of the last major missing Python features in GraalPy, used primarily for web development, allowing writing concurrent code without parallelism, using so-called colored async, where each context switch point must be explicitly annotated. It is composed of two major parts, a library providing an event loop, asyncio in this work, as well as the syntactic components of Python, providing the way with which to indicate context switches. The second feature is the tracing API, a CPython API for implementing Python debuggers, used by integrated debuggers in IDEs, coverage tools, etc. It works by analyzing the Python bytecode in order to determine whether a new line is being executed, and if so, invokes a registered callback. This callback is also used when returning a value, calling a function and raising an exception, allowing a debugger to set a breakpoint for these events. Both features are part of the GraalPy releases and have had a notable benefit to compatibility with 3rd party packages.
|