#684: Create a browser gui for Leo 
<https://github.com/leo-editor/leo-editor/issues/684> is one of the largest 
projects in Leo's history. It might take 6 months or more to complete.

The only way to confront such a project is to focus on prototypes that take 
only one or two days.  That puts us into action and keeps energy levels 
high.

Yesterday I worked on Terry's prototype server code.  I learned much more 
from wrestling with the code than I would have from reading words, words, 
words.

This experience suggests a number of improvements:

1. I keep forgetting Terry introduced his leoserver stuff 
<https://www.google.com/url?q=https%3A%2F%2Fgithub.com%2Fleo-editor%2Fleo-editor%2Fissues%2F684%23issuecomment-363992724&sa=D&sntz=1&usg=AFQjCNFxFHTE2PthQ0ILIeRqTHzUP4DSOg>
 
in a comment to #684 itself :-) More generally, it's a challenge to keep 
track of what Terry, Vitalije and Joe have done, and where the original 
code came from.

2. Yesterday it quickly became obvious that I needed to commit my changes 
to Terry's work somewhere.  I chose the leo/external folder, but that's not 
quite right.

Instead, I'll create a leo/proto folder for prototype code.  This will be 
organized by original developer: proto/tnb, proto/vitalije, proto/orr, etc. 
And yes, @file nodes for these files must be added to LeoPyRef.py.

3. Similarly, the leo/core/leoPrototype.py file will contain commands 
needed to run the prototypes. The docstrings for these commands will be 
convenient places to discuss where the code came from, what it's purpose 
is, etc.

4. The commands in leoPrototype.py may require improved infrastructure, say 
for running javascript or clojurescript code. 

An example may clarify some of the issues. Yesterday I first ran Terry's 
server code as follows:

  cd /test/Terry
  python leoserver.py

Which was fine, except that I had to copy the entire leo folder into 
/test/Terry!  Ok only for a quick prototype ;-)

The next step was to copy leoserver[.py, .js, .html, .css] to leo/external. 
I modified leoserver.py so that it would run without a copy of the leo 
directory. The code to do this was just a bit tricky:

controller, g = open_bridge()
join = g.os_path_finalize_join
loadDir = g.app.loadDir
path = join(loadDir, '..', 'doc', 'LeoDocs.leo')
c = controller.openLeoFile(path)

*New commands*

Today I'll create a new command, say tnb-server, in the new leoPrototype.py 
file.  Its docstring will contain everything I am likely to forget, 
including a digest of everything I have written here :-)

I'll do the same for Vitalije's two prototypes and Joe Orr's LeoVue code. 
These prototypes are written in javascript, clojurescript and vue.js.  I'll 
create whatever infrastructure is needed to run these prototypes. 

The proposed names for these commands will be vit-leocljs, vit-leo-el-vue 
(after the folder names of the code), and orr-leovue. Prefixing these 
commands with developer's id will help me remember them.  I'll also add 
aliases for these commands.  These aliases will start with proto-, so that 
<alt-x>proto-<tab> will list the names of all prototype commands.

*Summary*

To paraphrase Richard Feynman, that which I cannot build, I do not 
understand.

Rapid prototyping, including prototyping of builds, is the key to 
maintaining high energy in a large project. 

A new leo/proto folder will contain prototype code, organized by developer. 
This folder will allow devs to push work for others to see.

New proto-* commands, in leoPrototype.py, will run prototype code, building 
it as necessary. New infrastructure may be required to build and run 
non-python code.  Yes, Leo is pure python, but Leo can support languages 
other than python.

The docstrings for prototype commands are the proper place for all notes, 
including the original source of the code.

All comments and suggestions welcome.

Edward

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To post to this group, send email to leo-editor@googlegroups.com.
Visit this group at https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.

Reply via email to