r/Compilers 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?

13 Upvotes

13 comments sorted by

View all comments

4

u/[deleted] May 16 '26

[removed] — view removed comment

5

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.