5 ms·
I think this is just helping perpetuate an artificial meaningless classification of languages. This entire "scripting language" vs. ? ("general purpose languag
by YZF 13y ago
I think this is just helping perpetuate an artificial meaningless classification of languages.
This entire "scripting language" vs. ? ("general purpose language"? "systems programming language"?) is really not well defined in the first place.
What makes some language a scripting language? Is Python a scripting language or a general purpose language? Scripting for a specific platform? "General" scripting language?
I think most people think of "scripting languages" as languages used for automating small tasks that aren't suitable (the languages, that is) for large applications. By that definition any general purpose language is automatically a "scripting" language but not the other way around.
And what does having a REPL vs. not or an interpreter vs. a compiler have to do with any of this?
- pjmlp 13y agoThere are definitions well accepted by those that care to study programming languages in terms of Computer Science. The problem is that many discuss what they think a certain programming language is, without the proper bases to do so.
- YZF 13y agoWhat is the CS definition for "scripting language"?
- pjmlp 13y agoThey usually share a set of features in terms of typing, extensibility, ability to be used more as glue language than real applications, interactivity A well known paper that discusses those capabilities is the John Ousterhout's paper for the 1998 IEEE COMPUTER, "Scripting: Higher Level Programming for the 21st Century". http://www.stanford.edu/~ouster/cgi-bin/papers/scripting.pdf http://www.stanford.edu/~ouster/cgi-bin/papers/scripting.pdf
- judk 13y agoNice backpedal from "definitions".
- pjmlp 13y agoIt is a paper for a well regarded Computer Science institution, not the opinion of the guy on the corner. Do you want some kind of ISO/ANSI standard definition?
- judk 13y agoI want you read the paper and understand how it talks about various language characteristics that a given language can embody to varying degree.
- bcoates 13y ago> And what does having a REPL vs. not or an interpreter vs. a compiler have to do with any of this? A lot. As a class, languages that can be executed by sending program text to stdin without polluting the execution environment are suitable for a whole class of programming techniques that languages that can't aren't. For example, heredoc-ing to inline one language's code into another, generating code at runtime, or executing on another machine over ssh are much trickier propositions in Java or C++ than they are in Awk or Python. REPL availability matters because it's common to use one or more REPLs as a primary UI to a machine. Lots of people use Bash or another *sh, some people use Python or a Lisp, but I've yet to hear of anyone using a C++ REPL as their shell even if such a thing may exist. Theoretically, these are properties of the implementation and not the language, but language features tend to be so coupled to that implementation decision that it doesn't matter. (go with its 'go run' is a maybe-exception)
- YZF 13y agoAs you say those are implementation details. We also can't have any meaningful discussion using your definition. What does "polluting the execution environment" mean? Are we restricting the discussion to platforms/languages where "stdin" has a meaning? By it's nature, a scripting language's job is to "pollute it's environment", i.e. to perform some modification of the state of the system it is scripting. A scripting language is most certainly not a "filter", something that takes some input via a pipe and produces some output.
- bcoates 13y agoStdin isn't important, but the ability to treat the whole environment as a process that takes source code as an input is. Mutating the environment isn't necessary to be a useful program. The techniques of "move the code to the data, not the data to the code" and "share by communicating, don't communicate by sharing" depend on this. The actual implementation behaviors of C and Java prevent me from treating a remote system as an abstract, environment-free machine, at least without doing a ton of tooling. The almost unavoidable, unwanted side-effects on the local filesystem due to executing source code is what I'm referring to as pollution.
- YZF 13y agoLet's attempt some sort of a definition A scripting language is a language L with respect to an environment E where a sequence of operation that can be performed manually in E (a script) can also be performed by invoking a program in language L. A stronger definition can involve multiple environments E for the same language. A general purpose language L with respect to an environment E is a language in which every possible application that can run in E can be performed by invoking a program written in language L. Then again we can strengthen this definition by including multiple platforms or environments. Most people I know use "scripting language" in a derogatory way, "it's only a scripting language, you can't use it for real applications" and often with respect to perfectly good general purpose languages (which is why this approach isn't always constructive).
- crazygringo 13y agoIt isn't well defined? I always thought a scripting language was evaluated/compiled at runtime (therefore slower, often allowing dynamically generated code to be executed, no low-level memory management like pointers), versus traditional languages which are compiled (either to assembly, or some intermediate representation, but dynamically generated code in the original language is necessarily out of the picture). Obviously the name "scripting" comes about from the fact that such langauges are intended for "scripting" automating interaction with "objects" (application scripting, HTML scripting, shell scripting, etc.), and that high-level features and on-the-fly execution are more important than performance. I've never met anyone who thought Python wasn't a scripting language -- I mean, you run the Python interpreter on the script file. And I've never met anyone who would call a compiled language (C, Java, etc.) a scripting language. The distinction is pretty clear to me; maybe other people can think of counterexamples?
- adamnemecek 13y agoWell there is a distinction between the language and the language implementation. Being scripted or compiled is a feature of the implementation but a lot of people think that it's a feature of the language. It is kind of a pedantic point to make but there are for example CINT (http://en.wikipedia.org/wiki/CINT http://en.wikipedia.org/wiki/CINT) which is an interpreter for C/C++ or BeanShell (http://en.wikipedia.org/wiki/BeanShell http://en.wikipedia.org/wiki/BeanShell) which is an interpreter for Java.
- YZF 13y agoPython is compiled into Python byte code. Is Scala compiled or interpreted? (it has a REPL...) http://stackoverflow.com/questions/2998215/if-python-is-interpreted-what-are-pyc-files http://stackoverflow.com/questions/2998215/if-python-is-inte... Do we need to compile to machine languages? What about a VM? What about the Python VM is different than the Java VM or the .NET VM? Is C# therefore a scripting language or a ______ language. (fill in the blank) ActionScript? What about JIT compilers? JavaScript? At any rate, I think you're trying to say scripting langugage == interpreted language but there are probably interpreted languages (let's say Prolog) that you wouldn't call scripting languages and there are compiled languages that can be used for "scripting". I agree that typically scripting languages are interpreted. But I would call Python a general purpose language and not a scripting language.
- pbiggar 13y ago> What makes some language a scripting language? A surprisingly difficult question that I've wrestled with a lot (I did a PhD in "compilers and scripting languages" and people can be quite picky about semantics!). Here's how I think about it: http://stackoverflow.com/a/1281922/104021 http://stackoverflow.com/a/1281922/104021