TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

A Python 3 implementation for client-side web programming

278 pointsby spicavigoabout 12 years ago

25 comments

cmbausabout 12 years ago
I can't believe all the negative comments here. Someone has implemented Python in JavaScript. I personally think that is incredible.
评论 #5807463 未加载
评论 #5807386 未加载
评论 #5812713 未加载
评论 #5807720 未加载
评论 #5807987 未加载
jashkenasabout 12 years ago
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>
评论 #5807766 未加载
toddmoreyabout 12 years ago
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.
评论 #5807978 未加载
评论 #5807329 未加载
rdtscabout 12 years ago
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?
idocoabout 12 years ago
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.
评论 #5807823 未加载
评论 #5807521 未加载
评论 #5813897 未加载
rachelbythebayabout 12 years ago
It's too bad it didn't replace it on this page. Without JavaScript, this page is blank.
评论 #5807342 未加载
评论 #5807296 未加载
iandanforthabout 12 years ago
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.
评论 #5807165 未加载
评论 #5809913 未加载
评论 #5807115 未加载
md224about 12 years ago
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?
评论 #5807270 未加载
评论 #5807565 未加载
ggordanabout 12 years ago
Previous discussion: <a href="https://news.ycombinator.com/item?id=5133047" rel="nofollow">https://news.ycombinator.com/item?id=5133047</a>
评论 #5807228 未加载
bayesianhorseabout 12 years ago
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.
mcintyre1994about 12 years ago
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.
azakaiabout 12 years ago
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).
评论 #5807673 未加载
marcamillionabout 12 years ago
I love this. I wish someone would do this for Ruby.<p>Not CoffeeScript - I want to be able to write Ruby that manipulates DOM objects.
评论 #5807628 未加载
评论 #5807586 未加载
评论 #5809797 未加载
anurajabout 12 years ago
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.
spoilerabout 12 years ago
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!
评论 #5807949 未加载
jfergeabout 12 years ago
Interesting, but it is little more than a novelty.
aniketpantabout 12 years ago
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.
评论 #5808084 未加载
jameswburkeabout 12 years ago
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.
评论 #5807641 未加载
MatthewPhillipsabout 12 years ago
Most disappointing part of most -&#62; 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?
评论 #5807562 未加载
评论 #5807559 未加载
sengstromabout 12 years ago
If you want to X to replace Y, shouldn't first order of business be letting me know why?
leephillipsabout 12 years ago
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.
评论 #5807729 未加载
tudorconstantinabout 12 years ago
Is it possible to minify and obfuscate python code?
评论 #5807232 未加载
aniketpantabout 12 years ago
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?
xtcabout 12 years ago
Why not both?
vinitool76about 12 years ago
What is even the need? And it needs JS to work. Not so convincing demo!
评论 #5807303 未加载