On Mon, Sep 19, 2011 at 3:33 PM, Ville M. Vainio <[email protected]> wrote: > A somewhat "Meta" comment - I think the project to convert c to python is > doomed. Idiomatic c is far ahead of what you can do with Python, in terms of > low level power and pointer arithmetic. You would have to "guess" what the > programmer was probably trying to do with a piece of code, and a mechanical > translator would always miss forest for the trees.
Thanks for your comment. Much of the recent energy comes from confronting the quite natural objections that arise. The fool can either be a source of energy, or the reverse. What you say is quite true, but it is not the whole story. I spent all yesterday improving c-to-python, and the result is remarkable: I can translate gory code from swig sources into something much much cleaner. So as a program studying tool c-to-python is already a success, and will be worth further work. Furthermore, yesterday's work suggests a new direction, one that could only be called "eccentric", and it might be eccentric enough that nobody has seriously considered it since the very earliest days of programming: character-oriented parsing. It's a crazy idea, but it might be crazy enough to work. More in the next EKR post. And there is another point of view, one that I discovered just yesterday on my walk. Suppose c-to-python produces wildly incorrect results. As you say, this is to be expected. The question is, how useful are these wildly incorrect codes? The answer may be, "surprisingly useful". After all, we have to start *somewhere*. We would have Python code that either is, or is not, syntactically correct. Python's compiler will soon set that right. We now have a *running* Python program that either does, or does not, pass unit tests. The existing unit (or regression) tests will soon set *that* right! Yes, this is a somewhat cheeky answer. It ignores a ton of work in "revisioning" a C program as a proper Python program. But we now have the *only* thing that could possibly form the starting point for the project, namely a running Python program. Python programs are almost *infinitely* better than C programs in providing testing harnesses. And it is not at all cheeky to focus of unit tests. They, and *only* they, will tell us whether a c-to-python project has ultimately succeeded. Edward -- You received this message because you are subscribed to the Google Groups "leo-editor" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/leo-editor?hl=en.
