-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Visibly transpile files feature [PLANNING ISSUE] #7
Comments
Looks like others have thought of layers on top of RapydScript-NG. It would be wise to align with them! https://github.com/jonschull/Lyte @jonschull I'm reading thru your project and got interested enough to install Python3.6! |
I'd love to get aligned. (And have been meaning to write you too).
Indeed, I'd appreciate help.
Today's commit
<https://github.com/jonschull/Lyte/commit/7d0c041f8f64626b106e910d3442b52709793a8e>successfully
imports pure python files and runs them in the browser. (Needs a local
server, but that's built in live preview in the Brackets and Atom
editors.)
However, imports fail because module doesn't exist in any of the import
directories: __stdlib__"
I believe you've solved this problem. Can you help me figure the solution?
[email protected] cell: 585-738-6696 skype:jonschull
…On Fri, Jun 8, 2018 at 1:57 AM, Sebastian Silva ***@***.***> wrote:
Looks like others have thought of layers on top of RapydScript-NG. It
would be wise to align with them!
https://github.com/jonschull/Lyte @jonschull
<https://github.com/jonschull> I'm reading thru your project and got
interested enough to install Python3.6!
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#7 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AADRqXH7efB5h5OyEzrVlC6BUgQm7Da8ks5t6hJVgaJpZM4Tz47u>
.
|
Hi @jonschull sorry I took so long to respond. I am humbled others find the project useful. I didn't really solve the importing issue, what I do is directly manipulate the Jappy has a way to access the local filesystem by exposing it over WebDAV. But it only exposes directories under Currently this is limited in that we have not implemented a way to browse subdirectories and subtleties regarding URL base paths for relative links. I did ask Kovid about how I should implement it and he provided a response at kovidgoyal/rapydscript-ng#114 . But I have'nt dug into this yet. Perhaps his pointer could help us have a universal import mechanism? How are you exposing the filesystem? I really like the interface |
I got it to work last night
by
looking at your patc
h!
See https://glitch.com/edit/#!/lyte-0-1
By the way, please let me know what the parameter before options{...}
does. I modelled it on your "tag.title" , but it doesn't seem to do
anything!
…On Thu, Jun 14, 2018 at 2:01 AM Sebastian Silva ***@***.***> wrote:
Hi @jonschull <https://github.com/jonschull> sorry I took so long to
respond. I am humbled others find the project useful.
I didn't really solve the importing issue, what I do is directly
manipulate the file_data object within Rapydscript: https://github.com/
somosazucar/Jappy/blob/master/webapp/js/code_editor.tag.html#L1187 - This
solution is inadequate because it only works at the moment with files
already open in the editor (not the ones in the filesystem).
Jappy has a way to access the local filesystem by exposing it over WebDAV.
But it only exposes directories under ~/Workspace/ (if you add #somename
to your URL, you'll be editing ~/Workspace/somename/ and the Folder icon
will display a drop down menu with the files in the directory.
Currently this is limited in that we have not implemented a way to browse
subdirectories and subtleties regarding URL base paths for relative links.
I did ask Kovid about how I should implement it and he provided a response
at kovidgoyal/rapydscript-ng#114
<kovidgoyal/rapydscript-ng#114> . But I have'nt
dug into this yet. Perhaps his pointer could help us have a universal
import mechanism?
How are you exposing the filesystem? I really like the interface wsgidav
offers.
Thanks again, glad to share enthusiasm!
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#7 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AADRqd4BaJhvMM0cNQ4HoRV3ojDMYBu8ks5t8fxJgaJpZM4Tz47u>
.
|
Hi @jonschull I had a read at your source code at https://glitch.com/edit/#!/lyte-0-1 and I am not sure. With regard to importing I think this Do note that a key difference of RapydScript vs Python is that imports happen at compile time in RS, whereas Python does them dynamically. I do think differences between There are other even more Pythonic transpilers, check out Transcrypt or Javascripthon (my favorite). Jappy uses RapydScript because we're interested in having the browser do the compilation. Both Transcrypt and Javascripthon have Python do the parsing and transpiling. |
I think I have a working approach now.
see https://glitch.com/edit/#!/lyte
In the HTML file pyInstall compiles specified files and copies them into
the virtual filesystem (as pyj).
Although I had to tweak it for glitch
A given project has an .html and .py of with the same root name.
To create a new project rename the .html and creaet a new .py
the .py file can then import any pyInstalled files it wants.
[email protected] cell: 585-738-6696 skype:jonschull
Founder,
e-NABLE <http://e-NABLE.org>: volunteers worldwide making free, 3D printed
prosthetics
Innovation Fellow, JMK Innovation Fund
<http://www.jmkfund.org/awardee/jon-schull/>
…On Sat, Jun 16, 2018 at 1:20 AM, Sebastian Silva ***@***.***> wrote:
Hi @jonschull <https://github.com/jonschull> I had a read at your source
code at https://glitch.com/edit/#!/lyte-0-1 and I am not sure.
I'm passing options to the create_embedded_compiler method and then just
passing code to the resulting compiler object.
With regard to importing I think this mechanism is flexible but limited.
I'd like to try using a bundler such as https://github.com/CompuIves/
codesandbox-client/tree/master/packages/sandpack or https://medium.com/@
ericsimons/introducing-turbo-5x-faster-than-yarn-npm-and-
runs-natively-in-browser-cc2c39715403 to import javascript modules. A
preconfigured version of such bundler could take care of importing
(loading/transpiling) the RapydScript code. This would simplify Jappy.
Do note that a key difference of RapydScript vs Python is that imports
happen at compile time in RS, whereas Python does the dynamically.
I do think differences between .pyj and .py languages are too big to mask
so I keep the two filenames different to avoid confusion.
There are other even more Pythonic transpilers, check out Transcrypt or
Javascripthon <https://github.com/azazel75/metapensiero.pj> (my
favorite). Jappy uses RapydScript because we're interested in having the
browser do the compilation. Both Transcrypt and Javascripthon have Python
do the parsing and transpiling.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#7 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AADRqbogGnnWdVZ39uyck-FrQMq_iagsks5t9JWygaJpZM4Tz47u>
.
|
Currently Jappy compiles .pyj files tranparently and puts them in
.index.html
.We should:
Agree to put .pyj files under /srcThe text was updated successfully, but these errors were encountered: