You are on page 1of 7

Stack Overflow

Questions
Developer Jobs
Tags
Users

Search

Log In Sign Up
Join Stack Overflow to learn, share knowledge, and build your career.
Email Sign Up
OR SIGN IN WITH
Google
Facebook
Difference between a script and a program? [closed]

Ask Question

up vote
55
down vote
favorite
19
What is the difference between a script and a program? Most of the time I hear that
a script is running, is that not a program? I am bit puzzled, can anybody elaborate
on this?

scripting
shareimprove this question
edited Aug 13 '12 at 9:39

Chris
23.8k886116
asked Feb 18 '10 at 5:39

giri
10.8k51111163
closed as not constructive by John Saunders, jonsca, Don Roby, Jon Lin, Ben D Dec
24 '12 at 23:27

As it currently stands, this question is not a good fit for our Q&A format. We
expect answers to be supported by facts, references, or expertise, but this
question will likely solicit debate, arguments, polling, or extended discussion. If
you feel that this question can be improved and possibly reopened, visit the help
center for guidance.
If this question can be reworded to fit the rules in the help center, please edit
the question.

add a comment
11 Answers
active oldest votes
up vote
38
down vote
For me, the main difference is that a script is interpreted, while a program is
executed (i.e. the source is first compiled, and the result of that compilation is
expected).
Wikipedia seems to agree with me on this :

Script :

"Scripts" are distinct from the core code of the application, which is usually
written in a different language, and are often created or at least modified by the
end-user.
Scripts are often interpreted from source code or bytecode, whereas the
applications they control are traditionally compiled to native machine code.
Program :

The program has an executable form that the computer can use directly to execute
the instructions.
The same program in its human-readable source code form, from which executable
programs are derived (e.g., compiled)
shareimprove this answer
edited Jan 23 '14 at 15:45

streppel
4,77052542
answered Feb 18 '10 at 5:45

Pascal MARTIN
307k55555594
3
-1 because wikipedia is of course always right. The distinction between compiled
and interpreted is not relevant to the discussion. Nick Bastin Feb 13 '15 at 7:50
1
You say, "(i.e. the source is first compiled, and the result of that compilation is
expected)." Do you mean "compilation is executed"? Big Sharpie Oct 3 '15 at 22:55

add a comment

up vote
30
down vote
I take a different view.

A "script" is code that acts upon some system in an external or independent manner
and can be removed or disabled without disabling the system itself.

A "program" is code that constitutes a system. The program's code may be written in
a modular manner, with good separation of concerns, but the code is fundamentally
internal to, and a dependency of, the system itself.

Scripts are often interpreted, but not always. Programs are often compiled, but not
always.

shareimprove this answer


answered Feb 18 '10 at 6:15

Enigmativity
66.4k752115
add a comment
up vote
10
down vote
Typically, a script is a lightweight, quickly constructed, possibly single-use
tool. It's usually interpreted, not compiled. Python and bash are examples of
languages used to build scripts.

A program is constructed in a compiled language, like C or C++, and usually runs


more quickly than a script for that reason. Larger tools are often written as
"programs" rather than scripts - smaller tools are more easily developed as
scripts, but scripts can get unwieldy as they get larger. Application and system
languages (those used to build programs/applications) have tools to make that
growth easier to manage.

You can usually view a script in a text editor to see what it does. You can't do
that with an executable program - the latter's instructions have been compiled into
bytecode or machine language that makes it very difficult for humans to understand,
without specialized tools.

Note the number of "oftens" and "usuallys" above - the terms are nebulous, and
cross over sometimes.

shareimprove this answer


edited Feb 18 '10 at 5:52
answered Feb 18 '10 at 5:46

Michael Petrotta
48.2k12117166
add a comment
up vote
10
down vote
See:

The Difference Between a Program and a Script

A Script is also a program but without an opaque layer hiding the (source code)
whereas a program is one having clothes, you can't see it's source code unless it
is decompilable.

Scripts need other programs to execute them while programs don't need one.

shareimprove this answer


edited May 31 at 11:30

Sam Hartman
3,89121127
answered Feb 18 '10 at 5:42

Sarfraz
271k57436530
6
This link now 404s. Nino Walker May 28 '14 at 4:56
add a comment
up vote
6
down vote
A "program" in general, is a sequence of instructions written so that a computer
can perform certain task.

A "script" is code written in a scripting language. A scripting language is nothing


but a type of programming language in which we can write code to control another
software application.
In fact, programming languages are of two types:

a. Scripting Language

b. Compiled Language

Please read this: Scripting and Compiled Languages

shareimprove this answer


edited Mar 28 '12 at 13:28
answered Mar 28 '12 at 3:14

coolscitist
84322447
add a comment
up vote
3
down vote
Scripts are usually interpreted (by another executable).

A program is usually a standalone compiled executable in its own right (although it


might have library dependencies), consisting of machine code or byte codes (for
just-in-time compiled programs)

shareimprove this answer


answered Feb 18 '10 at 5:42

