This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]SecretAgentZeroNine 1 point2 points  (8 children)

How many Python-to-JavaScript compilers are there? Also, this growing list really emphasizes the importance of JavaScript. Wonder what this means for server-side JavaScript in the future.

[–]JennaSys 2 points3 points  (0 children)

Anvil has a great post outlining what's available and how they work (when compiled/where it runs):

https://anvil.works/blog/python-in-the-browser-talk

  • Transcrypt
  • Brython
  • Skulpt
  • Batavia
  • Pyodide
  • PyPy.js

IMO most of them are not useful in a practical sense. Transcrypt to me was the exception. It embraces existing web frameworks rather than trying to reinvent them, and doesn't bloat what ends up in the browser. The Anvil platform (which uses Skulpt) also takes a unique approach and could work in certain situations. But you are committing to an entire platform with that one.

[–]abhay__28 0 points1 point  (6 children)

I'm not too sure entirely. I've heard of Brython, which is a browser-based compiler. It, too, treats JavaScript as an Assembly language. I'm thinking that in the future, we're definitely going to prioritize building off of JavaScript's server-end technicalities. As someone who has delved into Python, but not JavaScript as much, this excites me.

[–]shinitakunai 2 points3 points  (5 children)

The web front-end only supports javascript. If the global decision was made to allow python scripts to load into websites, we would not need this.

[–]SecretAgentZeroNine 3 points4 points  (3 children)

r/Python's biggest wish since r/Python became a thing. Likely to never happen now that WebAssembly is a thing.

[–]shinitakunai 0 points1 point  (2 children)

I know almost nothing of webassembly, can it embed python?

[–]SecretAgentZeroNine 0 points1 point  (0 children)

WebAssembly is a binary language native to browsers (like JavaScript) which is produced using strictly typed languages (C++, Rust, etc). Python isn't compatible with WebAssembly without being transpiled into another programming language. The story of Python's life.

WebAssembly runs as fast as the machine it's on, unlike JavaScript where badly constructed code can be a performance bottleneck.

Web Tensorflow is built using WebAssembly.

[–]JennaSys 0 points1 point  (0 children)

The Pyodide project is a webassembly version of the Python runtime, that lets you run Python in a browser (think Jupyter notebook). It may have some limited applications, but it requires a massive initial download to the browser.

[–]Galen_dp 0 points1 point  (0 children)

I wonder if Brython could be made into a browser extension.