Program vs Script: Understanding the Differences and Purposes

  • Thread starter Thread starter jd12345
  • Start date Start date
  • Tags Tags
    Program
Click For Summary

Discussion Overview

The discussion revolves around the distinctions between programs and scripts, exploring their definitions, characteristics, and the implications of these differences. Participants raise questions about the nature of scripts and programs, their execution methods, and the contexts in which they are used, touching on theoretical and conceptual aspects.

Discussion Character

  • Debate/contested
  • Conceptual clarification
  • Exploratory

Main Points Raised

  • Some participants propose that programs are run directly on a machine, while scripts are executed by other software, although this distinction is challenged.
  • There is a question about why scripts are considered lightweight and less strict compared to compiled programs, with some participants expressing uncertainty about this characterization.
  • Participants note that scripts are typically interpreted from source code or bytecode, whereas programs are compiled to native machine code, although this is not universally accepted.
  • One participant argues that not all interpreted languages should be classified as scripts, citing historical examples like BASIC and APL, which were considered programs despite being interpreted.
  • Another participant suggests that the terminology surrounding scripts and programs is not consistent, indicating a grey area in definitions.
  • There is a discussion about the nature of scripting languages and whether they are inherently interpretive, with some participants asserting that not all interpretive languages qualify as scripts.
  • One participant highlights that the term "script" may have originated from the need to move source code rather than executable files, although this reasoning is also questioned.
  • The distinction between scripting languages and interpretive languages is further explored, with some participants suggesting that the definitions are not clear-cut.

Areas of Agreement / Disagreement

Participants express differing views on the definitions and characteristics of scripts and programs, with no consensus reached on the distinctions or the implications of these terms. Multiple competing perspectives remain throughout the discussion.

Contextual Notes

There are limitations in the definitions provided, as participants rely on varying interpretations and historical contexts. The discussion reflects a lack of clarity regarding the strictness and lightweight nature of scripts compared to programs, as well as the classification of interpretive languages.

jd12345
Messages
251
Reaction score
2
I am having this doubt for a long time and want to clear once and for all.
Here are the questions: -
1) What is the difference between program and script? (I believe program is run on a machine while script is run on another software but still I want your answers in case I am wrong)
2) Why are scripts lightweight and not that strict compared to compiled programs?
3) Why are scripts interpretive but programs compiled?
 
Physics news on Phys.org
jd12345 said:
I am having this doubt for a long time and want to clear once and for all.
Here are the questions: -
1) What is the difference between program and script? (I believe program is run on a machine while script is run on another software but still I want your answers in case I am wrong)
2) Why are scripts lightweight and not that strict compared to compiled programs?
3) Why are scripts interpretive but programs compiled?

Your answer to #1 is not quite right, IMO. Can you try again? And what are your answers to the rest of the questions? Have you tried looking up definitions for these terms?
 
berkeman said:
Your answer to #1 is not quite right, IMO. Can you try again? And what are your answers to the rest of the questions? Have you tried looking up definitions for these terms?

Here are the wikipedia answers: -
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)

So scripts are interpreted while programs are compiled. Since these are the definitions there is no point asking why this is so.

So the question remaining is: Why are scripts lightweight and not so strict?
I find no reason why they can't be.

Another question which comes: Are all interpretive languages scripts?
From the definition I suppose yes.
 
A scripting language is just a programming language like any other. A program written in a scripting language, however, may not compile down to an executable file--which means, to run it, you'll need the source code. From the point of view of the programmer herself, it makes little difference (except, possibly, for performance).
 
jd12345 said:
So scripts are interpreted while programs are compiled.

Not always true. The original BASIC language was the earliest wide-spread interpretive language and programs written in it were never called "scripts", they were called "programs" and were thought of as such. The fact that they were interpreted at run-time was irrelevant.

Similarly, APL, an early interpreted language was the same in that programs written in APL were never thought of or described as "scripts" but as "programs".

On the other hand, complex programs written in JavaScript are not likely to be thought of or described as "scripts" but as "programs" even though they are written in a scripting language.
 
jd12345 said:
So the question remaining is: Why are scripts lightweight and not so strict? I find no reason why they can't be.
I'm wondering what you might mean by 'strict'? Is this perhaps your translation from another language?

Another question which comes: Are all interpretive languages scripts?
From the definition I suppose yes.
There is a grey area where either term could apply, IMHO, and the designers seem to have settled on one term or the other in their early published documentation, and then it sticks.
 
Technically speaking, the fact that you had source code (and not an executable file), when moving a function from one user or machine to another, was probably the first reason people started calling them scripts rather than programs.

Often that was because they were interpreted, but that is no longer the case in all situations.
 
jd12345 said:
Are all interpretive languages scripts?

Actually, you are confusing terminology here. A "script" is a program not a language. The right form would be "are all scripting languages interpretive" and I think the answer to that is yes although as has been mentioned, interpretive languages may have compilers.
 
  • #10
If you read the wiki article, scripting is more like what dos or windows call batch files and linux / posix / unix calls shell scripts, placing commands normally entered one at a time by the user into a text file. Usually there are additional features such as looping, conditionals, "calling" or "spawning" of other scripts. There are also more general purpose scripting languages, and I don't know where the line is drawn between a scripting language and an interpretive language.

I would consider APL and Basic to be interpretive languages, not scripting languages. Even though APL and Basic can be used interactively like a calculator, they also include the ability to define functions.
 
  • #11
rcgldr said:
I would consider APL and Basic to be interpretive languages, not scripting languages. Even though APL and Basic can be used interactively like a calculator, they also include the ability to define functions.

JavaScript is by definition a scripting language but can easily be used to write complex programs, including functions. As I said earlier, I don't think any such programs would be called scripts, but a very small JavaScript program might be.
 

Similar threads

  • · Replies 9 ·
Replies
9
Views
5K
  • · Replies 29 ·
Replies
29
Views
6K
  • · Replies 29 ·
Replies
29
Views
4K
Replies
65
Views
5K
Replies
6
Views
3K
Replies
38
Views
4K
  • · Replies 6 ·
Replies
6
Views
1K
  • · Replies 27 ·
Replies
27
Views
5K
  • · Replies 12 ·
Replies
12
Views
2K
  • · Replies 7 ·
Replies
7
Views
3K