Sign up ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free.

closed as not constructive by ChrisF Jul 3 '12 at 21:17

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.

This question on Stack Overflow has some good answers:… (unsurprisingly, this question has been asked many times). –  Greg Hewgill Feb 10 '11 at 5:56
By the way, C++ is a perfect scripting language, see –  SK-logic Feb 10 '11 at 10:51
There is no clear demarcation line, and there's lots of differences between Python and C++ that have no bearing on this. –  David Thornley Feb 10 '11 at 14:55
What is the main difference between animals and mammals? Oops, just catched a CategoryErrorException. –  Ingo Feb 2 '12 at 11:42
You seem to have a misconception - you use the terms as if "scripting languages" were no "programming lanuguages", what IMHO is an insulting nonsense. –  Doc Brown Jun 2 '12 at 7:41

16 Answers 16

up vote 23 down vote accepted

The main difference is in how they are used.

Scripts are typically quick and dirty. Say, a bash script to make your life easier. Whereas a 'programming' language is meant to be much more thought out and deliberate.

That's not to say that you can't do that with a 'scripting' language. You can make full-blown GUI applications (or web app) with python as well as C++. The thing with 'programming' languages is that they are usually faster, and offer more control over low-level things if you want.

'programming' languages are typically used in scenarios where the code will be around for a long time. If you want to write something quickly and then never use it again, 'scripting' languages are what you want.

All of the above is of course subject to a person's expertise in a given language. As long as a language is Turing Complete you can do pretty much anything with it. The only thing that controls what you can do with it is libraries and how 'high level' the language is (you can't malloc() in PHP).

share|improve this answer
I think the "scripting language" vs "programming language" is a rather arbitrary and pointless distinction. As you mentioned, you can write "programs" (as opposed to "scripts") in Python, so it doesn't make sense to call Python a "scripting language". –  Dean Harding Feb 10 '11 at 5:34
As Dean has said, Python is not really a scripting language –  Arjun J Rao Feb 10 '11 at 11:37
In my head, scripting languages == interpreted languages and programming languages == complied languages. It is the only way I can make any sense out of the distinction. –  Ted Dec 29 '12 at 1:38
@Ted: IMHO, there's no such thing like "compiled" language - it's all matter of implementation. IIRC there's a C interpreter, what does it mean? That said, I don't like the other definitions either. –  maaartinus Jan 18 '14 at 16:17

None. Scripting languages ARE (a subset of) programming languages.

From Wikipedia:

A scripting language, script language or extension language is a programming language that allows control of one or more software applications. "Scripts" are distinct from the core code of the application, as they are 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 application software is typically first compiled to a native machine code or to an intermediate code.

share|improve this answer
That doesn't imply that all programming languages are "scripting" languages, though... for whatever that's worth. –  Dean Harding Feb 10 '11 at 9:11
Just like not all rectangles are squares, but the opposite is true. I've updated the answer a bit. –  Mchl Feb 10 '11 at 9:41

Scripting languages are programming languages.

The idea that the two types are separate ("versus") comes from people who are trapped in the mindset that a language cannot be both convenient and powerful. Mostly, these people have a C or C++ background, and they've worked hard to stay as close as possible to their language of origin (Java, C#). It's natural that they choose to denigrate whatever the new, popular language is this way.

"Scripting language" isn't a very useful term any more, but it does have some meaning. In my opinion, if you call a language a "scripting language", it should be a complement. It means that the language is suitable for scripting, rather than that it is not suitable for something else.

(+1 for all the answers naming concrete features; I think that supports this point.)

share|improve this answer

Scripting and Programming is not how you classify languages. Scripting and Programming is how you classify what you are doing with the language. But in the end , these are loose and overlapping classifications.

share|improve this answer

"Programming language" is the general term for all programming languages. "Scripting language" describes how any language is used in some specific context.

The main two areas which people usually refer to as "scripting" are:

  1. doing (mostly) simple file-system related tasks in the shell (i.e. shell scripting)
  2. running scripts in an interpreter/VM that is embedded inside a larger host application (e.g. Python scripting in Blender or Lua scripting in World of Warcraft).

So you can talk about the scripting language of a specific application, but as general classification, I think it isn't very useful to label a language as a scripting language, unless you are talking about a DSL for which a standalone execution model just doesn't exist.

share|improve this answer

I would recognize the Wikipedia entry on scripting languages as a reasonably complete and accurate description of scripting languages, which I would consider to be a subset of programming languages. Wikipedia gives some sense as to how the term has developed over the years, and the broad range of languages which it is applied to in common usage.

That being said, in my experience "scripting language" is a very fluid term, and I think it doesn't do at all to be pedantic over its definition. For one thing, programming language textbooks themselves do not agree on what the definition should be (I checked three). For another thing, many historic languages in the scripting domain have grown in power, just as their communities have innovated around them, and some have become reasonable programming languages for a wide variety of activities.

Javascript I think is a good example of this: consider how node.js and Riak's MapReduce features carry the reach of Javascript well beyond its traditional use in a web browser. Perl's 1.000 man page says this:

Perl is a interpreted language optimized for scanning arbitrary text files, extracting information from those text files, and printing reports based on that information. It's also a good language for many system management tasks.

and goes on to make comparisons to sed, awk, and shell scripting languages. However, Perl has since grown into a much more complicated language with a substantial library of modules that also extend its reach beyond this initial domain.

I sometimes hear the distinction being made (even on this forum) that scripting languages are generally "less capable" than other programming languages. I think this is a poor way to describe the difference between them. IMO it's far more productive to evaluate each so-called scripting language on its own terms, considering both advantages and limitations when compared to other languages, and when evaluated for use in a particular application domain. Dr. Shriram Krishnamurthi's paper "Teaching Programming Languages in a Post-Linnæan Age" confirms a lot of my thoughts on the matter.

