|
Project Information
Links
|
PEJSPython Executed by JavaScriptThe project aims at implementing a Python VM in JavaScript, enabling Python on web pages in browsers all over the world :) For now, this is done by executing Python Byte Code Instructions as outputted by the standard CPython implementation, but the perspectives are laid out by HotRuby, where nested Ruby code is run straight out of the HTML. This project is sort of a Python equivalence to HotRuby. School projectAt the moment, this is a school project as part of the course Design of Virtual Machines for Object Oriented Languages at DAIMI, the computer science department at University of Aarhus. The course is held by Lars Bak and his staff at Google Aarhus, the V8 team. DetailsOur aim is to implement an object-oriented subset of Python bytecode. Our approach is as follows: We've started by implementing a simple interpreter (src/interpreter.js) which simply switches over the bytecodes and implements only some very basic language constructs. The Python bytecode is actually generated by a Python program (tools/pejs.py) which outputs it in JavaScript arrays.The JavaScript file containing the bytecodes is then referenced in an HTML-file which also references our interpreter and thus the Python code is executed in the browser. For a complete Python implementation we would have to write a Python compiler as well as the virtual machine we are doing. Milestones
We aim to finish the basic language features (variables, conditionals, loops, functions) and then design and implement classes and objects which implies designing an object and a memory model. This is the most important part of the project. After that, we would like to handle garbage collection as well as library calls. It is not yet clear how far we will get with regard to these two issues. That depends on how complex the object implementation turns out to be. Finally we document our implementation with performance evaluations where we would like to consider different JavaScript VM's for executing our own VM as well as implementation alternatives inside our VM. |