Live data from Hacker News

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

stackoverflow.com

71–80 of 144 posts

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

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

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

#72
post #69
post #65

Earlier quoted context omitted.

>> JS running on a general VM would be slower. That's against the interests of the user. > What do you base this on? It's sounds like an unsupported assumption No, he is entirely correct. JavaScript and most dynamic languages do not run at full speed on static-language VMs like the JVM and .NET. This is despite tremendous efforts and motivation to run those languages quickly on such environments, see for example Micr…

> JavaScript and most dynamic languages do not run at full speed on static-language VMs like the JVM and .NET. This is despite tremendous efforts and motivation to run those languages quickly on such environments, see for example Microsoft's SPUR paper and everything it has done in the CLR to speed up dynamic languages. I'd argue the opposite regarding tremendous efforts and motivation; dynamic languages were an afte…

> I'd argue the opposite regarding tremendous efforts and motivation; dynamic languages were an after-thought for both the JVM and .NET, and on the JVM side you've only seen any attempts to improve performance recently, with invokedynamic for Java 7.

> The investments here occurred long after the VMs were developed.

That's a valid point. It is possible that some entirely new kind of VM could work, that was designed from the ground up for both static and dynamic languages. But I don't think we have any good idea of such a thing!

Until we do know how to do this, replacing the JS VMs in browsers would slow everything currently running. And adding another VM alongside it would decrease speed in other ways (see for example the papers that the Apple dev mentions in the WebKit discussion for why Apple opposes adding the Dart VM into WebKit).

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

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

> Because we all hate javascript.

Says who? I love JavaScript, as do a great many other developers. I look at CoffeeScript and all I can think is yuk.

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

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

Really? You're discounting all of the incredible webapps, games, and social networking on the web. If Javascript was bad for innovation, I sure don't see it. You're talking language syntax. Although it matters, it practically doesn't. People build stuff no matter what the language looks like. Look at Obj-C, that thing is horrid (syntax-wise) but look at all the developer adoption. What is bad for innovation is to mov…

> webapps

Mostly interesting because of their content and what they do with it on the server.

> games

You've got to be kidding me. There is nothing technically interesting in any web game I've ever seen.

> social networking

Again, has nothing to do with interesting client-side technical challenges and everything to do with the content and community.

> You're talking language syntax.

Don't forget the semantics too.

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

#75
post #27

If Python uses indentation rather than curly braces or keywords, then it would not allow for minimization or obfuscation when used in the browser. This is the main reason IMO Google chose to design Dart with curly braces.

> IMO Google chose to design Dart with curly braces.

I don't think minification was a concern. Familiarity was: the world's most popular languages are curly-based so adopting that makes the language easier to learn for millions of coders.

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

#76
post #49

Earlier quoted context omitted.

If this is a complete puzzle to you, you might spend some time meditating on a parallel issue: why have we spent 20 years iterating HTML rather than proliferating various hypermedia schemes? Or "better" yet, some real universal client that works like Display Postscript or X-Windows? Also consider that there have already been two freely targetable VM plugins which have had near total market penetration at various poin…

> why have we spent 20 years iterating HTML rather than proliferating various hypermedia schemes? You have to remember that HTML is predated by SGML, and that HTML and its precursors were designed for the purpose of providing document markup. We've continued to evolve these solutions for document markup, and in this regard, they do an adequate job. However, what we've seen in recent years is a rapid emergence of the…

> You have to remember that HTML is predated by > SGML, and that HTML and its precursors were > designed for the purpose of providing document markup.

I remember. I also remember there have been people arguing all along (back into the mid-90s, at least) that this document-centric approach has been totally unsuitable for a broader platform.

And yet, it's been more successful at delivering applications to the widest possible audience than any other platform. Why is that?

Enumerate all the features of the web you can think of that have enabled it to explode and thrive compared to networked applications and the popular VMs of the last 20 years. Then explain why you're certain that having a VM instead of a browser act wouldn't erode those advantages.

(This is the most important part of my comment. Feel free to ignore the rest.)

