为什么JavaScript在浏览器中实现的唯一客户端脚本语言? [英] Why is javascript the only client side scripting language implemented in browsers?

查看:101
本文介绍了为什么JavaScript在浏览器中实现的唯一客户端脚本语言?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

为什么不添加浏览器,比如说支持Python脚本作为替代的Javascript?或多个通用脚本语言?是否有一个原因,JavaScript是跨浏览器实现的只有一个?毕竟,脚本标签确实有支持,指定使用的脚本语言。

Why don't browsers add support for, say, Python scripting as an alternative to Javascript? Or more general purpose scripting languages? Is there a reason that Javascript is the only one implemented across browsers? After all, the script tag does have support to specify the scripting language used.

(我知道有在IE中支持VBScript,但似乎过时,所有意图和目的。)

(I know there is VBScript support in IE, but it seems obsolete for all intents and purposes.)

推荐答案

那么,谷歌正试图用降压的飞镖。社区还没有完全接受的想法;无论是。

Well, Google is trying to buck that trend with Dart. The community hasn't been entirely receptive to the idea; either.

增加对Webkit的哪也没去多虚拟机支持下得非常好。

Google proposed adding multiple VM support for Webkit which didn't go down very well.

一个特别的评论把它概括很好,为什么一直存在于一定的阻力:

One particular comment summed it up nicely as to why there has been some resistance to that:

在这种情况下,该功能被暴露额外的编程语言到网上,一些没有任何实际的好处给其他任何人比目前最真棒语言的球迷(不太久以前,可能是围棋,一年半载以前这将是红宝石,比之前的蟒蛇,我记得我在Haskell的人气不是很久以前为好,Lua中一直在青草很长一段时间,在这种情况下,它的DART短暂飙升 - 谁是说有赢得 T为流行完全不同的语言在6个月),但作为成本是片段的网络,并增加了大量额外的维护负担 - ?只是维持V8和JSC绑定是不平凡的,他们是同一种语言

In this case the feature is exposing additional programming languages to the web, something without any real benefit to anyone other than fans of the current "most awesome" language (not too long ago that might have been Go, a year or so ago this would have been ruby, before than python, i recall i brief surge in haskell popularity not that long ago as well, Lua has been on the verges for a long time, in this case it's Dart -- who's to say there won't be a completely different language in vogue in 6 months?), but as a cost it fragments the web and adds a substantial additional maintenance burden -- just maintaining the v8 and jsc bindings isn't trivial and they're for the same language.

这里的问题不是我们可以让多个虚拟机住在WebKit的是,我们可以公开多种语言网络,前者显然我,因为我们已经做说了,后者我说我们不要'T希望。

The issue here isn't "can we make multiple vms live in webkit" it's "can we expose multiple languages to the web", to the former i say obviously as we already do, to the latter I say that we don't want to.

除非我们想转成的WebKit引擎,每个人都讨厌的,因为这打破了开放式网络的所有其独有的特色,在90年代末一拉某些浏览器。

Unless we want to turn webkit into the engine that everyone hates because of all its unique "features" that break the open web, a la certain browsers in the late 90s.

的CoffeeScript是一个新兴的客户端脚本语言的另一个例子。然而,而不是支持在浏览器中的另一个虚拟机(如谷歌正试图用飞镖做),它编译成JavaScript。还有其他一些编译X要JavaScript的即做到这一点为好。 emscripten 是编译的一个很好的例子的 LLVM 的为JavaScript。

CoffeeScript is another example of an emerging client-side scripting language. However, rather than support another virtual machine in a browser (as Google is trying to do with Dart), it compiles to JavaScript. There are several other "compile X to JavaScript" that do that as well. emscripten is a good example of compiling LLVM to JavaScript.

所以,还有很多其他的客户端语言;他们只是都使用JavaScript作为中间。我认为应该是什么DART就为好,虽然他们有一些空间提高

So there are plenty of other client languages; they just all use JavaScript as an intermediate. I'd argue that should be what Dart does as well, though they have some room to improve.

这篇关于为什么JavaScript在浏览器中实现的唯一客户端脚本语言?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