For the curious, here's <i>eight</i> other fun implementations of "Python in JavaScript" to explore:<p><a href="https://github.com/jashkenas/coffee-script/wiki/List-of-languages-that-compile-to-JS#python" rel="nofollow">https://github.com/jashkenas/coffee-script/wiki/List-of-lang...</a>
The way they position Brython is pretty off-putting and kind of confuses the issue.<p>CoffeeScript page: "CoffeeScript is a little language that compiles into JavaScript."<p>Brython page: "Brython is designed to replace Javascript as the scripting language for the Web."<p>Maybe that's the end goal, but the reality is far from it. Of course JS is still required, and of course the Python gets compiled into JS.<p>Finally, the approach seems a bit off. I would think it would be better for the Python to be compiled with a pre-processor, not done on the client.
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%.<p>Have any of these been used in production with any success. It seems like PyJS had most traction?
IMHO, This comment page is an interesting example to how unreasonably emotional programmers can be about their technology.<p>It looks as though, some developers are almost insulted by the idea, that someone tried to replace a language that is so commonly accepted, and that they have worked so hard to master.<p>This also happens in many other fields of science/technology, but I'm always surprised to see it among programmers who are considered very practical people.
I love python and this is awesome. But I <i>HATE</i> magic global objects. 'ctx' seems to be at the heart of everything but is never explicitly passed into the scope or imported.<p>This should really be fixed.<p>Also "from html import *"? No no no. Never, not even once.
I do like the idea, but it inevitably suffers from the same flaw that afflicts all other compile-to-js libraries: making sense of errors will still require knowledge of how the underlying javascript works.<p>Perhaps a development plugin for Chrome would allow debugging in python?
While I would like to see Python in the browser, this isn't it. I would still prefer coffeescript or dart over brython. Both languages aren't that hard to learn, and brython is lacking many features which would make Python more pleasant to deal with...<p>However, because of performance reasons, the very features that make python unique, especially the type system, are more javascript-like than python-like.<p>What I would like to see is a Python-implementation which is mostly feature complete, along the lines of emscripten, but still has direct access to the dom or other javascript objects.
It's a really nice demo, and I really like the idea so far (although precompiling to JS would be awesome), but I really don't see Python taking over Javascript as the scripting language.<p>It's way nicer in my opinion, but I think its fussy white space is likely to be an issue for this use case. All the large Javascript libraries get minified etc, and Python really isn't open to that sort of stuff. It's a great language to use normally, but I don't see it replacing Javascript. I'd much rather write in Python and compile to Javascript though.
Link to console demo from that page is broken, sadly.<p>edit: looks like if you remove "_en" then you get to the right place, <a href="http://www.brython.info/tests/console.html" rel="nofollow">http://www.brython.info/tests/console.html</a><p>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).
As such, it is theoretically possible to support any scripting language on client side environment. I hope browsers will start shipping with multiple scripting engines in the future. JavaScript is not the best scripting language out there.
I don't mean to rain on anyone's parade, but how come opalrb hasn't gotten this much attention on HN (although it is a bit different from this)?<p>There seems to be this <i>gah a fucking ruby developer/thing, again</i> motif going on around HN (was hurtful at first) that makes it harder to discover cool and new ruby things!<p>P.S: although Python is nit my goto language, I still find this brilliant!
I don't get the point why should I use Python to run Javascript.<p>JS has been in use around the web for a long time now and I don't see the need why should I go about using Python for the very same? Doesn't one language has a purpose of it's own?<p>If it wasn't the case, then people would have worked on creating a unified language for all our needs.
Why the hate on JavaScript? I know it's not the most elegant language in the world, but do we really need this? Instead of a program "x" run in "y", how about we just expand our horizons a bit and learn another language with different paradigms?<p>Python is great for some stuff, but let JS do what it does.
Most disappointing part of most -> js languages is that they adopt the async nature of JavaScript, thus making them pretty dissimilar from their native environments. Is it that difficult to rewrite a sync workflow to an async one by the interpreter?
Very impressive work!<p>Issues with the examples:<p>I got nobody walking on the 3d walker (Chrome on Ubuntu); also it was psychedelic fun clicking into negative territory on the pie chart.
Being a front-end developer myself, I find such an idea a complete waste for people like me. We have put in a lot our time understanding how JS functions and most of the interactive interfaces you come across use jQuery. If Brython were to become a standard, then would you be writing a new JS library that would allow me work with DOM faster and in a better fashion?