3 ms·
All scripts are programs but not all programs are scripts. A script is a program which includes its source and where the compile step (if it exists) is abstrac
by js2 3y ago
All scripts are programs but not all programs are scripts.
A script is a program which includes its source and where the compile step (if it exists) is abstracted from the user, and where the source is distributed with the program.
Traditionally these are things which are run with a shebang first line, but that's not a strict requirement.
For example, if I distribute foo.java and can run it directly via "java foo.java" then foo.java is a script. (Java 11 added support for this.) If I have to run javac first and distribute only the resulting class, it's not a script.
That's my definition anyway.