What is a scripting language?

Asked

Viewed 18,846 times

28

It is often said that PHP, Javascript, Ruby, Python, among others are "scripting languages."

But what defines whether a programming language is a scripting language or not?

Some would say that scripting languages are interpreted, but Java is interpreted and not cited as a scripting language.

What is a scripting language?

  • 1

    I withdrew my vote to close, in the hope of interesting answers appear, but for now, I still find too broad, I see no concrete and reasoned answer, just seem to me opinions with some kind of correct information.

  • 2

    Java has not been interpreted for many years.

  • 2

    The question is good precisely because many people do not understand well what it is. It is true that we can not answer 100% because there is no universally accepted conceptualization, but we saw here some very wrong answers (some were deleted) showing that an explanation is necessary.

  • 1

    @bigown erased yes, I answered the concept that I always thought was true, but since you said it was a wrong premise (and I don’t want to contribute garbage) I expect a concrete answer from someone to compare to my answer, so it’s easier to discuss the subject, Just saying you’re wrong gets too vague.

  • 1

    @Philip no problem in deleting no. If you can’t improve it, it’s the best to do anyway. I’ve already deleted mine myself. In the deleted answers I gave the objective reasons to be wrong, nothing vague. I’ve learned a lot of things wrong, the Internet is full of wrong information, but when you start to put things together, you read the existing definitions you see that one counters the other and then you can only use those that do not find clear objection. The form of execution does not define whether the language is script, has so many contrary cases in this that does not serve as a parameter.

  • Scripting languages are programming languages that do not require compilation, or are interpreted. and the only difference I see.

Show 1 more comment

5 answers

21


Scripting language is any language that is used to write a script. The big question is What is a script?. And this is quite subjective, a case-by-case analysis.

The whole distinction is in purpose and use. In a script you describe a sequence of commands and tasks that someone must perform (the interpreter). The classic example of this is the languages for command prompts, either shell/bash or Windows batch. Other languages suggest as an intention to facilitate the writing of small programs, allowing greater complexity in what was previously done with the .sh or .bat. These languages are called shell Languages.

Several languages created later that can function as scripts are perl, python, ruby, etc. But note that with the power and flexibility they have, many are used to write large applications, especially on the server side. In this case it is no longer just a script.

Another common definition is that scripting languages are those that can be embedded in other programs. In the Unity3d game engine, for example, you can program the behavior of each object using C#. In this case C# is a scripting language, even if it is compiled. But if you write an entire application in C# and run it independently, it won’t be a script. Similarly you can understand that javascript is extending the ability of the browser by giving additional features to your page, so it’s a script. There is a dialect of C/C++, Angelscript, which has been built in order to be easily accessible. It is another example of scripting language.

To say that everything that is compiled is not script and everything that is interpreted is script is wrong. The way the code is executed does not influence, especially in these JIT days when interpreters are more and more the same as compilers. The whole question is in the purpose of that code.

Generally speaking, one can say that scripting languages depend on a certain environment to be executed correctly. Be it the command line utilities, be it the features of a game engine or browser. While a non-scripted language runs "nude", it is more independent. There are many cases where it is difficult to distinguish, becomes something almost subjective.

Further reading:
Why are scripting Languages (e.g. Perl, Python, Ruby) not suitable as shell Languages?

  • I still have more doubts I... It seems to me that we are focusing on a very subjective point, which is a script.

  • "closed as not constructive" ;)

3

Well... I came a little late in this post, but I’ve always understood scripting languages as being those used in "specific domains", that is, created to help solve problems in a particular segment of computer science. Generally, the "engine" of a scripting language is embedded in an application, so that it can be configured very flexibly, assisting the automation of certain tasks.

Programming languages in turn, allow the creation of applications (or programs) to run on one or more operating systems, these applications can be created for various purposes and are executed almost always independent of some other application.

I participated in a project, where a C language application was developed, to read and process files coming from telephone exchanges. This application uses the scripting language Tcl embedded, so that when the download of a file is completed, Tcl scripts are executed to perform various types of processing on the contents of the same, the results produced after this processing meet other areas of the company, such as billing and fraud analysis.

In this example, C would be the programming language, Tcl the scripting language.

Currently, scripting languages are becoming more sophisticated, allowing for example the source code of a script to be "compiled" to a file in "bytecode", in this case the "engine" in the host application runs the file in bytecode, that tends to have a better execution performance in addition to protecting the source code of the script against third parties. The problem starts when scripts are developed to run outside an application, this is possible, and I myself have already created scripts in Tcl that have graphical interface and are executed directly by the interpreter of this, outside any host application, in this case Tcl can also be classified as a programming language? Not in my humble opinion. The author of the language himself states that it was created to be embedded in applications in order to solve a specific set of problems.

There seems to be no formal classification to identify scripting and programming languages. I think the most appropriate is to find out who created the language and what use this person or company intends for the same. Generally, if the language allows it to be embedded in an application written in another language, then it is defined as being primarily a scripting language.

  • but a script would not be a programming language?

-1

Scripting languages are those in which the interpreter reads the source code and generates a "bytecode" that is then executed by the compiler, i.e., bytecode is a middle ground between the source and machine language. Therefore scripting or interpreted languages need the source code to run the program, unlike compiled languages that after the compilation is executed, just the binary executable to run the program.

Simplifying

Interpreted languages need the source code to run, while compiled languages need only compiled.

My conclusion :

Base programming languages (compiled languages) are decompiled by the compiler( similar to what the zip processor does ) and executed by the binary executable (primary language of the machine , language that man does not understand or is the origin of everything relating to the software of the machine ) .

On the other hand languages scripts or interpreted languages are those that are not executed directly by the compiler , first they are interpreted by the base programming languages (compiled languages) and these interpret this script and transform itis in compiled code so that these are processed by the compiler and finally executed .

I hope I’ve helped the little people understand what scripts or scripting languages are :) ...

  • 2

    It is not that, read a much more voted response that has more concrete information. There are several misconceptions in this answer.

-2

Scripting languages are those in which the interpreter reads the source code and generates a "bytecode" that is then executed by the compiler, i.e., bytecode is a middle ground between the source and machine language. Therefore scripting or interpreted languages need the source code to run the program, unlike compiled languages that after the compilation is executed, just the binary executable to run the program.

Simplifying

Interpreted languages need the source code to run, while compiled languages need only compiled.

  • 4

    There’s a huge confusion of concepts here. In addition to falling into the errors of other answers, it even reversed the error by leaving one part of the answer contradicting the other part, making it even worse.

-3

Programming languages that were originally developed in a Linux environment are usually called scripts, due to an analogous relationship that professionals make when referring to other scripting languages with the shell script(sh script), bash script, etc. In some translations of books it is said that they are scripts of commands to be executed, hence also the analogy script.

  • 1

    I meant right Unix environment?

  • 4

    The answer does not explain well, but at least it does not fall into the error of other answers that confuse concepts and use wrong premises. This one of yours is actually fairly good, but I’ve seen other answers that you’ve given that are very vague and don’t help much. Here we look for answers that really help to understand or solve problems. Try to develop your answers a little better and you will do well. They don’t even have to be long, but you have to give a real answer, so I use this as an example of something that’s really close to the goal.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.