资 源 简 介
py2llvm is an another approach translating codes in Python syntax into LLVM IR for fast execution.
You can develop & run your code in Python for rapid-prototyping phase. Once your code become in stable, your code is turned into native code by py2llvm and it runs extremely fast(as fast as C).
py2llvm enables easy development of your performance-oriented algorithm while its code runs as fast as C.
Since Python is a dynamic programming language, not all feature of Python can be mapped into LLVM IR by py2llvm. Only statically type-inferable and no object-oriented code fragment could be translated, but this is almost enough for performance-oriented programs for example numerical computation and graphics.
Here is a example translation by py2llvm.
```
def muda():
a = 1
b = 2
c = a + b
```
->
```
define void @muda() {
entry:
%tmp0 = alloca i32 ; [#uses=2]
store i32 1, i32* %tmp0
%t