▲ 22 points
back
2 comments
Can the same be used for regular python AST's? i.e., to generate legible C code from Python? I know PyPy's RPython already does this, but I don't think the code is this clear. Or is it?
Well, things would get tricky, because even stuff like "foo.bar" gets turned into a dictionary lookup.
In short, you could do it, but it would hardly qualify as readable in the general case. It is easier to do this to RPython since all the dynamic parts are gone (foo.bar just becomes a struct lookup).