Permalink
Browse files

Rough outline of future plans for OPy.

  • Loading branch information...
Andy Chu
Andy Chu committed Apr 8, 2018
1 parent 56c2773 commit 23fa21fc80373bd325e6ce1b2e91bd45ee70f19b
Showing with 27 additions and 0 deletions.
  1. +27 −0 opy/README.md
View
@@ -13,6 +13,33 @@ currently run all Oil unit tests, but isn't otherwise used.
[byterun]: http://aosabook.org/en/500L/a-python-interpreter-written-in-python.html
Very Rough Outline of Future Plans
----------------------------------
- Use `opy/callgraph.py` to find the minimum amount of code we need to compile.
(Tree shaking).
- Produce a statically typed AST.
- Add type annotations for functions/constructors, possibly with `.pyi` files
generated by tests.
- Add type annotations for class members. Possibly with something like
[attrs](http://www.attrs.org/en/stable/)?
- Add type inference for local variables.
- Use the statically typed AST to generate type-specialized bytecodes. For
example, we could have variants of `BINARY_ADD` that know the types of their
arguments.
- Implement these bytecodes in byterun as a prototype. Do the spec tests still
pass?
- Rewrite specialized bytecodes in our own interpeter loop in C.
- It will not use `import.c`. Imports are resolved at compile time.
- This means we also get rid of the app bundle `.zip` format, which is
causing problems.
Also:
- Strip Oil of runtime dependencies like the Python `re` module. Rewrite with
`re2c`.
- Copy the stuff we use out of `posixmodule.c`, `pwdmodule.c`, etc.
Getting started
---------------

0 comments on commit 23fa21f

Please sign in to comment.