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

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

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

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

  • Javascript is a perfectly reasonable underlying language. Nothing that I know of stops people from compiling python or ruby into javascript.

    I would never write pure javascript, but using languages that compile to javascript has been pure joy.

    See http://common-lisp.net/project/parenscript/

  • A byetcode/VM approach would be an improvement on the web client. This has been used successfully for 10+ years on the server (JVM, CLR), so why not learn from things and advance the state of web development.

    I don't understand why people defend JS so passionately. It was build in like 2 weeks, wasn't designed to build large complex applications, and hasn't really advanced at all since its inception. There are better options out there and the web development community should welcome any improvements to close the gap from Native to web.

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

  • "closed as off topic by casperOne♦ 8 mins ago"

    ...

    The number of programming topics I have had closed on that site angers me. They are becoming Wikipedia.

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

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

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

  • 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 programming practices -- it's the DOM.

  • Just don't tell me we need to have JavaScript on the server side too, for like, consistency, man.

  • Mono (actually a fork of it) can already compile C# to run on Chrome NativeClient. So, you're very close, there.

    Also, this:

    http://mail.python.org/pipermail/python-dev/2009-June/090038...

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

  • This is an interesting implementation of python in the browser. It's a python interpreter written in JS, so you wouldn't need any new software on the users end.

    http://www.skulpt.org/

  • 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 :)

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

  • Those languages (which I both quite enjoy) are a bit slow though. Maybe something like Lua which already has a pretty amazing JIT available?

  • 1. why does stackoverflow close all the interesting questions?

    2. fuck is wrong with javascript?