Python needs to be natively supported as a scripting lang in browsers. Google, MS, Firefox - make it so!
As much as I like Python, I don't think this is the right approach. What browsers need to do is to have a machine-level bytecode, so that they can download whatever interpreters are needed to run the scripting code the page uses. Then pages can be written in whatever language the developer feels is best. This is the real potential of something like Native Client - although it doesn't look like that potential will be…
Brython - Python to Javascript translator
41–50 of 71 posts
Re: Brython - Python to Javascript translator
#42Earlier quoted context omitted.
As much as I like Python, I don't think this is the right approach. What browsers need to do is to have a machine-level bytecode, so that they can download whatever interpreters are needed to run the scripting code the page uses. Then pages can be written in whatever language the developer feels is best. This is the real potential of something like Native Client - although it doesn't look like that potential will be…
Pages downloading and executing things just reminds me of ActiveX from the late 90s. I think South Korea still relies on the technology for their home-grown version of SSL.
Re: Brython - Python to Javascript translator
#43Python needs to be natively supported as a scripting lang in browsers. Google, MS, Firefox - make it so!
Re: Brython - Python to Javascript translator
#44However, as others are noting things that are missing that we pythonistas can't live without (generators, classes, etc)- I feel it is worth a reminder that Javascript 6 (Harmony) is going to have a lot of these built in.
Brendan's slides have a great overview of what's to come (and makes me hope writing JS outside of CoffeeScript will become more bearable since I'm so spoiled by Python:
Re: Brython - Python to Javascript translator
#45Wow! This is so awesome. This has been tried before, but I don't remember why it never succeeded. I wonder if this can get the appropriate community to make it a decent alternative compared with TypeScript and CoffeeScript - or maybe I'm missing something here?
https://github.com/jashkenas/coffee-script/wiki/List-of-lang...
For many of the offerings in the list, the problem, IMHO, is the lack of a complete story.
If you base it on an existing language - in this case, Python - you would expect a full implementation of the language, or at least a good portion of the core language features. The benefits of an existing language are often familiarity and the potential to reuse existing code. With partial implementation, you can hardly gain these. And the downside of extra abstraction quickly outweighs any superficial perception of familiarity.
If you create a new language, you have to strike a good balance between language features and interoperability. You need to bring enough new things to the table to make it worthwhile to learn, adopt and support it, and yet you can't overstate the importance of a good interoperability story unless you can afford to completely ignore the JavaScript ecosystem. See DART.
Re: Brython - Python to Javascript translator
#46It has support for many of the Python niceties: classes, list comprehensions, positional arguments, and so on. Interesting experiment, but I ended up thinking that Python is not the best language for the browser.
Re: Brython - Python to Javascript translator
#47Re: Brython - Python to Javascript translator
#48Wow! This is so awesome. This has been tried before, but I don't remember why it never succeeded. I wonder if this can get the appropriate community to make it a decent alternative compared with TypeScript and CoffeeScript - or maybe I'm missing something here?
Once brython gets some key missing Python features (classes, list comprehensions, lambdas), and some libraries for it, I think it has huge potential.
Re: Brython - Python to Javascript translator
#49Python needs to be natively supported as a scripting lang in browsers. Google, MS, Firefox - make it so!
As much as I like Python, I don't think this is the right approach. What browsers need to do is to have a machine-level bytecode, so that they can download whatever interpreters are needed to run the scripting code the page uses. Then pages can be written in whatever language the developer feels is best. This is the real potential of something like Native Client - although it doesn't look like that potential will be…
There is no indication that browsers are going to standardize on a VM (let alone NaCl) any time soon.
If someone just stopped bikeshedding and did Python in the browser, there's no reason a machine-level bytecode or whatever couldn't be implemented later.
Re: Brython - Python to Javascript translator
#50Python needs to be natively supported as a scripting lang in browsers. Google, MS, Firefox - make it so!
Python is a really big and complicated language to include in Browsers. And think of the version hell: If you think Pyhthon 3 compatibility is apain, imagine if we still had to use Python 2.2 on Firefox or something like that.