Live data from Hacker News

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

stackoverflow.com

91–100 of 144 posts

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

#91
post #71
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 don't understand this fixation on js either. Even more, i don't understand the fixation on html, css and all so called web technologies. Common, web was never designed for the sort of applications we are trying to make it run. We need a totally new approach.

Agreed.

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

#92
post #77
post #9

Earlier quoted context omitted.

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.

> Because we all hate javascript. You only hate JavaScript when you're starting out. When you get to know the language and how to use it properly, you begin to appreciate it in a very unique way. Until you understand what prototypical programming truly is, you don't understand JavaScript.

I don't think you can dismiss someones dislike for a language as "they don't know how to use it". Common, many people have been building applications on client and server for 15+ years using JS and whatever exists on the backend. And 90% of the time, the backend language is better, and has way better tooling.

So you can understand and master JS (including prototypical programming) and still hate it.

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

#93
Quoting a comment under the question:

Language preference aside, the fact that no language has good support in the browser, the server and stand-alone totally baffles me.

I do wonder about this. I don't think the challenge of the task is the only answer. I think - guess - the rest of the answer might be that in practice, most developers focus on one of those, maybe two (most probably server and browser), rarely the three of them. I know first hand that some do work on the three, but they must be rare, seeing the interest in this. Maybe the momentum of the app stores bringing web devs to work on apps could gradually make people more aware of the benefits of having a universal language. Don't get me wrong, I enjoy the variety of languages, but I would be very happy to be able to focus and become proficient at one only language, even if that means giving up on some language specific advantages.

Ironically (given of the context of the comment), javascript might be what comes closest today.

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

#94

Earlier quoted context omitted.

You can, sure. 2 problems: 1) It will undoubtedly be slower than the current JS-quirks optimized VMs. 2) There is a shit-ton of JS on the web that has been tested to work with the current crop of VMs, moving to a new VM almost guarantees breakage. It's the same reason why GNU Screen isn't rewritten despite (supposedly) being a mess.

You're not the first person to posit that adding a new VM "almost guarantees breakage". So what? Keep the old VM, transition to the new one by specifying that's what you're targeting, then deprecate the old VM and eventually lose it altogether. You make it sound like the computing world has never introduced a new version of a language that has implications for the older ones and managed to overcome it. Even the web d…

> You're not the first person to posit that adding a new VM "almost guarantees breakage". So what? Keep the old VM, transition to the new one by specifying that's what you're targeting, then deprecate the old VM and eventually lose it altogether.

That means both VMs will be in the browser together at some point. That is a hard problem, for example because of cross-VM garbage collection (the WebKit thread where Apple refuses to accept Dart into WebKit references some papers on that).

This will cause an immediate slowdown on existing code, and a very large maintenance burden, for example you typically need to optimize fast paths in the DOM for your VM, with two VMs that is double the work, and if the VMs are allowed to communicate - and they can, if they can both access the DOM - then you have three paths to optimize now.

It's possible to migrate from one version of a language to another - say Python 2.x to 3.x. But they are not both running in the same process and communicating directly with a third shared environment like we would have on the web.

I hate to be negative about this, because as engineers we all love technical challenges. But the fact is, it's very hard to do this stuff well. (And it's even harder to standardize it.) We need to be realistic about this: Compiling into JavaScript is the only way we will see other languages on the web for the foreseeable future.

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

#95
post #17

Earlier quoted context omitted.

> JavaScript is locked in. It's too entrenched, it's never going away. Let's just accept that. JavaScript doesn't have to go anywhere, it can run on a shared VM like any other language. > That means that adding additional languages creates a burden. You're now supporting, at minimum 2 VMs. If you're going to support a second VM you better get it positively right. That doesn't proclude doing it, it just means it's not…

> JavaScript doesn't have to go anywhere, it can run on a shared VM like any other language. JS running on a general VM would be slower. That's against the interests of the user. People should stop caring what language it is. If you really don't have the skill required to use Javascript, use something easier for you and get it to compile to JS. I've really never understood developers that bitch and whine about progra…

>If you really don't have the skill required to use Javascript...

So it's a lack of skill that makes JavaScript a poor choice for largescale application development?

No.

Developers like this are a large part of the reason we can't have nice things.

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

#96
post #41

Earlier quoted context omitted.

Why arent browser UI's created using HTML, CSS and JS ?

I think the various Mozilla projects actually do have facilities for this, and that some significant portion of the chrome is done this way. Where browser UIs aren't done this way, though, I suspect it's because the APIs are for components that aren't markup based -- you write the software for the platform with the APIs it provides, or (as I believe Mozilla has done) you write your own platform on top of something el…

"why didn't some universal client based on them take off instead of the web?"

Because you had several companies all fighting to have their desktop platform be the standard. The web slipped in the back door because nobody felt threatened by a hyperlink document publishing system. As such, it was the only platform that was available everywhere. Worse is better.

Interestingly, the web is starting to adopt the old desktop model. If you look at many of the emerging frameworks for web development (talking client side here), they all seem to be loosely based on the work of OpenStep.

It is actually a really great question posed by dman. If the web is suitable for applications, the browser chrome should be one of those such applications.

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

#97
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…

Mozilla is not against a bytecode VM. Mozilla (and the WebKit team minus Google) is against arbitrarily adding new language VMs because they create a major compatibility burden. Remember this: 1) JavaScript is locked in. It's too entrenched, it's never going away. Let's just accept that. 2) That means that adding additional languages creates a burden. You're now supporting, at minimum 2 VMs. If you're going to suppor…

If JavaScript never goes away and no other options are built into the web browser, the web will become irrelevant within 10-15 years.

No language lasts forever (especially not one that evolves as slowly as Javascript does), and tying the web to JavaScript and JavaScript only very obviously dooms the web. Not this year or three years from now, but eventually.

That nobody other than Google is making long-view plans for the future in this regard is somewhat insane.

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

#98
post #84

Earlier quoted context omitted.

We were actually discussing JS VM replacement in the browser, related to: > True, but the JS VMs we have today have been refined over 15+ years and switching to another risks breaking the web in profound ways. The counter-point being that all the major browser vendors have swapped out their VM or performed significant rewrites in the past few years; it's clear that it's possible to implement a new VM and not "break t…

I think you are misreading that quote. It's not replacing a JS VM with another JS VM that's a problem, it's replacing a JS VM with a non-JS specific VM would cause problems and break the web (something that has been proven to happen). Arguing that you can replace a JS VM with a JS VM doesn't help the case of replacing a JS VM with a non-JS VM.

At the surface level, I could see how your position would appear logical.

However, the nature of the replacement VM doesn't really matter in the context of what we're describing here.

The problems of compatibility remain the same regardless of whether the target VM is a JS-specific VM, or a general purpose VM; reliance on undefined behavior, accidental changes in semantics, optimization bugs, and so on.

If browser makers were able to swap-out the VM, they've already demonstrated the ability to solve the exact same kind of compatibility problems they'd face here.

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

#99
The shortest good answer I can come up with is reducing security exposure. Ending support for JavaScript is not an option, so browser makers would have to deal with the surface of one or two extra languages in addition to JavaScript.

I don't think they need the extra work.

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

#100
post #11

Here's an announcement for a project implementing the Erlang VM in the browser: http://erlang.org/pipermail/erlang-questions/2011-November/0... While not exactly what the OP is calling for, this is interesting nonetheless, and it does provide a mechanism for using at least one other language in the browser, even if it uses JS as the platform, rather than natively supported.

Tons of languages are doing that: OCaml, Python, Java (and Dart and GWT), C, C++ off the top of my head. I don't think it will catch on, because Javascript has been good enough and these runtimes have overhead.
Post reply on HN