Live data from Hacker News

Brython: an implementation of Python 3 running in the browser

github.com

1–10 of 76 posts

Re: Brython: an implementation of Python 3 running in the browser

#2
I discovered this about a month ago, and it deserves to go up to the sky.

The GitHub page is linked at the end.

Some articles/content that relates to this ([4] is pretty cool and definitely check it out, so is [6]):

[1] https://brython.info/static_doc/en/intro.html

[2] https://towardsdatascience.com/run-python-code-on-websites-e...

[3] https://stackabuse.com/an-introductory-guide-to-brython

[4] https://rayluo.github.io/brython-project-template/

[5] https://github.com/rayluo/brip

[6] https://github.com/brython-dev/brython/wiki/Brython%20in%20t...

[7] https://academy.cs.cmu.edu/ (CMU's academy website runs on Brython)

Here's the GitHub page: https://github.com/brython-dev/brython/

And the Wiki, for examples -https://github.com/brython-dev/brython/wiki/Brython%20in%20t...

If you're familiar with all that's going on with the source code or at least some parts of it, and have time to spare, do take the time out to contribute to this project. It's pretty insane what they're building.

You can join their Google Groups forum here: https://groups.google.com/forum/?fromgroups=#!forum/brython

Re: Brython: an implementation of Python 3 running in the browser

#3
It's a great project! I use it to power the Python interpreter for an in-browser backend of an app I'm working on.

I wrote a bit more about my experience using it (and a guide for others) here: https://datastation.multiprocess.io/blog/2021-06-16-language....

My biggest gripe is that so far I haven't been able to get good stacktraces out of it on errors. It also wraps all objects in custom Brython types that you have to rewrap in Python types to do stuff like get `.keys()` on JavaScript objects.

Re: Brython: an implementation of Python 3 running in the browser

#4

It's a great project! I use it to power the Python interpreter for an in-browser backend of an app I'm working on. I wrote a bit more about my experience using it (and a guide for others) here: https://datastation.multiprocess.io/blog/2021-06-16-language... . My biggest gripe is that so far I haven't been able to get good stacktraces out of it on errors. It also wraps all objects in custom Brython types that you have…

Yeah. Like I said, it could really do with more contributors who can work on these issues and add keep adding features. rayluo who is a major contributor (developed brip to support using regular PyPi packages with brython), for example, works at Microsoft, and most probably does this in his spare time. More people like this can help bring Brython up even more, so there's a majority coverage for what JS can do, with Brython. Joining their Groups forum really shows you how much they're working and how much they're dedicated to this. This is only going to keep growing, if more devs and contributors hop onto the project even in their spare time.

Re: Brython: an implementation of Python 3 running in the browser

#5
Brython has been around a long time, at least 7 or 8 years. While I love Python and I'm not a particularly big JS fan, I feel like if Brython didn't really make a dent before ES6 and TypeScript, then it will be really hard to do it now. Does anyone know what the biggest Brython project/app is? Can we see it in production other than a simple hello world?

Re: Brython: an implementation of Python 3 running in the browser

#6
post #5

Brython has been around a long time, at least 7 or 8 years. While I love Python and I'm not a particularly big JS fan, I feel like if Brython didn't really make a dent before ES6 and TypeScript, then it will be really hard to do it now. Does anyone know what the biggest Brython project/app is? Can we see it in production other than a simple hello world?

Yeah, it has been there for quite some time, but has really started getting off the ground in about mid-late 2019 which is strange, since like you mentioned, the advent of TS. But slowly a lot of interest has been brewing over it, it's growing faster than ever, and has been attracting users/contributors a LOT only since the start of last year.

https://academy.cs.cmu.edu/

This is Carnegie Mellon's academy website, running on Brython. See the Brython Wiki page on their GitHub, they got a list there.

Re: Brython: an implementation of Python 3 running in the browser

#7
This project will transpile python code to JavaScript code instead of something WASM-based, like pyodide [0].

What are there the performance and usability consequences of each approach (py to js vs. py to wasm)?

[0] https://github.com/pyodide/pyodide

Re: Brython: an implementation of Python 3 running in the browser

#8
post #2

I discovered this about a month ago, and it deserves to go up to the sky. The GitHub page is linked at the end. Some articles/content that relates to this ([4] is pretty cool and definitely check it out, so is [6]): [1] https://brython.info/static_doc/en/intro.html [2] https://towardsdatascience.com/run-python-code-on-websites-e... [3] https://stackabuse.com/an-introductory-guide-to-brython [4] https://rayluo.github.…

From the site guidelines: "Show HN is for something you've made that other people can play with."

Re: Brython: an implementation of Python 3 running in the browser

#9

This project will transpile python code to JavaScript code instead of something WASM-based, like pyodide [0]. What are there the performance and usability consequences of each approach (py to js vs. py to wasm)? [0] https://github.com/pyodide/pyodide

Pyodide still involves writing JS (literally). Brython just needs you to know the simple basics of JS (since the syntax is similar), and you're good to go with pure Python from there on.
Post reply on HN