ENB <-- means ?

On Wed, Feb 21, 2018 at 2:32 AM, Edward K. Ream <[email protected]> wrote:

> This is blue sky thinking. Nothing is certain.
>
> The goal: *turn Atom into Leo in the simplest way possible*.
>
> The simplest thing that could possibly work might be to loosely base the
> leo plugin on the existing hydrogen plugin
> <https://github.com/nteract/hydrogen>.
>
> Please enable the hydrogen plugin to Atom and follow along this simple
> example.
>
> 1. Create a new .py file and save it. Add this line:
>
> import os
>
> Select this line and hit Ctrl-enter (hydrogen:run). A check mark appears
> after the line.
>
> 2. Add this line, select it and hit Ctrl-enter again.
>
> os
>
> You should get something like this:
>
> os |<module 'os' from 'C:\\Anaconda3\\lib\\os.py'>|
>
> The vertical bars denote a faint box.. This indicates that "os" is part of
> a persistent namespace!
>
> Behind the scenes, hydrogen sends the expression "os" to a "kernel".
> Details fuzzy.
>
> Just this may be enough to form the basis of Leo support in atom!
> Something like this.  Details *very* fuzzy:
>
> - Javascript code (in atom) will draw Leo outlines.  This code will be
> based on core (atom) tree code.
>
>
this way is stable, because JS process XML is stable;


> - Opening a .leo file (in atom) will init *python state data* in the
> python kernel. *Python code* in the kernel will load the .leo file and
> create a representation (a tree of vnodes, or an sqlite db) of the outline *in
> the kernel namespace*. The python code will pass a representation (as
> json or cson) of the entire outline back to Leo's js plugin code.  This
> will only happen once, when opening the outline.
>

means all Leo's commands/plugins will process by python self, not change?


>
> - Leos' javascript code (in atom) will update the screen when inserting,
> deleting, moving, changing and cloning nodes.  So the js code acts pretty
> much like gui code. The js code must (probably) also update the python
> representation in the kernel namespace for the outline.
>
>

Wow, means Atom only make GUI part,
others actions all by python , same now, not change?


> - The execute-script command (in atom) will send the to-be-executed script
> to the kernel.  The kernel, using the state data for the outline, will run
> the script and return the value of the script, and any side effects of the
> script, again as json/cson.  Using this returned value, the gui code will
> insert, delete, move, change and cloned nodes on the screen.
>
>
means, Leo all kinds of commands/plugins will bind RESTful API,
Atom answer user's action,
sent/accept core API srv.
Leo base API srv. action, process .leo/export files/...etc.


> *Summary*
>
> Leo's plugin (javascript) acts like Leo's gui code. The plugin will also
> handle some (most?) of Leo's commands.  Commands requiring extensive python
> code will be passed to the python kernel (per-outline namespace).  Results
> passed back to Leo's js plugin code then update the screen and Leo's js
> data structures.
>
>
but, this plugin will very large , and the profit only:
0: new GUI
1: maybe new user from Atom user group
not others?


> An experienced atom programmer might be able to do this in a few days.  It
> will take me much longer—perhaps weeks or longer. That doesn't bother me.
> I will learn a lot along the way, including a lot about js/coffeescript
> tooling.
>
> Edward
>
> P.S.  Yesterday I learned that new js standards do *not* invalidate
> coffeescript (cs).  Instead, cs2 now generates "new" javascript directly.
> cs2 will break some cs1 code, but that's not a big deal and it doesn't
> affect a possible Leo plugin for atom.
>
>
CoffeeScript nature problem is:
if some error, the debug report just for generated js not coffeescript,
means, we can not know which line is error.

so for efficiency,
write nature JS, will debug quickly;

but for Pythonisat, write JS will feeling sooooooooo ugly.


> Amazingly (to me) lots of js programmers seem to hate coffeescript.  But
> that's not my problem, since atom can be programmed in either js or cs2.
>
>
see: Vanilla JS http://www.vanilla-js.com/

the most powerful JS platform .


> EKR
>
> --
> 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 [email protected].
> To post to this group, send email to [email protected].
> Visit this group at https://groups.google.com/group/leo-editor.
> For more options, visit https://groups.google.com/d/optout.
>



-- 
life is pathetic, go Pythonic! 人生苦短, Python当歌!
俺: http://zoomquiet.io
授: http://creativecommons.org/licenses/by-sa/2.5/cn/
怒: 冗余不做,日子甭过!备份不做,十恶不赦!
KM keep growing environment culture which promoting organization learning!

-- 
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 [email protected].
To post to this group, send email to [email protected].
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