Live data from Hacker News

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

stackoverflow.com

111–120 of 144 posts

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

#111

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…

[deleted]

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

#112

Earlier quoted context omitted.

There is no such thing as general purpose VM .

A VM that provides a standardized bytecode and execution model capable of executing most modern dynamic and static turing complete languages with sufficient performance. This requires more general facilities for common functionality required; refer to tail call support, JVM's invokedynamic, etc. Or, shorthand, a general purpose browser VM. Unless, of course, you're arguing that the above is not truly possible, in whi…

I'm not saying that it is impossible as clearly there have been good efforts being made. However there is no such thing implemented.

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

#113

Earlier quoted context omitted.

A VM that provides a standardized bytecode and execution model capable of executing most modern dynamic and static turing complete languages with sufficient performance. This requires more general facilities for common functionality required; refer to tail call support, JVM's invokedynamic, etc. Or, shorthand, a general purpose browser VM. Unless, of course, you're arguing that the above is not truly possible, in whi…

I'm not saying that it is impossible as clearly there have been good efforts being made. However there is no such thing implemented.

Which comes full circle to my original point, which is that other than Google, nobody with a vested interest is trying, and worse yet, they actively oppose progress on this front.

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

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

To a large extent, I think apps are the answer here. (And just to be clear: I'm not conflating apps with app stores).

Consider the early days of the web: remember when Java applets seemed like the way of the future? (Okay, that's perhaps a bit of a stretch).

But I'm serious! What is the net other than a delivery mechanism for things?

How things are implemented is not the issue, the thing people really care about is easily getting software into the hands of end users. How that software happens to work internally is immaterial for most folks.

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

#115
post #70
post #59

Earlier quoted context omitted.

This generally isn't the case with disparate languages on the JVM. Unless you have a concrete objection with a scientific basis, you're just spreading FUD, and I don't think that contributes to the conversation.

> Unless you have a concrete objection with a scientific basis I did. Please solve the problem I put forward. If you solve it, you win.

You asked, "How can PHP get a response from a function in JavaScript?" Well, assuming we have the following JavaScript function:

  function multiplyString(str, times) {
    while (times) {
      str += str;
      times -= 1;
    }
    return str;
  }
We could write:

  log(multiplyString("Hello", 3));
  ?>
You then ask, "What if the response is a Date object?" You would call it the same way, and get back a Date object.

The rest of your question adds a bunch of other suppositions, all of them fairly vague and none of which seem particularly more salient than the first two. If you have a particular reason to think this would be intractable, maybe you could explain in more detail the problem you see, and perhaps an example of where it shows up in popular multi-language runtimes and interfaces.

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

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

A totally new approach just means you have to support two incompatible standards, most likely with more bugs and inconsistencies than you have now. I'd much rather see all the browser momentum we've gained lately going towards more comprehensive support of the existing standards, as flawed as they may be.

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

#118

Earlier quoted context omitted.

I'm not aware of anyone disrupting critical code the way you're suggesting. It would be akin to rewriting malloc. I'm not discounting a slow transition akin to what you suggest, but you're talking about a long time frame of supporting 2 VMs side by side. Probably 10+ years. And even then , you still have to support JavaScript being written directly in HTML tags, something no other language could enjoy. So every brows…

> 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 switch malloc out in existing codebases and expect everything to work right.)

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

#119
post #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.

There _is_ a language-agnostic API spec for the DOM; that's the whole point of the DOM specs. It's led to APIs that are a huge pain to use from any language (I've tried it from C++, Java, and JavaScript).

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

#120
post #26

If you spend all your energy complaining about JavaScript and demanding the browser vendors provide you with a better replacement the problem here is not JavaScript, it's you. JavaScript is far from the best language ever created, but it's also far from the worst. The biggest pain in the ass working with JavaScript on a day to day basis is not JavaScript itself -- most of its follies can be avoided by good programmin…

JS has lots and lots of fundametal issues. Weird OO implementation (argue all you want but prototype inheritance is not what the prevailing wisdom is on how to do OO), no type system (at least give the option!), no packages/modules, no generics. Don't people want dev tools to better help them building and refactoring web code? Web dev is like 15 years behind server development.

Of course some of these things are being fixed (e.g. modules are being added; there has been talk of optional types). At least when Google or Microsoft aren't dragging their feet and sabotaging the process.

As for generics, I'm not sure what you're looking for there; it's pretty simple to write generic functions in JS, or indeed any language with duck typing, no?

Post reply on HN