Edward K. Ream
unread,Nov 29, 2012, 11:37:45 AM11/29/12Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to leo-e...@googlegroups.com
It's beginning to look as if the stc project will "succeed" in a different way than I originally imagined :-) Indeed, it has been slowly dawning on me that Python already *has* two superb type checkers. They are called pylint and rope! That being so, the best way to move forward on the stc project may be to encourage as many people as possible to flattr (or otherwise contribute to) the developers of pylint and rope...
I'm not sure how much more time I will devote to the stc project. This post may form the basis for a "farewell" post on the stc group. But I'll probably continue to work on the stc project long enough to answer questions about how rope and pylint do what they do. Make no mistake, I am still intensely curious about rope and pylint, perhaps more so now that I have done so much studying without gaining real understanding.
I might be a bit more embarrassed by these developments were it not that Guido himself seems not to understood pylint and rope. Anyway, I have enjoyed my work on stc. I have gained lots of experience with Python's excellent (if slightly flawed) parser tools. The tricks in rope's ast.py module are truly clever. I have been able to study TypeScript, a great static analyzer for JavaScript.
Most importantly, I have developed several tools and techniques for analyzing other python programs. The most important technique is the dictum,
"the only way to understand a computer program is to run it."
This dictum has lead directly to several new tools:
- An improved recursive import script in scripts.leo. This script now has an option to create @edit nodes rather than @file nodes. While not as clear as @file nodes, @edit nodes are a fast way of gaining access to files for the purposes, say, of inserting calls to pdb.set_trace.
- The g.SherlockTracer class. It's amusing to see how much simpler it is to do in Python than in C.
Having said all this, there is a sense of relief that I may soon be working on Leo "full time". The list of good ideas worth doing seems endless. Here are some likely improvements:
1. Integrate rope into Leo :-) I have spent the last two weeks studying rope intensely. I may not understand rope's type inference mechanism completely, but I do know that it works. More importantly, I have a great deal of respect for rope's infrastructure; it provides what TypeScript calls the "harness" that allows an editor to interact with rope, and vice versa. Most of rope's code consists of this harness, and for good reason: the nitty gritty details are inherently complex.
I am convinced that it will be possible to drive rope from Leo. Indeed, Leo's outline structure may make it possible to do some things to speed up what looks like an inherently time-consuming type inference process. This is not a one-day, or even one-week project. But it's worth doing.
2. More flexible unit testing. Leo needs better ways of managing unit tests in external files, and of using custom subclasses of unittest.TestCase. At present, the Leonine idiom that substitutes for subclassing is::
exec(g.findTestScript(c,'@common <name of common code>'))
This sorta works for all-Leo situations, but it won't work when test cases are in separate files. I have some ideas for improvement, and some mostly-failed experiments from the stc project. I expect some good things to happen fairly soon.
3. There have been some interesting requests lately for improvements to Leo. Two that come to mind are a) easier ways to execute scripts in a separate process and b) a way to parameterize template nodes. I'd also like easier ways to parameterize commands. I am sure that Leo's users will continue to suggest improvements that I would never have imagined.
So that's it. I expect a period of transition away from stc. It may take weeks or even months, but I am eager to continue to improve Leo.
Edward