Why don't they implement Python and Ruby on the web browsers?
stackoverflow.com
Why don't they implement Python and Ruby on the web browsers?
1–10 of 144 posts
Re: Why don't they implement Python and Ruby on the web browsers?
#2Re: Why don't they implement Python and Ruby on the web browsers?
#3It's what made Javascript such a great fit for nodejs - no big existing libraries of blocking code, and everybody was already accustomed to doing things in an event driven style due to the browser.
Re: Why don't they implement Python and Ruby on the web browsers?
#4One point not in the existing comments is the event driven nature of the browser - even if you're eventually able to have good support for other runtimes in the browser (e.g., you can use Python via the Native Client plugin) most of them have such a large existing codebase of blocking code that I think you'd run into a lot of the same issues that you do now with Ruby & EventMachine, or Python & Twisted. It's what mad…
"no big existing libraries of blocking code" (for js) just translates to "no big existing libraries", period.
It's not like javascript has any special support for non blocking code --or that any code that does anything useful and specific (ie. not just handling out work to be done and callback/returned but actually doing the work) can ever be non blocking.
Re: Why don't they implement Python and Ruby on the web browsers?
#5I remember being impressed by a Microsoft project[1] a few years ago that did exactly this, it seems it never took off. [1] http://visitmix.com/labs/gestalt/
Re: Why don't they implement Python and Ruby on the web browsers?
#6One point not in the existing comments is the event driven nature of the browser - even if you're eventually able to have good support for other runtimes in the browser (e.g., you can use Python via the Native Client plugin) most of them have such a large existing codebase of blocking code that I think you'd run into a lot of the same issues that you do now with Ruby & EventMachine, or Python & Twisted. It's what mad…
Similarly, if you were to put Python or Ruby in the browser you would necessarily need them to have some sort of DOM APIs (or there wouldn't be very much they could do in the browser). Those DOM APIs would once again be written in an event-based way.
The "big existing libraries of blocking code" would be inconsequential since they would for the most part have nothing to do with the kinds of things you are doing on the web. Who cares if theres some file reading code in Ruby that is blocking? You don't read files in browsers. Think of the opposite proposal: if I went and implemented these same libraries in the same blocking fashion in JavaScript, it wouldn't all of a sudden become a worse language for the browser.
Re: Why don't they implement Python and Ruby on the web browsers?
#7Re: Why don't they implement Python and Ruby on the web browsers?
#8I can't stand this willfully defeatist attitude. It's also not restricted to stack-overflow participants -- this position is pervasive at Mozilla.
Why can't we have a standardized generic bytecode and VMs to run it? Why should the web be locked to a single language forever? Can you imagine if we had locked desktops and mobile only a single implementation language?
Google seems to be the only company actively looking for a solution via NaCL. Most of the web community, on the other hand, regularly opposes efforts to move away from JavaScript as the one true language.
Re: Why don't they implement Python and Ruby on the web browsers?
#9The browsers themselves are already built and powered using JS. Maintaining a comprehensive API at the speed that web tech advances in more than one client-side scripting language would be hellish -- browser vendors already have enough trouble agreeing on CSS and JS standards. The Stack Overflow article already raised a number of good reasons why not. Not sure why this is garnering so much attention from HN.
I just wish they decoupled javascript engines and browsers, made a language agnostic api spec for the DOM, and just let html tags require a language ref and the browser would be expected to try to find a runtime on the local machine or ask the user to install it. The monopolistic nature of javascript in client web browsing is bad for innovation.
Re: Why don't they implement Python and Ruby on the web browsers?
#10The top comment states that any other options are impossible: "At this point we must concentrate on improving the language." I can't stand this willfully defeatist attitude. It's also not restricted to stack-overflow participants -- this position is pervasive at Mozilla. Why can't we have a standardized generic bytecode and VMs to run it? Why should the web be locked to a single language forever ? Can you imagine if…
I realize that Python and Ruby would be standard and open but people still fear the possible fragmentation.