Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

A PyScript shell in the browser (i.e. PyScript support eval) #14

Open
2 of 4 tasks
almarklein opened this issue Mar 21, 2018 · 0 comments
Open
2 of 4 tasks

A PyScript shell in the browser (i.e. PyScript support eval) #14

almarklein opened this issue Mar 21, 2018 · 0 comments

Comments

@almarklein
Copy link
Member

@almarklein commented on Sat Aug 22 2015

If PyScript can compile itself, we can generate a JS implementation of the PyScript transpiler, which means we can allow people to write PyScript directly in HTML docs, support eval(), and have a PyScript terminal. Sweeeet ...

To get there:

  • Probably make PyScript a bit more Pythonic (e.g. operators). At least enough to ...
  • Run PyStone on PyScript.
  • We need a pure Python implementation for the ast module (use gh actions #54).
  • All of the PyScript transpiler must be made pyscript-compatible.

This functionality is not really necessary from the point of view of flexx.ui, but it would open a lot of new possibilities, and brings PyScript into the same ballpark as Brython and Skulpt.


@almarklein commented on Thu Nov 12 2015

Some progress here with commonast.py and more Pythonic PyScript (#53). Biggest obstacle now is a pure Pyhon ast parser (#54).


@datnamer commented on Thu Nov 12 2015

PyScript, and this whole project is amazing. If you get this working with an accompanied blogpost, it could be huge.

My dream is to be able to distribute python written client side html documents with interactive plots and analysis.

ipython (creating custom widgets, dashboard in python syntax etc, cc @ellisonbg ) and knitpy (cc @JanSchulz) could also likely benefit from self run pyscript.


@jankatins commented on Thu Nov 12 2015

Dashboards and widgets in python and compiled to js would be cool! I really hate that to hack the notebook, I have to know JS :-/ But that doesn't so much depend on a full self-running py2js compiler but any py2js compiler...

@datnamer what you envision is a python environment in the browser, kind of like python.exe or pypy... For this to happen, you not only need to support the whole python language but also support native libs, as I think that some libs for IPython / Jupyter use native libs... I'm no sure how much of IPython/Jupyter relies on such libs (json?), but the scipy stack does a lot (numpy, pandas, matplotlib,...), so running a notebook with these libs installed is probably not gonna happen soon :-(


@datnamer commented on Thu Nov 12 2015

@JanSchulz Right, but the native libs can be compiled web assembly with emscripten, along with Numba code. Then there could be interop with JS typed arrays to make things easier.

But I agree this is a bit of a stretch :)


@almarklein commented on Thu Nov 12 2015

I should probably stress that PyScript is really just a way to write JS in a Pythonic way. This is where PyScript differs from Brython, pypyjs and friends (and this is why PyScript is way faster than Brython). Therefore, having an in browser PyScript shell would open up interesting possibilities, but I don't envision people doing data science in it; the repl would probably not feel Pythonic enough.


@datnamer commented on Fri Nov 13 2015

Understood thanks.


@datnamer commented on Sun Nov 15 2015

Another potential cool use of this: https://github.com/cfelde/cljs4excel
python reply in excel :P


@almarklein commented on Sun Nov 15 2015

haha

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant