3 ms·
How does this compare to Brython? [0] Brython uses: <script type="text/python"> [0] https://brython.info/ https://brython.info/
by eddyg 4y ago
How does this compare to Brython? [0]
Brython uses:
<script type="text/python">
[0] https://brython.info/ https://brython.info/
- ordiel 4y agoFinally!!! The only other comment I've seen mentioning brython, heck I have even written WebComponents using the thing, how comes almost no one has cross paths with it... I guess in part JS won the web battle because (in resignation) most people just accepted (as some others have said in their comments that) it was the only choice... of course brython transpiles to JS yet it has exactly that spirit of "lets make things fun again"
- sparks1970 4y agoI have done a lot of experimenting with Brython and like you, I would expect it to be more popular. Pierre (the author and primary maintainer) is amazing but something holds it back from large scale adoption. I can only list my reasons for not adopting it into my for-work projects: * Slow start up times (a second or half a second) for anything that includes the python standard library. * Avoiding the standard library means writing javascript helper functions so you end up needing to know and write javascript anyway. In some ways Brython feels like "Python for javascript programmers" * Integration with browser for error messages isn't as convenient as for javascript where I can "click into" the js file in dev tools. * Pierre is brilliant but it is clear that it is a labor of love. He doesn't want corporate sponsorship or anything that would make it a job for him. He works tirelessly on Brython, the man is a machine, but it really is just him having fun. What happens when its not fun any more? There is no obvious succession. The lack of corporate sponsorship/marketing means that the community is small, there's no "virtuous cycle" of adoption. I hope the above doesn't mis-represent Pierre, this is my perception only. Lastly, in recent years many people came to python for the scientific/ML libraries which don't work with Brython. To these people, a python without numpy is no python at all?
- forgotpwd16 4y agoSite says this is based on Pyodide which is CPython compiled to WASM (similarly is Coldbrew). Brython (similarly is Skulpt but which lacks DOM manipulation) is a new implementation with parser & built-in objects written in JS and standard library is Python's converted to JS. There's also Transcrypt that opts for integration with JS libraries instead. I expect PyScript to be more compatible (which includes libraries written not in Python, such as numpy, pandas, etc), Brython be more flexible (but cannot support anything not in Python), and Transcrypt should've the best performance (when one wants something be used like JS).
- codedokode 4y agoTranspiling to JS is actually a good idea because one could benefit from JIT (as long as your variable types are not too dynamic). UPD: I looked at the compiled code and currently it is unlikely to be optimized. Also this page [1] shows that the code run in browser can be up to 1000 times slower than in a native Python interpreter. [1] https://brython.info/speed_results.html https://brython.info/speed_results.html
- kervarker 4y agoThe figures in this page are relative to base 100 for CPython. Sometimes Brython is faster (value < 100), sometimes slower (value > 100). The worst value is 12 times slower.