Lets add standalone compilation like AssemblyScript

Hi all,

I know Numba already have standalone compilation https://numba.pydata.org/numba-doc/dev/user/pycc.html

But for me it would be better if it would allow to compile any python program that was properly annotated:


def calculation(num: numba.i32):
    ... logic ...

def listen_on(client: Client):
    ... logic ...

if __name__ == '__main__':
   ... do some stuff

If all objects properly annotation with in basic types that Numba provides then code will be compiled to x86, x64, wasm

As for me the better approach is to implement it first for wasm because there are already available run-times that could run this code wasmtime and even compile this wasm code to native targets AOT

It means by implementing only one generator for wasm it will allow to use compiled Python code on any platforms

Similar approach already done by AssemblyScript :wink:

Numba is compiler that is specialised to the domain of numerical Python. The one line description being: A Just-In-Time Compiler for Numerical Functions in Python. I think what you are asking for is to compile pretty much any Python program based on annotations, it’s unlikely this will be something that Numba will ever target, there’s too much scope. Perhaps take a look at PyPy if this is something you are interested in?

As for AOT compilation to other targets, being able to switch target backend is a long term goal for Numba but not possible right now.