开发者

Why ActionScript is said scripting language even after grown up so much and having compiled language?

From the Wikipedia defination,

Programming language is

Scripting languages are languages that allow you to send commands directly to a system that executes these commands. These commands are read line by line and executed-interpreted, but not compiled.

Whilst, Scripting language is

Programming languages are languages that allow you to create a program by writing structured code that is read all at once by the system, checked for errors, and translated into an unreadable format that the machine can then execute(compiled)开发者_如何转开发.

ActionScript is now quite developed language(Which runs after compilation not interpreted) and after ActionScript 3,Flex and Air, Its hard to believe ActionScript is still dubbed as Scripting language.


The line between a programming language and a scripting language is blurry. Once upon a time, a "programming language" was a compiled language like C or C++, because only those languages were really efficient enough to write non-trivial programs in. Scripting languages were languages that were typically not compiled and thus slower; their relative inefficiency relegated them to systems maintenance tasks or "gluing" parts of a compiled program together. Now, computers are getting faster and language interpreters are getting more advanced, so even a traditional "scripting" language like Python or Tcl can be used to write a full-fledged application. However, once a language is dubbed a scripting language, it's hard to shirk off the title.


Don't believe everything in the Wikipedia.

PHP for example is compiled into bytecode at runtime, while java is compiled into bytecode at compilation time. The php interpreter executes the bytecode, and the java VM executes its bytecode both doing about the same thing.

A bash script is not compiled at all and is interpreted run line by line.

C is compiled into machine code that is read directly by the hardware.

According to the wiki entry, only the bash is truly a script which is a misnomer.

It is much more nuanced than the wiki entry implies.


JavaScript is a scripting language in browsers because it scripts the browser.

Bash is a scripting language because it scripts the OS.

Python and ActionScript are called scripting languages because they share things in common with real scripting languages (dynamically typed, sometimes interpreted, higher-level than C). I think "scripting language" as a term is far too over-used, and is mainly used to put down dynamically typed languages.


Reading the definitions above, the machine can't execute the format that the Flex compiler creates, therefore ActionScript is a scripting language.

Of course, anything that compiles to a VM would be considered a scripting language by that definition, including Java. Forth, being a threaded interpreted language, would also be a scripting language.

So forget Wikipedia. These distinctions used to make more sense than they do now.

JavaScript is getting faster monthly, and will probably soon be faster than ActionScript, if it isn't already.

I'd say a better definition for "scripting language" is, "a scripting language controls an application or enclosed environment, like a browser or a word processor or Flash."

But with the Chrome OS, even that definition is in peril, as the browser (including Flash, which Google has embraced) threatens to become an OS.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