Live data from Hacker News

Why don't they implement Python and Ruby on the web browsers?

stackoverflow.com

1–10 of 144 posts

Re: Why don't they implement Python and Ruby on the web browsers?

#3
One 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 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?

#4

One 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…

That doesn't make any sense. Javascript libs are just as blocking as any python or ruby lib.

"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?

#5
post #2

I 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/

It's based on IronPython/IronRuby/DLR. I've been to a few PyCons and the CPython-based developers never seemed all that interested in it due to library support, and the majority of work happening on UNIX platforms. At the same time .NET developers didn't know what to do with this great set of tools.

Re: Why don't they implement Python and Ruby on the web browsers?

#6

One 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…

Nothing in these languages prevents them from being event-based or non-blocking. All these languages have perfectly fine callback architectures. Javascript wasn't magically designed to be event-based, its just that the DOM APIs (which have nothing to do with JavaScript) were written in an event-based way because it really couldn't have been done in any other way.

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?

#7
The 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.

Re: Why don't they implement Python and Ruby on the web browsers?

#8
The 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 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?

#9

The 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.

Because we all hate javascript.

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?

#10
post #8

The 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 think the reluctance comes from being burned by Microsoft infusing their own technologies into the web browser in the past.

I realize that Python and Ruby would be standard and open but people still fear the possible fragmentation.

Post reply on HN