r/Compilers • u/nanoman1 • May 16 '26
Help: Writing a Python to C transpiler
I'm thinking about embarking on a journey for writing a Python to C transpiler. It'll provide an interesting challenge and also will be useful, considering I am targeting an environment that can only take a subset of C as input. Given that I haven't ever written a compiler but I have written an interpreter about a decade ago and have forgotten most of the process, what are some things I'd need to familiarize myself with in order to write this transpiler? Also, what intermediate representation would be wise for such a project?
14
Upvotes
View all comments
Show parent comment
4
u/Repulsive_Gate8657 May 16 '26
i would really stay away from dynamic typisation here, only subset of python with types knowing at compile time omg.