LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   What is Scripting Language ? (https://www.linuxquestions.org/questions/linux-newbie-8/what-is-scripting-language-4175543855/)

killertux 05-28-2015 09:30 AM

What is Scripting Language ?
 
Hello guys !
I just ran into the word scripting Language while watching a movie.Is it different than a Programming language ? If yes, then how.
And please explain their usage.
Thanks in advance......

pan64 05-28-2015 09:49 AM

https://en.wikipedia.org/wiki/Scripting_language

allend 05-28-2015 10:10 AM

The usual distinction between a scripting language and a programming language is that a scripting language does not require an explicit compilation step.
Examples in Linux would be a script written for the bash shell, that can be run directly, as compared to the Linux kernel, which is written in C, and needs to be compiled into a machine code binary.
Scripting languages are generally easier to write and test, but run more slowly as they need to be interpreted when run. A compiled binary from a programming language will run much more quickly.
This distinction gets blurred. Consider awk, which is written as a script, but is compiled to machine code before it is actually run. This explains why an awk script completes more quickly than a bash script written to perform the same task.

Ihatewindows522 05-28-2015 10:23 AM

Scripts generally don't need to be compiled, and errors stop them from running. Programs (usually written in some form of C) need to be compiled to run, and errors won't stop them from running.

Python, Bash, and JS are examples of scripting languages, Python being by far the most powerful.
C, C+, C++, C# and Java are examples of programming languages.

fatmac 05-28-2015 01:47 PM

Writing & running a script can be very quick, whilst writing a compiled language program usually takes a lot longer & has to be compiled before being run.
(For simple jobs & one offs you would most likely write a script to do it.)

onebuck 05-28-2015 04:26 PM

Member response
 
Hi,

Scripting can be used to model a job to be ran then moved to a high level language once the script is proven to perform the job/task and the job can be faster with a high level language using the script as a model. Sometimes scripts will fulfill the need for a client that has set task(s) that need to be performed. Scripts can provide the quick development for a set of commands to perform the desired task(s) without the overhead of a high level language.

Sometimes quick script commands can provide the means to performance for a set of tasks that need to lead to a solution without overhead of a compiled high level language.
:hattip:

Keith Hedger 05-28-2015 06:48 PM

Quote:

Originally Posted by allend (Post 5368816)
... Consider awk, which is written as a script, but is compiled to machine code before it is actually run. This explains why an awk script completes more quickly than a bash script written to perform the same task.

Didn't know that, is it pure mc or just byte compiled?

veerain 05-29-2015 12:35 AM

Quote:

Originally Posted by allend (Post 5368816)
The usual distinction between a scripting language and a programming language is that a scripting language does not require an explicit compilation step.

Scripting language is a subset of programming language.

DJ Shaji 05-29-2015 05:48 AM

Quote:

Originally Posted by Ihatewindows522 (Post 5368823)
Scripts generally don't need to be compiled, and errors stop them from running. Programs (usually written in some form of C) need to be compiled to run, and errors won't stop them from running.

How? Errors will stop program execution, whatever the language. Depending on the kind of error, you may get either a thrown exception or segmentation fault. Believe me, errors will stop any program from running. :D

killertux 05-29-2015 06:30 AM

Quote:

Originally Posted by pan64 (Post 5368808)

Thanks !
I think it's dumb of me.I should try in Wikipedia before asking next time.

killertux 05-29-2015 06:33 AM

Quote:

Originally Posted by Ihatewindows522 (Post 5368823)
Scripts generally don't need to be compiled, and errors stop them from running. Programs (usually written in some form of C) need to be compiled to run, and errors won't stop them from running.

Python, Bash, and JS are examples of scripting languages, Python being by far the most powerful.
C, C+, C++, C# and Java are examples of programming languages.

Thanks !
The examples are really helpful.:hattip:

killertux 05-29-2015 06:37 AM

Problem Solved !
 
Thanks a lot !
I think I got the answer.And thanks again for being so much helpful.

allend 05-29-2015 07:55 PM

Quote:

Didn't know that, is it pure mc or just byte compiled?
Actually, according to the man page, awk compiles the script into an internal form. No more detail given.

chrism01 05-31-2015 02:24 AM

Perl is another compiled-on-the-fly lang see http://www.perl.com/doc/FMTEYEWTK/comp-vs-interp.html (the explanation is generally applicable)


All times are GMT -5. The time now is 12:44 PM.