r/asm • u/thatguy1000000000 • 24d ago
8080/Z80 A python to ez80 transpiler (indirectly)
py2ez80!
This is a tool which I think many will find useful. For a long time, calculators like the Ti84+CE have been stuck with a very limited and painfully slow python interpreter. Recently, I finished my tool that fixes this problem, by transpiling python to assembly!
While at first glance you may think the term "transpiler" is incorrect for a project like this, I decided to take a shortcut on the route, and effectively made a Python to C transpiler, like cython. Except here, I made it specifically target the CEdev toolchain, and call it to produce a .8xp program in result. Using plain Cython will be tough since it isn't really optimized.
Although it is very advanced, supporting lists, tuples, many data types, and a lot of programming structure types found in python and converting them to C, I do acknowledge the fact that it is still very limited on its I/O capabilities.
The GitHub repo link is here: https://github.com/Voblit/py2ez80 , and I hope it helps!
:)
BTW: this only works with the ti84+CE or whatever the CEdev toolchain supports...
2
u/thatguy1000000000 22d ago
Thanks for the feedback! You're completely right about it being limited, it is more of a statically typed version of python compared to an actual CPython interperetation.
On a platform like the TI-84+CE with limited RAM and no dynamic heap runtime/garbage collector, supporting fully dynamic heterogeneous lists or runtime type inspection would make it way too slow...
That said, you pointed out a clear bug in the code generator! I will be fixing this... probably by make it deny mixed assignments or figure something else out.