Some questions about using rpython

Hello, I am considering using rpython to optimize some interpreter like code and I have a few questions that I couldn't quite figure out from pypy's source. 1. Is it possible to call something written in rpython from "normal python" (either running on cPython or PyPy)? Ideally, I would like something where objects could be shared between the two environments. Can I compile something using rpython and then turn that into a C compiled python module that can share objects with the interpreter. 2. How much control can I have over the tracing compiler, eg is it possible to forcing something to be traced the first time it is run? 3. If I am inside of a trace, can I add my own guards or conditionally aborting trace and returning to an interpreted version of the code. I am going to have some code like: if self.method is None: # this branch is only taken at most once for this object # Abort the trace??? self.method = build_method() # marked as an elidable method? self.method(....) 4. How can I use threads from inside rpython? What considerations do I need to make when interacting with the JitDriver. What sorts of atomic operations are available when interfacing with my data structures. What considerations would I need to make to work with rpython's GC. Can I release "normal python's" GIL when writing threaded code from rpython? Also, is software transactional memory usable by things that are not PyPy? It looks like there where a few branches that haven't been merged. 5. Inside of a trace, I would like to be able to look at mutable objects (namely the entire current stack frame) from an elidable methods and have the result be cached without a need for any guards. This is something that I know will be safe due to how the program was written, but not something I would expect rpython to be able to deduce from the context of a trace. How can I annotate a method to be able to do this? Thanks, Matthew -- Matthew Francis-Landau
participants (1)
-
Matthew Francis-Landau