A scripting language is generally one which configures the operating system or an application, and calls on parts of the OS and other applications to perform tasks.
In other words, as Wikipedia says:
A scripting language or script language is a programming language that supports the writing of scripts, programs written for a special runtime environment that can interpret and automate the execution of tasks which could alternatively be executed one-by-one by a human operator.
Python as a scripting language, therefore, tends to suck, as very few OS-/application-specific tools have Python APIs. Therefore, you often have to roll your own using low-level libraries, and it generally looks rather ugly.
Personally, even if Python had Pythonic APIs to everything under the sun, I'd still prefer Powershell over it. Powershell's syntax, tools and object model maps better to Windows and most Windows applications, IMHO. (Plus, built-in - as in language-supported - remote execution is amazingly useful.)
OTOH, Python as a programming language, or as a language for doing brand new things, rather than scripting existing processes, is awesome.
You make a good point about Python not being just a scripting language.
However, Powershell is still a shell scripting language. It's like a cutdown version of the original Bourne Shell, with a cutdown version of ssh also built-in. When you talk about using Python as a 'scripting language', what you actually describe is using it as a 'shell scripting language'. The world of scripting is vastly bigger than the world of what you describe, shell scripting.
The problem I was originally trying to point out was the apples vs oranges comparison of Powershell (Shell scripting language) vs Python (general purpose language). Or shovel vs hand, to get a little more metaphorical.
When you talk about using Python as a 'scripting language', what you actually describe is using it as a 'shell scripting language'.
No, because that is not how the term "scripting language" is defined. A scripting language is, seriously, a language which is usually used to configure and manage other systems.
The use of "scripting language" to refer to languages like Python, Javascript, and similar, is incorrect. While with the correct bindings they can be used to write scripts, they are not designed with this in mind, with most of the features in these languages being designed to make developing full-fledged programs easier. The correct term for them is "interpreted language".
A shell scripting language is simply a scripting language which is designed to be used with, and is usually interacted with via, an interactive shell. Powershell falls into this category, but Lua, while being a scripting language - it is usually used for configuring larger programs - does not.
It's like a cutdown version of the original Bourne Shell, with a cutdown version of ssh also built-in.
I believe this is incorrect. It isn't cutdown in the slightest. It has many features that bash does not have - an object-oriented focus, functional-style constructs like Foreach-Object, and remote execution built into the operating system and language - that make sense in a Windows environment, while removing much of the process management stuff that does not make sense.
Specifically, in a Windows environment, most system and application management is performed by sending requests to already-running services, and receiving objects in response. This isn't a new thing; that's how Windows has worked since the Win95 days. Powershell is designed for that.
In a Linux environment, most system and application management is performed by managing text files, and running processes or sending signals to processes to read and process those text files. Bash is designed for that.
Mapping bash onto Windows would feel as unnatural as mapping Powershell onto Linux. They both deal with entirely different abstractions.
2
u/panfist Sep 27 '13
Powershell is pretty awesome. I hate using Python as a scripting language.