What makes a language a scripting language? I've heard some people say "when it gets interpreted instead of compiled". That would make PHP (for example) a scripting language. Is that the only criterion? Or are there other criteria?
相关问题
- mv wrapped inside an if in shell scripting
- Why do I use double quotes in shell scripts [dupli
- Is divide by zero an error or an exception?
- Is there an easy way to convert HTML with multiple
- Piping Batch File output to a Python script
相关文章
- Is there a non-java, cross platform way to launch
- Temporal Extraction (i.e. Extract date/time entiti
- Are there any reasons not to use “this” (“Self”, “
- Call/Return feature of classic C++(C with Classes)
- What does “exposition only” mean? Why use it?
- What are the major differences between C and C++ a
- Why should I use UL/LI in my HTML?
- “Adapter” or “adaptor”?
Traditionally, when talking about the difference about scripting versus programming, scripts are interpreted and programs are compiled. A language can be executed in different ways - interpreted or compiled (to bytecode or machine code). This does not make a language one or another.
In some eyes, the way you use a language makes it a scripting language (for example, game developers who develop mainly in C++ will script the objects in Lua). Again, the lines are blurred - a language can be used for a programming by one person and the same language can be used for scripting language by another.
This is from the wikipedia article about scripting languages:
You will notice the use of "usually", "often", "traditionally" and "nearly always" - these all tell you that there is no set of distinct attributes that make a specific language a "scripting language".
"Scripting language" is one of those fuzzy concepts which can mean many things. Usually it refers to the fact that there exists a one step process taking you from the source code to execution.
For example in Perl you do:
perl my_source.pl
Given the above criteria PHP is a scripting language (even though you can have a "compilation" process for example when using the Zend Encoder to "protect" the source code).
PS. Often (but not always) scripting languages are interpreted. Also often (but again, not always) scripting languages are dynamically typed.
A scripting language is a language that "scripts" other things to do stuff. The primary focus isn't primarily building your own apps so much as getting an existing app to act the way you want, e.g. JavaScript for browsers, VBA for MS Office.
My definition would be a language that is typically distributed as source rather than as a binary.
My friend and I just had this argument: What is the difference between a programming language and a scripting language.
A popular argument is that programming languages are compiled and scripting languages are interpreted - However I believe this argument to be completely false...why?
On that basis, this is my argument for the difference between a programming language and a scripting language:
A programming language runs at the machine level and has access to the machine itself (memory, graphics, sound etc).
A scripting language is sand boxed and only has access to objects exposed to the sand box. It has no direct access to the underlying machine.
I would say scripting language is the one heavily manipulating entities it doesn't itself define. For instance, JavaScript manipulates DOM objects provided by the browser, PHP operates enormous library of C-based functions, and so on. Of course not a precise definition, more a way to think if it.