Posts tagged

rPY: Use (r)Python as backend

When designing a Castle-Compiler with a C-backend, we found some nasty details unrelated to CCastle but to the C-language. For example, C has no namespaces (see No Name Collisions); we can simulate them, but that is extra work. Likewise, we need to generate many (data)classes that are very similar. Again, it is possible, but it takes a lot of work: to write the code that generates those almost codes.
Therefore, I started to think about how we can automate that. Or: who has done it before, and what can we borrow?

PyPy –an alternative Python implementation– has developed a concept for that! They have built a translator to convert (r)Python into C and compile that into native machine code.
Can we re-use that? And can it help to realize the “first (bootstrap) compiler” faster?

Read more ...