> HTML has fallen over in this context; > the DOM is ill-suited towards standard > re-usable UI widget programming,

I don't think the evidence is on the side of your claims. Given the sheer number of web pages and apps out there vs the number of desktop apps, the widgets built in to HTML are more widely used and re-used than most desktop API widgets, and the sheer proliferation of derived DOM-composite UI elements out there (particularly contrasted to the desktop) belies any claim of unsuitability for use: DOM elements are creatively styled and glommed together with a regularity that dwarfs anything from the desktop world.

That's use and suitability. Re-use? There are also several well-known and a lot more lesser known libraries that do indeed provide widgets at higher level of abstraction. JavaScript provides ample facilities for abstracting the DOM manipulation behind object and method calls. Whether or not it's used is another question, but any developer that can't learn to do that job in JavaScript either can't do it because they're unwilling to learn how to wield JavaScript, or because they'd be unable to do it with any language and API.

> JS is frustrating for building large applications

How so? There are plenty of developers out there who've found that if you embrace the features the language and most runtimes offer, it isn't any more difficult to build large systems with it than any other language. Though despite that, the language seems poised to embrace some of the features from others if for no other reason than to make developers who already know another language more comfortable.

> Moreover, Adobe Flash was not standardized

Standardized enough that the runtime was successfully targeted by a number of non-Adobe products.

> the documentation was sprawling and complex, and the bytecode format and libraries available changed significantly through the lifetime of the product.

And of course, our shiny new standard VM will avoid all these problems over its lifetime. ;)

> the performance profile is tremendously bad on mobile devices

It's actually better than I'd expect in a lot of cases, but it's true that it's not good enough for a lot of kinds of apps. But the language is not what's causing the problem, so adding other languages won't fix it, and might introduce other problems.

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

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

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

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

#78
post #72
post #69

Earlier quoted context omitted.

> JavaScript and most dynamic languages do not run at full speed on static-language VMs like the JVM and .NET. This is despite tremendous efforts and motivation to run those languages quickly on such environments, see for example Microsoft's SPUR paper and everything it has done in the CLR to speed up dynamic languages. I'd argue the opposite regarding tremendous efforts and motivation; dynamic languages were an afte…

> I'd argue the opposite regarding tremendous efforts and motivation; dynamic languages were an after-thought for both the JVM and .NET, and on the JVM side you've only seen any attempts to improve performance recently, with invokedynamic for Java 7. > The investments here occurred long after the VMs were developed. That's a valid point. It is possible that some entirely new kind of VM could work, that was designed f…

I think your points are valid as well.

I'm not ready to take it as a given that we can't build a general purpose VM capable of running JS at or very near current speeds, but it's also not a solved problem.

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

#79
post #67
post #57

Earlier quoted context omitted.

Your concerns seem ill-founded given that these are solved problems. There are working implementations of low-barrier cross-language compatibility, today, for both the JVM and the CLR. Here's one example; Rhino provides pretty seamless bridging from JavaScript to Java: https://developer.mozilla.org/en/Scripting_Java I've used it to run user-supplied JS inside the JVM. PHP is pretty easy too: http://quercus.caucho.com…

> Your concerns seem ill-founded given that these are solved problems. Then solve the problem I put before you. It's an easy one. I want to pass a modified Date object with stored procedures that modify the value based on geolocation. I want to pass it from a Javascript function to PHP/Java/whatever. Make it work. Please.

First of all, it's difficult to engage with your productively, as you're particularly confrontational.

That said, if you give me some example code, I'll demonstrate its use in a JavaScript/Java hybrid implementation when I have some spare moments.

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

#80
post #20

The other way to put this question is - Is there sufficient reason/motivation to try to replace Javascript with something else? What does JS lack or what are its limitations?

The lack of keyword default arguments drives me nuts, python just does it so well. Not to mention ===, etc, etc. None of these things are a showstoppers, but rather amount to "death by paper cut" that in my mind that make the language unsatisfying to use.

"Not to mention ===, etc, etc."

In that context, I read "etc, etc" as a variant of the "etc" operator.

Post reply on HN