3 ms·
Would it be possible to make a Python (without C extensions) that compiles to Go?
by rthnbgrredf 2y ago
Would it be possible to make a Python (without C extensions) that compiles to Go?
- funny_falcon 2y agoThere was one: https://github.com/grumpyhome/grumpy https://github.com/grumpyhome/grumpy Looks like abandoned though.
- cardanome 2y agoI am not sure you can easily directly transpile to Golang from Python. Python is very, very dynamic and can have extremely complex types that are not representable with the Golang type system. Not impossible but I guess you might end up with an extra runtime layer and some more dynamic operations will not be very fast. Or you restrict it to a subset of Python like this project does: https://github.com/zanellia/prometeo https://github.com/zanellia/prometeo You could of course write a bytecode VM in Golang but I guess that defeats the purpose.