share|improve this answer

Mike's got the right idea - Compiled vs. interpreted, which results in the released package containing either an executable or a script, respectively. This has several consequences:

  • Scripts can be run right after writing, executables have to be compiled first.
  • Scripts need a separate environment (such as Python or Bash) to run, while executables only need the operating system.
    • Because of this, an executable can often be faster than the equivalent script, and consumes less memory. However, this is highly implementation dependent.
  • Scripts are usually cross-platform*, while executables generally work on a single platform.
    • You can of course compile executables for several platforms separately if your software doesn't depend on any platform specifics.

* I couldn't find a reference, but there's a quote that goes something like "Java isn't cross-platform, it is a platform".

share|improve this answer
There are language implementations in which what you've just written is compiled on the fly. Lots of Common Lisp implementations do just that. Also, a lot of compiled executables do require a runtime, be it .NET or something more specific. –  David Thornley Feb 10 '11 at 14:58
And there are mechanisms for building executables out of scripted programs too. –  Donal Fellows Feb 12 '11 at 22:12

Scripting languages usually don't have explicit mentions of data types (think Perl or Tcl). Programming languages (C, C++, Java) require you to explicitly specify data types.

Scripting languages are often interpreted, programming languages compiled.

Scripting languages are wildly used in doing glue code, programming languages tend to solve a range of problems, often domain specific.

share|improve this answer
Overly generalising. There are quite a few dynamically typed programming languages. eg Prolog, Smalltalk, Lisp, APL and some variants of BASIC. –  quickly_now Feb 10 '11 at 11:03

My personal definition is that a scripting language is dynamically typed, provides some sort of an eval(...) function, decent FFI and some kind of a REPL. It does not matter if it is compiled or interpreted, boundaries between compilation and interpretation are too blured nowdays. Of course it is subjective, there is no strict definition of a scripting language.

share|improve this answer
So Forth is a scripting language? –  btilly Feb 11 '11 at 9:12
Yes, Forth can be a scripting language and it is actually often used this way. –  SK-logic Feb 11 '11 at 9:42

There really isn't any technical difference. When you get right down to it, all programs are 'interpreted' by the hardware, so you can't draw a distinction between compiled and interpreted languages.

I see it as a difference between uses. Scripts are instructions to a program, say for configuration. Programs are seen by the end-user. Taking a web server as an example, scripts would be used to configure how the server presents a website, while the server (a program) does the actual presenting.

A language might be optimized for scripting, but if it is Turing complete, you could write a program in it. On the flip side, I've done "scripting" tasks in C when I wasn't familiar with a batch language. It's not the easiest or cleanest way to do things, but it works.

share|improve this answer

One difference is C++ is a compiled while Python is interpreted. A C++ program is compiled once. After that, it can be run any time. A Python program is compiled every time it is used.

share|improve this answer
And how about BASIC? That can be compiled or interpreted. Some would not call it programming OR scripting, perhaps brain-death. Then again I did lots of BASIC programming, once, and I'm still alive. –  quickly_now Feb 10 '11 at 10:59
Does a scripting language turn into a programming language the moment somebody introduces a good compiler? –  David Thornley Feb 10 '11 at 14:56

Whether they are compiled or not, the distributed version of scripting languages is usually still the source file (.php, .pl, .py, .sh etc) whereas the distributed form of "programming languages" is usually a binary executable (may be bytecodes that runs on top of a VM).

share|improve this answer
There's a blurry continuum, with C++ at one end and Bourne shell at the other. Java and Python both lie in between (though at different points). –  Donal Fellows Feb 12 '11 at 22:16

Another use of scripting is to link actions together in ways which may need to change over time.

So you would write function blocks in, say C/C++, and call them using a script. The function blocks themselves remain constant over time but the way they are called can be easily adapted as needs change by changing the script.

share|improve this answer

There are no specific data types for variables in scripting languages while in programming languages the variable must have some data type declarations. Moreover, the scripts are directly executed step by step without being compiled whereas most programming languages like Java, C, and C++ are compiled first and then they give output.

share|improve this answer
SO what would you call Lisp which is weekly typed and can be interpreted or compiled? Or Erlang which is weekly typed but compiled, or Haskell which is very strongly typed but can run in an interpreter –  Zachary K Feb 1 '12 at 8:12

The Software Engineering Radio podcast has an episode about scripting languages

In this Episode, Alexander and Markus talk about scripting languages. Topics include the definition of what a scripting language is, typical usage scenarios, performance issues, programming styles and IDE support. In later Episodes we will talk about more specific topics, such as dynamic typing, reflection, functional programming as well as specific languages such as Ruby.

share|improve this answer

Apart from compiled and interpreted code, the real difference between the two is incase of programming language the compiler can perform optimization of code where scripting language being interpreted runs as a sequence of steps.

share|improve this answer
Depending on the environment, scripts can be optimised by the interpreter or JIT compiler. LuaJIT includes various optimisations, and nobody would ever say Lua was anything but a "scripting language". –  Dean Harding Feb 10 '11 at 9:20
The authors of the Flame worm used Lua as the framework for a very sophisticated reconnesense application that integrates plug-ins written in C++. I'm sure the Flame team thinks of Lua as a real programming language. 'Scripting' v. 'programming'...a distinction without a difference. –  Jim In Texas Jun 11 '12 at 3:12

Not the answer you're looking for? Browse other questions tagged or ask your own question.