

Ask HN: Is python a programming lang. or a scripting lang? - noobplusplus

Google for <i>Python</i> and the title is - <i>Python is a programming language</i>.<p>But if I understand correctly, it is a scripting language.<p>So I bumped into this doubt - is python a programming or a scripting language?
======
Rust
Helpful answer: Python is a programming language. It can be used to create
scripts, making it a scripting language as well.

More or less by definition, a scripting language is a programming language.

In a practical sense, and as stonemetal says, there is no real-world
difference between a programming language and a scripting language.

In a technical sense though, one might consider a programming language to have
a compiler and linker and debugger and able to create stand-alone executable
files. Most scripting languages can also do that these days.

Perhaps the best guide then is intent - if a language is intended for script
tasks (Windows/DOS batch files, for example, or even PHP), it is a scripting
language. If the language supports a wider focus, it is a more general purpose
programming language (Python, C, PERL, Java, etc.).

Ultimately, the best tool for the job, selected from the tools you know :) If
you're writing a web application, there are a few languages either explicitly
designed for that (PHP is a good/bad example), but many other languages can do
it as well (Python, C, PERL, Java, etc.). If you're writing a desktop
application, PHP would not be your best bet, but Python might not be either.
Ditto mobile apps.

------
jacobquick
Rust has it right, python is a programming language. One of its more common
uses is for "scripting," because you can just write it and run it at a prompt,
the compilation will happen automatically if you don't do it manually. That
part of python is designed to feel like scripting, but it isn't.

Because it is a general purpose programming language, you can use it to make
applications as well. Right now at work I'm using Salt Stack, which is a full
application written in python. Django is another popular application written
in python.

It's easy to think of python as a scripting language because a lot of people
who graduate to python from perl only ever used perl for scripting, but that's
a general purpose language as well.

Really the difference between "programming languages" and "scripting
languages" has nothing to do with the language and everything to do with
restrictions placed on the environment you use it in. Where a normal install
of python would let you code scripts or full applications, a purposefully
limited version of it (for example a limited version of python is bundled as a
mod tool in the game Civilization 4) makes that specific implementation
"scripting" or "macroing" or however else you want to classify it. The
language itself is still python, though.

------
_random_
There is no strong line between two, but experienced devs would have a gut
feeling. The rule of thumb is how much code can be checked during compile
time. Since Python is dynamically-typed only, it makes it a script language.
It's basically something you want to put on the top of some sort of "core".
Another metric is the speed of execution. Python is quite slow - like other
high-level script languages. There you go.

------
stonemetal
What do you see as the difference between a scripting language and a
programming language? All scripting languages are programming languages.

~~~
shire
read his name, noobplusplus

------
codegeek

                  Programming 
                         *
                        *
                       *
                      *
                     *
                  Scripting 
                         * *
                        *   *
                       *     *
                      *       *
                     *         *
                    Python     Perl...etc

------
AsmMAn
I think that you're a bit confusing about the terms, interpreted or compiled
ones, they are programming languages. Even the first BASIC is one.

------
OafTobark
Python is a general purpose programming language that can be used for
scripting.

------
SamReidHughes
There's no such thing as "scripting" languages.

------
hashtree
Yes.

------
bockris
Why does it matter?

~~~
catenate
People like to put down scripting, especially shell scripting, as "not a real
language." I prefer shell scripting, since it lets me tie together programs
written in many languages, each doing something that language does very well.
The opposite of this would be to try to do everything in one language, which
seems inefficient to me. Difficult applications of one language are often
handled efficiently in some other--why not take advantage of that? Of course,
I've made my peace with living in a polyglot computing world, and having to at
least superficially know many programming languages and little-language tools.

The best difference I've seen between "programming" and "scripting" is Knuth v
McIlroy, summarized here. [http://www.leancrew.com/all-this/2011/12/more-
shell-less-egg...](http://www.leancrew.com/all-this/2011/12/more-shell-less-
egg/)

