============================================== JavaScript interpreter Summer Of Pypy proposal ============================================== * Intro * Purpose * Planning * Proposed Features * Timeline Intro ===== Pypy for now has only one official frontend. This proposal is about writing another interpreter for pypy toolchain, an ECMAScript one. Purpose ======= ECMAScript implementation would be another language running on pypy toolchain (a lot less complex one than python). This would be a great asset to test optimizations, different backends, JIT and other stuff. For the javascript world it might mean in the future a more portable and probably way faster javascript interpreter (existing ones are very slow) and who knows maybe even with a jit compiler. Proposed Features ================= What I'm proposing to deliver is an almost complete javascript implementation based on ECMAScript Language Specification, making it as compatible with spidermonkey javascript engine as possible. A more detailed list of deliverables is bellow: * Parser for JS in rpython: complete or missing only literal regexes. * A vm for JS: implemented working with bytecodes. * An Object Space for JS: With all the language datatypes. Planning ======== I intend to start on the parser frontend, as I have not found any complete parser generator that generates RPython. something that would be easier to use and this can be an activity that will force me to learn a little better about the formal description of JS and to understand how RPython works. I saw that pyparser may be an easy way to make the parser, but if that proves hard to use I can always make a LL(1) parser by hand (which should not be hard). Then I will start to model the VM Bytecodes, there I will use what Armin Rigo suggested and directly use the syntax elements of js (at least some of them) as bytecodes. Also stealling an idea or two from the pypy's vm sounds like a plan. The third and longest part is working on both the Object Space and the vm together making it more and more complete. If everything goes well (lets all hope so) there will be time to polish it a little bit and building the standard javascript library as well as speeding it up or providing JIT interface. Timeline Sketch =============== I can put 10 hours/week the project until the end of the semester (beggining/mid december). Then in the summer I can put a lot more time into it (30 hours/week, depending on the pace of the project even more). The good thing is that as I have choose to make all those course work about pypy I can focus a bit more on it. By the end of december I intend to have a funcional interpreter that can evaluate simple expressions in one or 2 data types, by the end of january mid february the interpreter should have conditionals loops and more support for the default dataypes. I can work a lot on this project, because it's intended to be my bachelors degree, as well as paper about cathegorical approach to show how pypy works for a category theory class.