APrioriInvestments / typed_python

An llvm-based framework for generating and calling into high-performance native code from Python.
Apache License 2.0
197 stars 8 forks source link

@Function decorators don't work on closures defined in compiled code #415

Open braxtonmckee opened 1 year ago

braxtonmckee commented 1 year ago

We can't execute something like this:

@Entrypoint
def f():
    @Function
    def g():
        ...

because the compiler doesn't understand what to do with the @Function decorator.

(a) that should work since its part of TP (b) if we can see what the actual body of the function is, we should be able to actually execute the decorator (c) if we don't know what to do, we can wrap it in 'object'. Maybe this should be configurable, although we don't have a conceptual framework for that idea yet anyways.