Live data from Hacker News

A Python 3 implementation for client-side web programming

brython.info

1–10 of 120 posts

Re: A Python 3 implementation for client-side web programming

#2
I love python and this is awesome. But I HATE magic global objects. 'ctx' seems to be at the heart of everything but is never explicitly passed into the scope or imported.

This should really be fixed.

Also "from html import *"? No no no. Never, not even once.

Re: A Python 3 implementation for client-side web programming

#6

I love python and this is awesome. But I HATE magic global objects. 'ctx' seems to be at the heart of everything but is never explicitly passed into the scope or imported. This should really be fixed. Also "from html import *"? No no no. Never, not even once.

The ctx global and 'from html import *' are just part of the demo code. Look at line 289 of the HTML file where ctx is initialized. It's not some magic thing baked into Brython, it's just sample code. Of course you could write either of these in any way you prefer.

Re: A Python 3 implementation for client-side web programming

#7
Skulpt, PyJS and this, all good and fun experiment but all do the first 60% then they linger around. I wish they all started talking to each other and just got one single project to 90%.

Have any of these been used in production with any success. It seems like PyJS had most traction?

Re: A Python 3 implementation for client-side web programming

#8

I love python and this is awesome. But I HATE magic global objects. 'ctx' seems to be at the heart of everything but is never explicitly passed into the scope or imported. This should really be fixed. Also "from html import *"? No no no. Never, not even once.

The ctx global and 'from html import *' are just part of the demo code. Look at line 289 of the HTML file where ctx is initialized. It's not some magic thing baked into Brython, it's just sample code. Of course you could write either of these in any way you prefer.

A demo of a new way to use a programming language shouldn't be full of these "Oh, that crap is just for the demo, it would look better in practice." It's a programming language demo, show us something that makes us want to use it.

Re: A Python 3 implementation for client-side web programming

#9
Link to console demo from that page is broken, sadly.

edit: looks like if you remove "_en" then you get to the right place, http://www.brython.info/tests/console.html

Looks like pyjs, in that it has python syntax but JavaScript semantics, for example numbers turn into doubles here (but should be arbitrary-precision ints in Python).

Post reply on HN