I believe that Graal can (or soon will be able to) target both python and 
javascript.  What I'm not sure about yet is whether you could write in 
python and output javascript.  It may be that you would have to write in 
java and then you could output either python or javascript (see, e.g., 
https://www.graalvm.org/reference-manual/native-image/).  That limitation 
would be a non-starter for me.

On Wednesday, December 16, 2020 at 11:27:06 AM UTC-5 Edward K. Ream wrote:

> This Engineering Notebook post considers strategies for implementing the 
> crucial parts of Leo in javascript. leojs issue #9 
> <https://github.com/boltex/leojs/issues/9> recaps what must be done. The 
> following must be present in leojs 0.1:
>
> - Leo's Position and VNode classes,
> - Outline-oriented undo,
> - Outline-oriented search.
>
> That's a lot of complex code!
>
> True, leojs is worth any amount of work. However, it would be stupid to 
> dive into coding! This morning I considered some cute possibilities for 
> doing significant parts of the work in python. Then I thought to google: 
> "python to javascript" :-)
>
> One of the first hits was this overview 
> <https://www.infoworld.com/article/3209651/how-to-convert-python-to-javascript-and-back-again.html>,
>  
> which leads to:
>
> - JavaScripthon <https://github.com/metapensiero/metapensiero.pj>: a 
> Python 3 to ES6 JavaScript translator.
> - RapyScript <https://github.com/atsepkov/RapydScript>: pre-compiler for 
> JavaScript.
>   The syntax is very similar to Python but allows JavaScript as well.
> - Transcript <http://www.transcrypt.org/>: compile python to JS.
> - Pscript <https://github.com/flexxui/pscript>: the compiler part of flexx 
> <https://flexx.readthedocs.io/en/stable/index.html>.
>
> *Summary*
>
> This has been a much shorter post than I first imagined :-) One or more of 
> the tools listed above will likely suffice. A little googling pays off!
>
> leoInteg requires Leo's bridge to provide most of Leo's functionality. The 
> communication between Leo's bridge and leoInteg is fraught with 
> difficulties. Transcribing the essentials of Leo's core into JS will 
> eliminate many of those difficulties.
>
> Besides transliteration, other problems will surely arise. Félix and I 
> will deal with those problems as they arise. Time to evaluate transpilers!
>
> 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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/965cc53d-3bbe-4fcb-8995-f23ed92ab1can%40googlegroups.com.

Reply via email to