Skip to content
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

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

Closed
2 of 4 tasks
almarklein opened this issue Aug 22, 2015 · 9 comments
Closed
2 of 4 tasks

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

almarklein opened this issue Aug 22, 2015 · 9 comments

Comments

@almarklein
Copy link
Member

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 (A pure Python ast parser #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 almarklein changed the title PyScript support eval A PyScript shell in the browser (i.e. PyScript support eval) Nov 12, 2015
@almarklein
Copy link
Member Author

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

@datnamer
Copy link

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
Copy link

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
Copy link

@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
Copy link
Member Author

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
Copy link

Understood thanks.

@datnamer
Copy link

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

@almarklein
Copy link
Member Author

haha

@almarklein
Copy link
Member Author

Issue moved to flexxui/pscript #14 via ZenHub

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants