Live data from Hacker News

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

stackoverflow.com

121–130 of 144 posts

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

#121

Earlier quoted context omitted.

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…

I think you should say rather that web browsers that only run javascript will be irrelevant.

I doubt the web is going anywhere...

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

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

> JavaScript is locked in. It's too entrenched, it's never going away. Let's just accept that

The same thing could have reasonably been said of Flash just a couple of years or so ago. It was on something like 99% of browsers.

> That means that adding additional languages creates a burden. You're now supporting, at minimum 2 VMs.

Why would we need 2? Why not one VM that the additional languages AND JavaScript can all be compiled to? Then here's what you have in the browser:

1. That single VM.

2. A JavaScript compiler that compiles to that VM, so that you can still send JavaScript the traditional way as source code loaded by script tags.

Then, if someone prefers to work in Python or Ruby (or Lua, or whatever), they can compile to the byte code on the server, and send the byte code to the browser.

I'm sure that some will object that this means that if people use those other languages, then essentially they are sending binary to the browser instead of source. However, with all the hacks being done to minimize JavaScript code size, and all the machine generated JavaScript we have now, it is getting harder and harder to consider what gets sent to the client "source code" anymore for a lot of sites.

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

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

> Why can't we have a standardized generic bytecode and VMs to run it? And why stop there! There are plenty of "languages" that currently compile into HTML and CSS (like HAML and SASS for example). If we have a common VM for scripting then why not a common VM for HTML and CSS as well. Heck, we could do this all with a single VM and a common API. For backwards compatibility, we could use a new HTML tag to enable this…

Hey, that sounds familiar...

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

#124
post #121

Earlier quoted context omitted.

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…

I think you should say rather that web browsers that only run javascript will be irrelevant. I doubt the web is going anywhere...

Well that was basically the point I was trying to make. The web is going to have to evolve to a post-Javascript future at some point. I believe this will happen no matter how hard the JavaScript-only diehards fight against it. I'm certainly not saying the web is doomed, only that it would be if the JavaScript-only crowd really got their wish (which in the long run they won't, they can't).

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

#126

Earlier quoted context omitted.

> It would be akin to rewriting malloc. Aside from the fact that memory allocators are written, rewritten, and tweaked all the time, your own organization's actions defang this argument: Firefox 3 included a switch to jemalloc.

A version of jemalloc specifically written for mozilla's codebase. If it were a 100% compatible drop in replacement for malloc, why hasn't every other project switched to jemalloc yet? (Searching for switching to jemalloc , seems like every group that tried it out found that their code base or use case exposed new problems in jemalloc. That these could be fixed doesn't negate the main point -- you couldn't just switc…

I don't think I've ever seen a more dramatic real-world example of unwittingly strengthening the point you're arguing against. jemalloc didn't work quite as they wanted, so they customized it, and you really think that's a counterpoint to an argument for trying new and different things?

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

#127

Earlier quoted context omitted.

You can just use CoffeScript for those little problems.

I've looked at it, and while nifty, makes me worry about leaky abstractions and future support. Now that you mention it if I'm going to do that, why not use the python-to-javascript compiler from pyjamas? ... hmm.

The difference is that CF is very close to javascript and makes it very easy to transition. But of course, if you prefer python, why not :)

Talking about future support, as CF is included in Rails 3.1, I guess that it should be guaranteed enough.

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

#128

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…

Javascript has anonymous function closures - nice sugar for a non-blocking API. Python doesn't have them.

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

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

Arguably there already is a totally new approach, centered around an app store rather than a browser.

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

#130
post #66

I would prefer a standard byte-code VM inside of every browser so we could just make compilers targeting that VM. Then anyone could choose their preferred language :)

I would too, but what will be the characteristics of that VM?

And who 'owns' the technology?

Post reply on HN