This is the 2nd test sample for my 'Python to Go' project
download url: http://pan.baidu.com/s/1i3qVozj
This time I choose a 75 Python lines of Tetris game. It use PyGame library.
With my 'Python to Go', I convert it to Go source, compile, and it run.
This time I compile it on platform Win8 64bit.
Please open a Windows prompt window, go to directory BIN, and run the RUNME.BAT
Q: Do you try to support all Python programs, or only some ?
A: I try to support all Python2 syntax(not Python3 yet). Especially I can
all Python standard libraries include. And I support programs which use 3rd
Q: After translate to Go, Does it realy run faster ?
A: Yes, it is! I made some effort to try to ditermine variable datatype for
float, string etc. And compute them with Go instead of PyObject. Even for those
not determined data type condition, I also try to compute it in Go level with
Q: Again, significance of 'Python to Go'
A: Take this sample game for example. With Python it only need 75 lines. Can
it with Go ? You can not find the PyGame library, so maybe its impossible to do
Go. From impossible to possible, does it enough ?
Python's library is the most plentiful among all computer languages. This show
love Python. But it can not compile to binary, this limit its usage. Now with
to Go, you can benefit hundreds of Python libraries in GoLang. I am sure this
the long-lived Python more powerful, and new-borned Go more powerful!
In my opinion. A good programming language should be 2 level. It should be
dynamic like Python during the developing period. We can express our idea
any limitation. After the program work normally, automatically or
manully, we can add some decorate code to limit some dynamic features we do not
make it run faster, and easy to compile. Up to now, I do not find any this kind
programming language. Many new language still choose hard between dynamic and
We can understand 'Python to Go' as the 2nd explanation of Python. Convert your
source to Go source and compile, it works in a different way.
Developing with Python, compile and run with Golang, anyone interest?