Mitch Wheat
236k31378477
add a comment
up vote
2
down vote
According to my perspective, the main difference between script and program:

Scripts can be used with the other technologies. Example: PHP scripts, Javascripts,
etc. can be used within HTML.

Programs are stand-alone chunks of code that can never be embedded into the other
technologies.

If I am wrong at any place please correct me.I will admire your correction.

shareimprove this answer


edited Dec 24 '12 at 19:26

JoshDM
3,51463056
answered Apr 19 '10 at 9:45

Karan Gupta
211
add a comment
up vote
1
down vote
There are really two dimensions to the scripting vs program reality:

Is the language powerful enough, particularly with string operations, to compete


with a macro processor like the posix shell and particularly bash? If it isn't
better than bash for running some function there isn't much point in using it.
Is the language convenient and quickly started? Java, Scala, JRuby, Closure and
Groovy are all powerful languages, but Java requires a lot of boilerplate and the
JVM they all require just takes too long to start up.
OTOH, Perl, Python, and Ruby all start up quickly and have powerful string handling
(and pretty much everything-else-handling) operations, so they tend to occupy the
sometimes-disparaged-but-not-easily-encroached-upon "scripting" world. It turns out
they do well at running entire traditional programs as well.

Left in limbo are languages like Javascript, which aren't used for scripting but
potentially could be. Update: since this was written node.js was released on
multiple platforms. In other news, the question was closed. "Oh well."

shareimprove this answer


edited Feb 9 '16 at 18:19
answered Feb 18 '10 at 5:48

DigitalRoss
114k14197284
add a comment
up vote
0
down vote
A framework or other similar schema will run/interpret a script to do a task. A
program is compiled and run by a machine to do a task

shareimprove this answer


answered Feb 18 '10 at 5:43

hodgesmr
1,48532336
add a comment
up vote
0
down vote
IMO Script - is the kind of instruction that program supposed to run Program - is
kind of instruction that hardware supposed to run

Though i guess .NET/JAVA byte codes are scripts by this definition

shareimprove this answer


answered Feb 18 '10 at 5:43

user275809
21
add a comment
up vote
0
down vote
script: it contains set of "scripting language" instructions which controls, runs
other system programs, applications also it can be scheduled.

Program: it contains set of instructions, which performs certain task upon


compilation of the program with the compiler.

shareimprove this answer


answered Mar 28 '12 at 8:25
Som
4371720
add a comment
Not the answer you're looking for? Browse other questions tagged scripting or ask
your own question.

asked

7 years, 9 months ago

viewed

86,192 times

active

6 months ago

BLOG
How Were Designing Channels

44 People Chatting

JavaScript: Bruteforcing medicine


37 mins ago - shriek
shriek: 37 mins agondugger: 46 mins agohsimah: 47 mins agoKendall Frey: 1 hour
agorlemon: 1 hour agoLoktar: 1 hour agoWilliam: 1 hour ago
Lounge<C++>
25 mins ago - Jerry Coffin
Jerry Coffin: 25 mins agoBorgleader: 1 hour agoMysticial: 1 hour agoFlix Gagnon-
Grenier: 3 hours agoEtienne de Martel: 3 hours agoCode-Apprentice: 5 hours agonwp:
6 hours ago
Linked

4
what actually is scripting language?
1
Difference between Scriptable and programmable
-2
new to C and struggling with use of *, & to reference objects
Related

394
How do I know the script file name in a Bash script?
966
How do I prompt for Yes/No/Cancel input in a Linux shell script?
202
With Bash Scripting, how can I suppress all output from a command?
1117
How to mkdir only if a dir does not already exist?
386
In a Bash script, how can I exit the entire script if a certain condition occurs?
452
How to run a PowerShell script?
344
How does cat << EOF work in bash?
476
Propagate all arguments in a bash shell script
3
Difference between Scripting and Programming Language
242
Scripting Language vs Programming Language
Hot Network Questions

How can a tripod be unstable?


Who is the woman in the crowd when Guy Fawkes is being hanged?
Our GM won't let us affect the story; the more I play the less fun I have. What do
I do?
two year or two year's
You can contact me on/over/by Skype
Entire GOP voted against letting senators read the new tax bill?
Do advanced musicians still practice scales every day?
Selecting Multiple Layers with ArcPy?
What happens when a swimming creature falls prone?
Is there a proper term for the 'arms' of a star?
When (if ever) is it considered professional to yell in the workplace?
Matrix determinant contradicts corresponding box volume - how is it possible?
How can I convince my girlfriend not to worry about gifts I give her?
Did Republicans accidentally kill corporate deductions, and will it force the
Senate to revise and re-vote?
What is actually moving in an endless runner?
How much is airspeed reduced on an A10-Warthog when firing its cannon?
How to respond to questions that feel like I have to defend the relationship I'm
in?
Large proportion of students not invited for evaluation of a course
Strike-through Tilde Accent
Merging one element into a two-element list
Is a linear vector space a vector space?
How does Voyager 1 keep track of its orientation?
Maintain code quality without SCM?

You might also like