Why is javascript the only client-side scripting language implemented in browsers?

Why don't browsers support, say, Python scripts as an alternative to Javascript? Or more general scripting languages? Is there a reason Javascript is the only one implemented in browsers? In the end, the script tag has support for specifying the scripting language to use.

(I know that IE has VBScript support, but it seems deprecated for all purposes and tasks.)

+49
javascript standards browser web
Jan 20 '12 at 19:35
source share
3 answers

Well, Google is trying to boost this trend with Dart . The community was not completely receptive to this idea; or.

Google suggested adding some VM support for Webkit , which didn’t fall very well.

One specific comment well summed up why there was some resistance to this:

In this case, the function reveals additional programming languages ​​on the Internet, something without any real benefit for everyone except fans of the current “most amazing” language (not so long ago, maybe it was Go, a year or so ago, it was would be a ruby, earlier than python, I remember that the short-term increase in haskell's popularity not so long ago, Lua was on the edge for a long time, in this case Dart - who said, t be a completely different language in fashion after 6 months?), but in as a value, it fragmentes the Internet and adds There’s a significant additional service load - just maintaining the v8 and jsc bindings is not trivial, and they are for the same language.

The problem here is not “that we can do several vms live in webkit”, it is “we can expose several languages ​​on the Internet”, in the first I say, obviously, as we already do this, to the last I say that we we don’t want to.

If we do not want to turn webkit into an engine that everyone hates because of all its unique "features" that violate the open network, some browsers in the late 90s.

CoffeeScript is another example of an emerging client-side scripting language. However, instead of supporting another virtual machine in the browser (as Google is trying to do with Dart), it compiles in JavaScript. There are a few “compilation of X into JavaScript” that also do this. emscripten is a good example of compiling LLVM into JavaScript.

Thus, there are many other client languages; they just use javascript as an intermediate. I would say that there should be what Dart does, although they have the opportunity to improve .

+34
Jan 20 '12 at 19:45
source share
— -

Internet Explorer supports any Windows Script Engine , so you can support it in any language that was implemented as one, or write it yourself.

+4
Jan 20 '12 at 19:47
source share

Because JavaScript is what every other browser supported, and browser vendors had two main priorities:

  • Maintenance of existing web pages (which requires JavaScript)
  • Allowing authors to do things visible in the browser, things visible in the browser that they could not do in other browsers (changing the programming language would be completely hidden from users, except when it broke).
0
Jan 20 '12 at 19:39
source share



All Articles