[pypy-dev] Leo outlines & psyco

Edward K. Ream edream at tds.net
Fri Jan 17 15:45:34 CET 2003


I have just uploaded to Leo's web site two outlines that may be of interest
to this project.

1. pysco.leo (in pysco.leo.zip) is a Leo outline I have been using to study
psyco.  It contains the code for psyco, and the code for the main loop of
the C interpreter.  Notice how using sections makes the structure of both
the C interpreter and the corresponding psyco compiler clear.  It also
contains a section allowing you to compare, on a case-by-case basis, the
cases of the psyco "compiler" with the cases of the C interpreter's main
loop. This shows just some of the power of clones...NOTE:  This outline is
based on code that is several months old.  I include it mostly to show how
Leo could be applied to this project.

2. CC2.leo (in CC2.leo.zip) contains most of the C source code for an
optimizing C compiler, assembler, linker and loader written in the early
90's for the now-defunct Tuple corp.  I am co-owner of this code (not that
it has any commercial value).  Again, I include this outline to show how
useful Leo would be in a compiler project.  Examples:

a. The documentation section in CC2.leo contains all the documentation in a
single place, and parts of the documentation are cloned and placed near the
code to which the documentation pertains.

b. If I were writing this code today I would use sections extensively to
clarify the code.  For the most part, this code is exactly as produced from
Leo's import script, so it isn't nearly as clear as it could be.  However, I
have reworked the complex tokize routine (in the @file CCtokize.c tree in
the "Tokens & preprocessor" section to show the kinds of things that can be
done.

c. CC2.leo contains a _huge_ amount of code and documentation.  With Leo it
is easy to use clones to focus on the task at hand and ignore everything
else.

You may find both pysco.leo.zip and CC2.leo.zip at:
http://sourceforge.net/project/showfiles.php?group_id=3458
under the headings: Miscellaneous: CC2 & Psyco.

In order to use these outlines (.leo files) you will need a copy of leo.py,
which you can find at the url above under the headings: Leo2.py: 3.10.  If
you have Windows you can just download the single-click installer,
leosetup.exe.  Otherwise, please download leo-3.10.zip.

I am no salesman, and I am always leery of touting Leo.  However, I do think
that Leo would really contribute to this project.  I hope no one objects to
this posting.  If so, I apologize in advance :-)

Edward

P.S.  I think using Leo for the primary source for a project like this makes
sense.  Leo is ideally suited to managing and clarifying complex code.
Moreover, I would like to see Leo used (eventually, not now) to manage the
entire Python project.  However, at present there are issues with using Leo
with CVS, so I think it makes sense to use Leo on a strictly experimental
basis on an experimental project like this.  It will be very easy to use Leo
on this project.  If there is any interest I shall explain the simple rules
for doing so.  I believe the cvs issues with Leo will largely be resolved in
about two months when Leo 4.0 comes out.

P.P.S For the best example of what Leo can do, look at Leo's own source
code, LeoPy.leo, included in all distributions of Leo.  In particular, look
at the (Project Views) section of LeoPy.leo to see how to use Leo's clones
to keep track of tasks (like bugs and other ongoing issues).

EKR
--------------------------------------------------------------------
Edward K. Ream   email:  edream at tds.net
Leo: Literate Editor with Outlines
Leo: http://personalpages.tds.net/~edream/front.html
--------------------------------------------------------------------





More information about the Pypy-dev mailing list