为什么JavaScript被称为“脚本语言”? [英] Why is JavaScript called a "scripting language"?

查看:383
本文介绍了为什么JavaScript被称为“脚本语言”?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

正如标题所说,我想知道JavaScript被称为脚本语言的确切原因?

As the title says, I want to know the exact reason why JavaScript is called a "scripting language"?

我的理解是因为JavaScript只是由浏览器(而不是编译)。如果我错了,请纠正我。

My understanding is it's because JavaScript is only interpreted by the browser (and not compiled). Correct me if I'm wrong.

但是如果没有汇编那么 0 ==''是真的?编译器是否强制执行值,还是JavaScript引擎......?我有点困惑。

But if there is no compilation then how come 0 == '' is true? Doesn't the compiler coerce the values, or is that the JavaScript engine...? I am a bit confused.

推荐答案

我认为来自维基百科足够清楚:


脚本语言,脚本语言
或扩展语言是一种编程
语言,允许控制
单个或多个软件
应用程序。为
脚本编写目的选择的语言通常比主机应用程序
使用的语言高出
...

A scripting language, script language or extension language is a programming language that allows some control of a single or many software application(s). Languages chosen for scripting purposes are often much higher-level than the language used by the host application...

在这种情况下,应用程序是浏览器。关于编译:

In this case, the application is the browser. And about compilation:


脚本是
经常但不总是从源
代码或半解释编译到字节码
被解释,与他们关联的
应用程序不同,
传统上编译为
系统的本地机器代码
他们运行

Scripts are often, but not always, interpreted from the source code or "semi-compiled" to bytecode which is interpreted, unlike the applications they are associated with, which are traditionally compiled to native machine code for the system on which they run

关于 0 等于' ',强制它不一定是由编译器实现的;这完全是关于运行时的JavaScript引擎。

About 0 being equal to '', the coercion it is not necessarily achieved by a compiler; it's all about the JavaScript engine in runtime.

我很遗憾从维基百科那里拿走了所有东西,但它很清楚,我把它引用了

I feel sorry for taking everything from Wikipedia but it's so clear and I put it quoted

PS:我觉得值得贴这个:

PS: I find worth to paste this too:


许多人认为'脚本'语言
as在脚本场景中没有达到
流行度的
语言的劣势或某种程度的不同。
具有讽刺意味的是,这些相同的语言是精心挑选的b $ b b b,因为它们的质量和多功能性为

Many people view 'scripting' languages as inferior or somehow different than languages that haven't achieved popularity on the scripting scene. Ironically, these same languages were carefully chosen for scripting due to their quality and versatility.

这篇关于为什么JavaScript被称为“脚本语言”?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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