Tuesday, November 24, 2015

Why Leo is Noteworthy

This post discusses what I think matters most about Leo. This post assumes you are an experienced Leo user. It does not try to duplicate Leo's Tutorial.

Leo is a superb tool for understanding, studying and organizing any kind of complex data, including computer programs. The first great Aha in Leo's history was that webs (literate programs) are outlines in disguise. Leo's importers (@auto) make it easy to studying other people's programs. Leo's always-present outline structure clarifies overall program structure and makes many kinds of comments unnecessary.

Leo is a superb browser for code and data. Unlike many other folding editors, Leo remembers which nodes were expanded when you last saved an outline. This is surprisingly important. And Leo's clones let you organize any data as you want, even if all folds are collapsed.

Leo is a uniquely powerful scripting environment. This power comes from three sources: Leo's API, Leo's ability to compose scripts from outlines and Leo's underlying data structure, a Directed Acyclic Graph, the basis for Leo's clones.

Leo's API consists primarily of generators, such as c.all_positions(), p.self_and_subtree(), etc. and properties, such as p.b, p.h, p.gnx and p.v.u. Leo's API makes it trivial to write scripts to access or change any node. AFAIK, these capabilities are unique. Simulating them in vim or Emacs is possible, but so is simulating Python's capabilities in C...

Afaik, no other scripting environment allows you to compose scripts from outlines. @file, @clean, @auto, @others and section references and definitions make this possible. Section references and definitions are modeled on the noweb language, but all of Leo's script composition features are fully integrated into Leo's outline structure.

Leo's outline nodes have headlines (p.h) and body text (p.b) and extensible information (p.v.u). Headlines are descriptions (meta-data) of the data in p.b and p.v.u. Scripts can rapidly discover and categorize data using metadata. Leo's @ convention for headlines (@clean, @file, @auto, @html, etc.) show how extensible this node typing is.

So much for the theory. The following also are important in practice:

The invention/discovery of @clean earlier this year completes Leo in some sense.

Acknowledgements: Working with Leo's community of Leo's developers and users has been a great pleasure for over 20 years. My only regret is that Bernhard Mulder and Bob Fitzwater are no longer with us. Both made essential contributions. Bob Fitzwater was my mentor. He gently pushed me to consider design, not just "bit twiddling". Bernhard Mulder contributed two of the most important elements of Leo: Leo's traversers (generators) and the original @shadow algorithm. Neither @clean nor the revised Mulder/Ream algorithm could possibly have happened without him. I miss both these great thinkers. Both would have been proud of what they helped create.

A successful software tool is one that was used to do something undreamed of by its author.' -- Stephen Johnson
Leo is a wild success on this score. I foresaw none of these developments 20 years ago: Leo's minibuffer, @button, @test, @auto, @clean, Leo's plugin architecture, the rst3 command, the Leo bridge and the IPython bridge. Surely many other features and uses could be added. None of these would have happened without Leo's community of brilliant people. These features create the Leonine world. Who knows what will be the result...


P. S. As I write this, I see that @button is nowhere mentioned in Leo's History Chapter. That's crazy: @button is arguably the most brilliant scripting idea ever created anywhere. Many thanks to 'e', whoever you are. I'd like to thank you by name. @button lead directly to @test.


No comments:

Post a Comment