Sure. The primary goal of the project is to migrate Ninia to use Doppio's threads. Now, Doppio's threads are not implemented in a standalone library at all; they are tightly coupled with DoppioJVM in the Doppio repository. And they are currently not generic enough to simply move to their own library. I don't expect a GSoC student to be able to jump into the DoppioJVM codebase and make them generic, since they are somewhat hairily intertwined into hairy JVM routines. :)
So, here's what I expect a student working on this project would be able to do:
- Develop from scratch a basic Thread object for Ninia, similar to Doppio's JVMThread. No need to worry about multithreading at all. Like in Doppio, a Thread is a glorified array of StackFrames; the thread has a runMethod function that takes a stack frame, pushes it onto the stack, and executes the code associated with it; the thread has a throwException function that performs stack unwinding to find which stack frame can catch the exception; the thread uses the same adaptive algorithm as DoppioJVM to suspend the thread if it runs for too long...
- Refactor Ninia to use this Thread. The biggest change here is that all Python bytecode method calls will need to be made asynchronous, because it's impossible to always determine if Ninia will need to suspend execution during the method call.
That's the basic, bare-bones version of the summer project. It's a fundamental change to the interpreter, and a nontrivial amount of work. I would view this as a "moderate success".
Once Ninia is using Doppio-like threads, I will work with the student to figure out what a generic Doppio Thread API should look like so that it supports both Ninia and DoppioJVM, and I will work toward making a standalone Doppio Thread library that both language implementations can use.
While that is happening, the student will have the freedom to work on other things. Here are some ideas:
- Multithreading support. Python has a couple of APIs for multithreading. The student could implement a comprehensive test suite for these APIs (which will be tricky -- you need to make sure the tests are robust to arbitrary thread scheduling), and then proceed to implement multithreading in Ninia. The student would need to implement or steal the thread scheduler from DoppioJVM (which would eventually make its way into the generic library I'd be working on), and the Python thread object might need to be modified to support locks.
The hardest part of adding multithreading will be debugging everything.
- Improving Ninia's conformance to Python's behavior in some other way. You could hook up the file system, you could add Doppio socket support (which also aren't broken off into their own library at the moment)...
For your timeline, I expect you to carefully consider what is required to complete the basic goals of the project, and what additional work past the basic goals you believe you can complete over the summer. You should have clear-cut and dated goals, with concrete ways to determine how you know that you have met those goals.
Over the summer, students will use their timelines to track their progress, and adjust them as they encounter roadblocks or get ahead of where they expected to be. It's a really useful thing to have when working on a project, as it keeps your progress in-line with the project's goals.
Make sense? Let me know if you have any additional questions.
John