Quiet time is over

71 views
Skip to first unread message

Edward K. Ream

unread,
Apr 14, 2020, 9:53:28 AM4/14/20
to leo-editor

I have enjoyed taking a break to look at broader issues. My conclusions:


I want to create new, Leonine, tools for studying and adapting code. I am most interested in studying pyzo's gui code and Leo's key-handling code. The goal in each case will be to simplify and improve the corresponding code in Leo.


Initially, such tools are likely to be bespoke scripts. Later, these scripts might evolve into Leonine commands.


The tools themselves will likely be the primary product of the work. There is no guarantee that Leo's code will ever change.


Initial ideas


How could we meld Leo's and pyzo's code bases? We could start with Leo's code, or pyzo's code, or we could start with a clean slate. Each way has advantages. For example, we could investigate snippets in code in what amounts to a unit test.


We can think of Leo outlines as an "executable" graph. Bespoke scripts would define "meaning" and "appearance" of this graph. Other scripts could define projections of a Leo outline onto another (part of) the Leo outline. For example, a script, similar to Leo's clone-find or find-all commands, might summarize the messages which pass between pyzo's gui code. The summary would appear as a single node (find-all) or a tree of nodes (clone-find).


By default, pytest presents its coverage data as a single html page. It might be possible to restructure that data by Leo nodes.


Summary


Melding code bases is difficult to impossible :-) It's a juicy problem, for which Leonine scripts have unique advantages. Scripts can define projections of an outline. Such projections distill information and might form the basis of still more scripts.


Absent significant new tools, the Leonine and pyzoic code bases will likely remain separate. Only strong scripts, similar to unit tests with full coverage, could ensure that changes to Leo's code won't subtly alter the meaning of existing settings and appearance.


Edward

Thomas Passin

unread,
Apr 18, 2020, 2:08:52 PM4/18/20
to leo-editor
Possibly fitting in with this, I have just discovered SourceTrails, a static code analyzer that works with Python code (as well as Java, C, and C++):


Sourcetrails can work with quite a few editor/IDEs by means of an intermediate server, including Sublime Text, atom, and QT Creator.  So it should be feasible to get Leo to work with it too.

Edward K. Ream

unread,
Apr 20, 2020, 11:13:50 AM4/20/20
to leo-editor
On Sat, Apr 18, 2020 at 1:08 PM Thomas Passin <tbp1...@gmail.com> wrote:
Possibly fitting in with this, I have just discovered SourceTrails

Thanks for this. Good static analyzers are always good to have.

That said, I want the product of analysis to be a Leo outline. If it isn't, it can't be analyzed further.

Edward
Reply all
Reply to author
Forward
0 new messages