Difference between script and program?

What is the difference between a script and a program? Most of the time when I hear that a script is running, is it not a program? I am a little puzzled, can anyone understand this?

+55
scripting
Feb 18 2018-10-18T00
source share
11 answers

For me, the main difference is that the script is interpreted while the program is running (i.e. the source file is compiled first, and the result of this is expected to compile).


Wikipedia seems to agree with me:

Script :

"Scripts" differ from the main application code, which is usually written in another language and is often created or minimally modified by the end user. Scripts are often interpreted from source code or bytecode, while the applications that they control are traditionally compiled into machine code.

Program :

The program has an executable form that the computer can use follow the instructions.
The same program in its human-readable source code from which the executable program files are produced (for example, compiled)

+38
Feb 18 '10 at 5:45
source share

I am using a different view.

"script" is code that acts on any system externally or independently and can be deleted or disabled without shutting down the system itself.

A “program” is code that represents a system. Program code can be written in a modular way with a good separation of problems, but the code is fundamentally internal and depends on the system itself.

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

+30
Feb 18 '10 at 6:15
source share

Cm:

The difference between the program and Script

A Script is also a program, but without an opaque layer hiding (the source code), while the program has clothes, you cannot see it with the source code if it is not decompiled.

Scripts need other programs in order to run them until the programs need them.

+10
Feb 18 2018-10-18T00
source share

Typically, a script is a lightweight, fast-built, perhaps one-time tool. It is usually interpreted, not compiled. Python and bash are examples of scripting languages ​​used.

The program is built in a compiled language, such as C or C ++, and usually runs faster than a script for this reason. Larger tools are often written as “programs” rather than scripts — smaller tools are easier to develop as scripts, but scripts can become cumbersome as they grow. Application languages ​​and systems (those used to create programs / applications) have tools to facilitate the management of this process.

You can usually look at the script in a text editor to see what it does. You cannot do this with an executable program - the latest instructions have been compiled into bytecode or machine language, which makes it very difficult for people to understand without special tools.

Pay attention to the number of "forts" and "usually" above - the terms are foggy and sometimes intersect.

+10
Feb 18 2018-10-18T00
source share

A “program” as a whole, a sequence of instructions written so that a computer can perform a specific task .

A "script" is code written in a scripting language. A scripting language is nothing more than a type of programming language in which we can write code to control another software application .

In fact, programming languages ​​have two types:

but. Scripting language

b. Compiled language

Read the following: Scripting and compiled languages

+6
Mar 28 '12 at 3:14
source share

Scripts are usually interpreted (by another executable file).

Typically, a program is a stand-alone compiled executable file (although it may be library dependent), consisting of machine code or byte codes (for compiled programs "right at the point in time")

+3
Feb 18 2018-10-18T00
source share

According to my perspective, the main difference between a script and a program:

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

Programs are autonomous code fragments that can never be embedded in other technologies.

If I'm wrong anywhere, please correct me. I will admire your correction.

+2
Apr 19 '10 at 9:45
source share

In the scenario and reality of the program, there are two aspects:

  • Is the language powerful enough, especially with string operations, to compete with a macro processor such as the posix shell, and especially bash? If it is not better than bash to run some function, its use is not so much.

  • Is the language convenient and quick to start? Java, Scala, JRuby, Closure, and Groovy are all powerful languages, but Java requires a lot of templates, and the JVM, which they all require, takes too much time to run.

OTOH, Perl, Python, and Ruby all run quickly and have powerful string processing operations (and pretty much all other operations), so they tend to occupy the sometimes "humiliating" but not-easy-encroaching "scripting world". It turns out that they are good at launching entire traditional programs.

To the left of limbo are languages ​​like Javascript, which are not used for scripting, but could potentially be. Update: since it was written by node.js , it was released on several platforms. In other news, the question was closed. "Oh good".

+1
Feb 18 2018-10-18T00
source share

A structure or other similar circuit will run / interpret the script to complete the task. The program is compiled and launched by the machine to complete the task

0
Feb 18 2018-10-18T00
source share

MMO Script - this is the type of instruction that the program should execute. The program is the type of instruction that the hardware should execute

Although I think .NET / JAVA bytes are scripts by this definition

0
Feb 18 2018-10-18T00
source share

script : it contains a set of script language commands that control, run other system programs, applications can also be scheduled.

Program : contains a set of instructions that perform a specific task when compiling a program with a compiler.

0
Mar 28 '12 at 8:25
source share



All Articles