언어는 언제 스크립팅 언어로 간주됩니까? [닫은]
언어를 스크립팅 언어로 만드는 것은 무엇입니까? 어떤 사람들은 "컴파일 대신 해석 될 때"라고 말합니다. 그러면 PHP (예를 들어)가 스크립팅 언어가됩니다. 이것이 유일한 기준입니까? 아니면 다른 기준이 있습니까?
또한보십시오:
스크립팅 언어는 다른 일을 "스크립트"하는 언어입니다. 주요 초점은 브라우저를위한 JavaScript, MS Office를위한 VBA와 같이 기존 앱이 원하는 방식으로 작동하도록 기본적으로 자체 앱을 만드는 것이 아닙니다.
단순한. 내가 그것을 사용할 때, 그것은 현대의 동적 언어입니다, 당신이 그것을 사용할 때, 그것은 단지 스크립팅 언어입니다!
일반적으로 스크립팅과 프로그래밍의 차이점에 대해 이야기 할 때는 스크립트가 해석되고 프로그램이 컴파일됩니다. 언어는 해석되거나 컴파일 된 (바이트 코드 또는 기계 코드) 다른 방식으로 실행될 수 있습니다. 이것은 언어를 서로 만들지 않습니다 .
어떤면에서는 언어 를 사용 하는 방식이 언어를 스크립팅 언어로 만듭니다 (예를 들어, 주로 C ++로 개발하는 게임 개발자 는 루아에서 개체를 스크립팅 합니다). 다시 말하지만, 선이 흐려집니다. 한 사람이 프로그래밍에 언어를 사용할 수 있고 다른 사람이 언어를 스크립팅하는 데 동일한 언어를 사용할 수 있습니다.
다음은 스크립팅 언어에 대한 위키 백과 기사입니다.
스크립팅 언어, 스크립트 언어 또는 확장 언어는 하나 이상의 소프트웨어 응용 프로그램을 제어 할 수있는 프로그래밍 언어입니다. "스크립트"는 일반적으로 다른 언어로 작성되고 최종 사용자가 만들거나 수정하기 때문에 응용 프로그램의 핵심 코드와 다릅니다. 스크립트는 종종 소스 코드 나 바이트 코드로 해석되는 반면, 스크립트가 제어하는 애플리케이션은 전통적으로 네이티브 머신 코드로 컴파일됩니다. 스크립팅 언어는 거의 항상 자신이 제어하는 응용 프로그램에 포함됩니다.
당신은 "보통", "종종", "전통적으로"그리고 "거의 항상"의 사용을 알게 될 것입니다-이것들은 모두 특정 언어를 "스크립팅 언어"로 만드는 고유 한 속성 세트 가 없음을 알려줍니다 .
"스크립트는 배우에게 제공하는 것입니다. 프로그램은 청중에게 제공하는 것입니다." -래리 월
나는 더 이상 큰 차이가 없다고 생각합니다. 소위 "스크립팅"언어는 종종 매우 빠르게 런타임에 컴파일됩니다. 그리고 "프로그래밍"언어 중 일부는 런타임에도 추가로 컴파일되며 (JIT 생각) "컴파일"의 첫 번째 단계는 구문 검사 및 리소스 확인입니다.
전화를 끊지 마십시오. 중요하지 않습니다.
내 정의는 일반적으로 바이너리가 아닌 소스로 배포되는 언어입니다.
이에 대한 답변이 많이 있습니다.
첫째 : 그것은 정말의 문제가 아니라 차이 스크립트 언어가 있기 때문에, 스크립트 언어와 프로그래밍 언어 사이 인 프로그래밍 언어. 어떤 특성이 어떤 프로그래밍 언어를 스크립팅 언어로 만드는지 다른 특성은 다른 프로그래밍 언어 가 스크립팅 언어 가 아닌지에 대한 질문입니다 .
둘째 : XYZ가 "스크립팅", "기능 프로그래밍", "객체 지향 프로그래밍"인지 또는 무엇인지 XYZ 언어가 무엇인지 말하기는 정말 어렵습니다. "함수 프로그래밍"이 무엇인지에 대한 정의는 분명하지만 "함수 프로그래밍 언어"가 무엇인지 아무도 모릅니다.
기능 프로그래밍 또는 객체 지향 프로그래밍은 프로그래밍 스타일입니다 . 거의 모든 언어로 기능적 스타일 또는 객체 지향 스타일로 작성할 수 있습니다. 당신이 웹에서 볼 수 Java 또는 C # 코드의 많은 아주 절차 및 객체 지향하지 반면 예를 들어, 리눅스 가상 파일 시스템 스위치 및 리눅스 드라이버 모델은 주로 객체 지향 C로 작성에도 불구하고 있습니다 전혀 . OTOH, 나는 매우 기능적인 Java 코드를 보았습니다.
따라서 함수형 프로그래밍과 객체 지향 프로그래밍이 어떤 언어 로든 수행 할 수있는 스타일 일 경우 "객체 지향 프로그래밍 언어"를 어떻게 정의합니까? 객체 지향 프로그래밍 언어는 객체 지향 프로그래밍을 허용하는 언어라고 말할 수 있습니다. 그러나 그것은 많은 정의가 아닙니다. 모든 언어는 객체 지향 프로그래밍을 허용하므로 모든 언어는 객체 지향입니까? 따라서 언어가 객체 지향 스타일로 프로그래밍 하도록 강요 하면 언어는 객체 지향입니다. 하지만 그 중, 정의의 많은 아니에요 : 모든 언어는 함수형 프로그래밍을 허용 따라서 어떤 언어는 객체 지향하지?
그래서 나를 위해 다음과 같은 정의를 찾았습니다.
언어는 만약 스크립팅 언어 (객체 지향 언어 / 함수형 언어)는 모두
- 쉽게 스크립트 (객체 지향 프로그래밍 / 프로그래밍 기능), 즉 그것뿐만 아니라 수 를하지만 만드는 간단 하고 자연 과 포함 된 기능 의 도움이 그것으로, AND
- 스크립팅 (객체 지향 프로그래밍 / 기능 프로그래밍)을 장려 하고 안내 합니다.
그래서 5 개의 문단 후에 "스크립트 언어는 스크립트 언어"입니다. 대단한 정의입니다. 아니.
분명히, 우리는 이제 "스크립트"의 정의를 볼 필요가 있습니다.
용어 "함수형 프로그래밍"반면 잘 정의되고, 그것은 단지 용어 불행하게도 스크립팅, 문제가있다 "함수형 프로그래밍 언어"입니다 :에서 세 번째 문제가 오는 곳은 모두 용어 "스크립트"용어 "스크립트 언어 "는 잘못 정의되어 있습니다.
먼저 스크립팅 은 프로그래밍입니다. 특별한 종류의 프로그래밍 일뿐입니다. IOW : 모든 스크립트는 프로그램이지만 모든 프로그램이 스크립트는 아닙니다. 모든 스크립트 세트는 모든 프로그램 세트의 적절한 서브 세트입니다.
제 생각에는, 스크립팅 스크립팅을 만들고 다른 종류의 프로그래밍과 구별하는 것은…
스크립트는 주로
- 스크립트에 의해 생성되지 않았습니다
- 스크립트와 독립적 인 수명
- 스크립트의 도메인 외부에 살고 있습니다.
또한 사용 된 데이터 유형 및 알고리즘은 일반적으로 스크립트가 아니라 외부 환경에 의해 정의됩니다.
쉘 스크립트를 생각해보십시오. 쉘 스크립트는 일반적으로 파일, 디렉토리 및 프로세스를 조작합니다. 시스템의 대부분의 파일, 디렉토리 및 프로세스는 현재 실행중인 스크립트에 의해 작성되지 않았을 수 있습니다. 그리고 스크립트가 종료 될 때 사라지지 않습니다. 수명은 스크립트와 완전히 독립적입니다. 그리고 그들은 실제로 스크립트의 일부가 아니며 시스템의 일부입니다. 쓰기 File
와 Directory
클래스로 스크립트를 시작하지 않았으며 이러한 데이터 유형은 걱정할 필요가 없습니다. 단지 거기에 있다고 가정 하고 작동 방식을 모르 거나 알 필요 도 없습니다 . 또한 자신의 알고리즘을 구현하지 않습니다. 예를 들어 디렉토리 탐색 find
의 경우 자체 너비 우선 검색을 구현 하는 대신 사용 합니다.
한마디로 : 스크립트는 스크립트와 독립적으로 존재하는 더 큰 시스템에 연결되어 시스템의 일부를 조작 한 다음 종료됩니다.
더 큰 시스템은 쉘 스크립트의 경우 운영 체제, 브라우저 스크립트의 경우 브라우저 DOM, 게임 (예 : World of Warcraft with Lua 또는 Second Life with Linden Scripting Language), 응용 프로그램 (예 : AutoLisp AutoCAD 또는 Excel / Word / Office 매크로 용 언어), 웹 서버, 로봇 팩 또는 그 밖의 다른 것.
스크립팅 측면은 프로그래밍 언어의 다른 모든 측면과 완전히 직교한다는 점에 유의하십시오. 스크립팅 언어는 강력하거나 약하게 타이핑하거나 엄격하게 또는 느슨하게 타이핑하거나 정적으로 또는 동적으로 타이핑하거나 명목상, 구조적으로 또는 덕 타이핑하거나 심지어 타이핑 할 수 없습니다. . 명령형 또는 기능적, 객체 지향적, 절차 적 또는 기능적이거나 엄격하거나 게으를 수 있습니다. 구현은 해석, 컴파일 또는 혼합 될 수 있습니다.
예를 들어, Mondrian은 엄격하게 정적으로 형식화 된 게으른 기능적 스크립팅 언어이며 컴파일 된 구현입니다.
그러나 스크립팅 언어 라는 용어 가 실제 세계에서 실제로 사용되는 방식은 위의 내용과 관련이 없기 때문에이 모든 것이 문제 가 됩니다. 가장 자주 모욕으로 사용되며 정의는 간단하고 단순합니다.
- 실제 프로그래밍 언어 : 내 프로그래밍 언어
- 스크립팅 언어 : 프로그래밍 언어
이것은 용어가 가장 자주 사용되는 방식 인 것 같습니다.
그것은 포르노와 같습니다. 당신은 그것을 볼 때 그것을 알고 있습니다. 스크립팅 언어의 유일한 정의는 다음과 같습니다.
A language which is described as a scripting language.
조금 원형인가요? (그런데 농담이 아닙니다).
기본적으로 언어를 스크립팅 언어로 만드는 것은 아무것도 없으며, 특히 제작자가 호출하는 것 외에는 없습니다. 현대 스크립팅 언어의 주요 세트는 PHP, Perl, JavaScript, Python, Ruby 및 Lua입니다. Tcl은 최초의 주요 현대 스크립팅 언어입니다 (첫 번째 스크립팅 언어는 아니지만 언어를 잊어 버렸지 만 Tcl보다 앞서 있다는 사실에 놀랐습니다).
나는 주요 스크립트 언어의 기능에 대해 설명 내 종이 :
A Practical Solution for Scripting Language Compilers
Paul Biggar, Edsko de Vries and David Gregg
SAC '09: ACM Symposium on Applied Computing (2009), (March 2009)
대부분 동적으로 형식화되고 해석되며 참조 구현 외부에 정의 된 의미가 없습니다. 그러나 주요 구현이 컴파일되거나 JIT 되어도 언어의 "자연"을 변경하지는 않습니다.
남아있는 질문은 새로운 언어가 스크립팅 언어인지 어떻게 알 수 있는지입니다. 글쎄, 그것이 스크립팅 언어라고한다면, 하나입니다. 따라서 Factor 는 스크립팅 언어 (적어도 쓰여졌을 때)이지만 Java는 그렇지 않습니다.
"스크립트 언어"는 많은 것을 의미 할 수있는 퍼지 개념 중 하나입니다. 일반적으로 소스 코드에서 실행으로 이동하는 한 단계 프로세스가 있다는 사실을 나타냅니다.
예를 들어 Perl에서는 다음을 수행합니다. perl my_source.pl
위의 기준에 따라 PHP는 스크립팅 언어입니다 (예를 들어 Zend Encoder를 사용하여 소스 코드를 "보호"할 때 "컴파일"프로세스를 수행 할 수 있음에도 불구하고).
추신. 스크립팅 언어는 종종 (항상 그런 것은 아님) 해석됩니다. 또한 스크립팅 언어는 종종 (그러나 항상 그런 것은 아니지만) 동적으로 유형이 지정됩니다.
모든 스크립팅 언어는 프로그래밍 언어입니다. 엄밀히 말하면 차이는 없습니다.
이 용어는 언어의 기본 속성을 나타내지 않으며 일반적인 언어 사용 을 나타냅니다 . 일반적으로 기존 코드를 호출하고 결과에 대한 간단한 처리를 수행하는 짧은 프로그램을 작성하는 경우 (일반적으로 스크립트 를 작성 하는 경우)는 스크립팅 언어입니다.
나는 Roberto Ierusalimschy 씨가 아주 좋은 답변이나 'Programming in Lua'에 대한 질문을 가지고 있다고 생각합니다.
그러나 해석되는 언어의 특징은 컴파일되지 않은 것이 아니라 컴파일러가 언어 런타임의 일부이므로 즉시 생성 된 코드를 실행할 수 있다는 것입니다.
한 부문은
- 스크립팅 = 동적 해석
- 보통 = 컴파일
동적으로 해석되는 언어는 런타임에 해석되는 반면 컴파일 된 언어는 실행 전에 컴파일됩니다.
Jörg가 지적했듯이 해석 / 컴파일 된 구별은 언어의 특징이 아니라 실행 엔진의 특징이라고 덧붙여 야합니다.
실행 시스템 대신 언어 측면에 더 관련되고 유형 시스템에 대한이 설명에 관심이있을 수도 있습니다 . 대부분의 스크립팅 언어는 동적으로 입력되지만 "일반"언어는 대부분 정적으로 입력됩니다.
일반적으로 정적 언어와 동적 언어의 구분은 더 잘 정의되고 언어의 유용성에 더 많은 영향을 미칩니다.
스크립팅 언어는 일반적으로 다음과 같습니다.
- 동적으로 입력
- Interpreted, with very little emphasis on performance, but good portability
- Requires a lot less boilerplate code, leading to very fast prototyping
- Is used for small tasks, suitable for writing one single file to run some useful "script".
While a non-scripting language is usually: 1. Statically typed 2. Compiled, with emphasis on performance 3. Requires more boilerplate code, leading to slower prototyping but more readability and long-term maintainability 4. Used for large projects, adapts to many design patterns
But it's more of a historical difference nowadays, in my opinion. Javascript and Perl were written with small, simple scripts in mind, while C++ was written with complex applications in mind; but both can be used either way. And many programming languages, modern and old alike, blur the line anyway (and it was fuzzy in the first place!).
The sad thing is, I've known a few developers who loathes what they perceived as "scripting languages", thinking them to be simpler and not as powerful. My opinion is that old cliche - use the right tool for the job.
Scripting languages were originally thought of as a control mechanisms for applications written in a hard programming language. The compiled programs could not be modified at runtime, so scripting gave people flexibility.
Most notably, shell script was automating processes in the OS kernel (traditionally, AppleScript on Macs); a role which more and more passed into Perl's hands, and then out of it into Python lately. I've seen Scheme (particularly in its Guile implementation) used to declare raytracing scenes; and recently, Lua is very popular as the programming language to script games - to the point that the only hard-coded thing in many new games is the graphics/physics engine, while the whole game logic is encoded in Lua. In the same way, JavaScript was thought to script the behaviour of a web browser.
The languages emancipated; no-one now thinks about the OS as an application (or thinks about it much at all), and many formerly scripting languages began to be used to write full applications of their own. The name itself became meaningless, and spread to many interpreted languages in use today, regardless of whether they are designed to be interpreted from within another system or not.
However, "scripting languages" is most definitely not synonymous with "interpreted languages" - for instance, BASIC was interpreted for most of its life (i.e. before it lost its acronimicity and became Visual Basic), yet no-one really thinks of it as scripting.
UPDATE: Reading material as usual available at Wikipedia.
First point, a programming language isn't a "scripting language" or a something else. It can be a "scripting language" and something else.
Second point, the implementer of the language will tell you if it's a scripting language.
Your question should read "In what implementations would a programming language be considered a scripting language?", not "What is the difference between a scripting language and a programming language?". There is no between.
Yet, I will consider a language a scripting language if it is used to provide some type of middle ware. For example, I would consider most implementations of JavaScript a scripting language. If JavaScript were run in the OS, not the browser, then it would not be a scripting language. If PHP runs inside of Apache, it's a scripting language. If it's run from the command line, it's not.
I see a scripting language as anything not requiring an overt heavy-weight feeling 'compile' step. The main feature from a programmers standpoint is: you edit code and run it right away.
Thus I would regard JavaScript and PHP as scripting languages, whereas ActionScript 3/Flex is not really.
My friend and I just had this argument: What is the difference between a programming language and a scripting language.
A popular argument is that programming languages are compiled and scripting languages are interpreted - However I believe this argument to be completely false...why?
- Chakra & V8 (Microsoft's and Google's JavaScript engines) compile code before execution
- QBasic is interpreted - does this make Qbasic a "scripting" language?
On that basis, this is my argument for the difference between a programming language and a scripting language:
A programming language runs at the machine level and has access to the machine itself (memory, graphics, sound etc).
A scripting language is sand boxed and only has access to objects exposed to the sand box. It has no direct access to the underlying machine.
In My Opinion, I would say that dynamically interpreted languages such as PHP, Ruby, etc... are still "normal" langauges. I would say that examples of "scripting" languages are things like bash (or ksh or tcsh or whatever) or sqlplus. These languages are often used to string together existing programs on a system into a series of coherent and related commands, such as:
- copy A.txt to /tmp/work/
- run the nightly cleanup process on the database server
- log the results and send them to the sysdamin
So I'd say the difference (for me, anyway) is more in how you use the language. Languages like PHP, Perl, Ruby could be used as "scripting languages", but I usually see them used as "normal languages" (except Perl which seems to go both ways.
I'll just go ahead and migrate my answer from the duplicate question
The name "Scripting language" applies to a very specific role: the language which you write commands to send to an existing software application. (like a traditional tv or movie "script")
For example, once upon a time, HTML web pages were boring. They were always static. Then one day, Netscape thought, "Hey, what if we let the browser read and act on little commands in the page?" And like that, Javascript was formed.
A simple javascript command is the alert()
command, which instructs/commands the browser (a software app) that is reading the webpage to display an alert.
Now, does alert()
related, in any way, to the C++ or whatever code language that the browser actually uses to display the alert? Of course not. Someone who writes "alert()" on an .html page has no understanding of how the browser actually displays the alert. He's just writing a command that the browser will interpret.
Let's see the simple javascript code
<script>
var x = 4
alert(x)
</script>
These are instructs that are sent to the browser, for the browser to interpret in itself. The programming language that the browser goes through to actually set a variable to 4, and put that in an alert...it is completely unrelated to javascript.
We call that last series of commands a "script" (which is why it is enclosed in <script>
tags). Just by the definition of "script", in the traditional sense: A series of instructions and commands sent to the actors. Everyone knows that a screenplay (a movie script), for example, is a script.
The screenplay (script) is not the actors, or the camera, or the special effects. The screenplay just tells them what to do.
Now, what is a scripting language, exactly?
There are a lot of programming languages that are like different tools in a toolbox; some languages were designed specifically to be used as scripts.
Javasript is an obvious example; there are very few applications of Javascript that do not fall within the realm of scripting.
ActionScript (the language for Flash animations) and its derivatives are scripting languages, in that they simply issue commands to the Flash player/interpreter. Sure, there are abstractions such as Object-Oriented programming, but all that is simply a means to the end: send commands to the flash player.
Python and Ruby are commonly also used as scripting languages. For example, I once worked for a company that used Ruby to script commands to send to a browser that were along the lines of, "go to this site, click this link..." to do some basic automated testing. I was not a "Software Developer" by any means, at that job. I just wrote scripts that sent commands to the computer to send commands to the browser.
Because of their nature, scripting languages are rarely 'compiled' -- that is, translated into machine code, and read directly by the computer.
Even GUI applications created from Python and Ruby are scripts sent to an API written in C++ or C. It tells the C app what to do.
There is a line of vagueness, of course. Why can't you say that Machine Language/C are scripting languages, because they are scripts that the computer uses to interface with the basic motherboard/graphics cards/chips?
There are some lines we can draw to clarify:
When you can write a scripting language and run it without "compiling", it's more of a direct-script sort of thing. For example, you don't need to do anything with a screenplay in order to tell the actors what to do with it. It's already there, used, as-is. For this reason, we will exclude compiled languages from being called scripting languages, even though they can be used for scripting purposes in some occasions.
Scripting language implies commands sent to a complex software application; that's the whole reason we write scripts in the first place -- so you don't need to know the complexities of how the software works to send commands to it. So, scripting languages tend to be languages that send (relatively) simple commands to complex software applications...in this case, machine language and assembly code don't cut it.
May I suggest that scripting languages has been a term lots of people are moving away from. I'd say it mostly boils down to compiled languages and dynamic languages nowadays.
I mean you can't really say something like Python, or Ruby are "scripting" languages in this day and age (you even have stuff like IronPython and JIT-your-favorite-language, the difference has been blurred even more).
To be honest, personally I don't feel PHP is a scripting language anymore. I wouldn't expect people to like categorize PHP differently from say Java on their resume.
Scripting languages tend to run within a scripting engine which is part of a larger application. For example, JavaScript runs inside your browsers scripting engine.
A scripting language is a language that is interpreted every time the script is run, it implies having a interpreter and most are very human readable, to be useful a scripting language is easy to learn and use.
Every compilable language can be made into a script language and vice versa it all depends on implementing a interpreter or a compiler, as an example C++ has an interpreter so it can be called a script language if used so (not very practical in general as C++ is a very complex language), one of the most useful script languages at present is Python...
So to answer your question the definition is on the use of a interpreter to run quick and easy scripted programs, to address simple tasks or prototype applications the most powerful use one can make of script languages is to include the possibility for every use to extend a compiled application.
I prefer that people not use the term "scripting language" as I think that it diminishes the effort. Take a language like Perl, often called "scripting language".
- Perl is a programming language!
- Perl is compiled like Java and C++. It's just compiled a lot faster!
- Perl has objects and namespaces and closures.
- Perl has IDEs and debuggers and profilers.
- Perl has training and support and community.
- Perl is not just web. Perl is not just sysadmin. Perl is not just the duct tape of the Internet.
Why do we even need to distinguish between a language like Java that is compiled and Ruby that isn't? What's the value in labeling?
For more on this, see http://xoa.petdance.com/Stop_saying_script.
An important difference is strong typing (versus weak typing). Scripting languages are often weakly typed, making it possible to write small programs more rapidly. For large programs this is a disadvantage, as it inhibits the compiler/interpreter to find certain bugs autonomously, making it very hard to refactor code.
Scripting languages are programming languages where the programs are typically delivered to end users in a readable textual form and where there is a program that can apparently execute that program directly. (The program may well compile the script internally; that's not relevant here because it is not visible to the user.)
It's relatively common for scripting languages to be able to support an interactive session where users can just type in their program and have it execute immediately. This is because this is a trivial extension of the essential requirement from the first paragraph; the main extra requirement is the addition of a mechanism to figure out when a typed-in statement is complete so that it can be sent to the execution engine.
For a slightly different take on the question. A scripting language is a programming language but a programming language is not necessarily a scripting language. A scripting language is used to control or script a system. That system could be an operating system where the scripting language would be bash. The system could be a web server with PHP the scripting language. Scripting languages are designed to fill a specific niche; they are domain specific languages. Interactive systems have interpreted scripting languages giving rise to the notion that scripting languages are interpreted; however, this is a consequence of the system and not the scripting language itself.
A scripting language is a language that configures or extends an existing program.
A Scripting Language is a Programming language.
The definition of "scripting language" is pretty fuzzy. I'd base it on the following considerations:
Scripting languages don't usually have user-visible compile steps. Typically the user can just run programs in one easy command.
Programs in scripting languages are normally passed around in source form.
Scripting languages normally have runtimes that are present on a large number of systems, and the runtimes can be installed easily on most systems.
Scripting languages tend to be cross-platform and not machine-specific.
Scripting languages make it easy to call other programs and interface with the operating system.
Scripting languages are usually easily embeddable into larger systems written in more conventional programming languages.
Scripting languages are normally designed for ease of programming, and with much less regard for execution speed. (If you want fast execution, the usual advice is to code the time-consuming parts in something like C, and either embed the language into C or call C bits from the language.)
Some of the characteristics I listed above are true of implementations, in which case I'm referring to the more common implementations. There have been C interpreters, with (AFAIK) no obvious compile step, but that's not true of most C implementations. You could certainly compile a Perl program to native code, but that's not how it's normally used. Some other characteristics are social in nature. Some of the above criteria overlap somewhat. As I said, the definition is fuzzy.
I would say scripting language is the one heavily manipulating entities it doesn't itself define. For instance, JavaScript manipulates DOM objects provided by the browser, PHP operates enormous library of C-based functions, and so on. Of course not a precise definition, more a way to think if it.
If it doesn't/wouldn't run on the CPU, it's a script to me. If an interpreter needs to run on the CPU below the program, then it's a script and a scripting language.
No reason to make it any more complicated than this?
Of course, in most (99%) of cases, it's clear whether a language is a scripting language. But consider that a VM can emulate the x86 instruction set, for example. Wouldn't this make the x86 bytecode a scripting language when run on a VM? What if someone was to write a compiler that would turn perl code into a native executable? In this case, I wouldn't know what to call the language itself anymore. It'd be the output that would matter, not the language.
Then again, I'm not aware of anything like this having been done, so for now I'm still comfortable calling interpreted languages scripting languages.
A script is a relatively small program. A system is a relatively large program, or a collection of relatively large programs.
Some programming languages are designed with features that the language designer and the programming community consider to be useful when writing relatively small programs. These programming languages are known as scripting languages, e.g. PHP.
Similarly, other programming languages are designed with features that the language designer and the programming community consider to be useful when writing relatively large programs. These programming languages are known as systems languages, e.g. Java.
Now, small and large programs can be written in any language. A small Java program is a script. For example, a Java "Hello World" program is a script, not a system. A large program, or collection of programs, written in PHP is a system. For example, Facebook, written in PHP, is a system, not a script.
Considering a single language feature as a "litmus test" for deciding whether the language is best suited for scripting or systems programming is questionable. For example, scripts may be compiled to byte code or machine code, or they may be executed by direct abstract syntax tree (AST) interpretation.
So, a language is a scripting language if it is typically used to write scripts. A scripting language might be used to write systems, but such applications are likely to be considered dubious.
참고URL : https://stackoverflow.com/questions/101055/when-is-a-language-considered-a-scripting-language
'program story' 카테고리의 다른 글
Python / Django : runserver에서 콘솔에 로그, Apache에서 파일에 로그 (0) | 2020.08.07 |
---|---|
폴더가 잠겨있어 잠금을 해제 할 수 없습니다. (0) | 2020.08.07 |
Facebook 좋아요 버튼-댓글 팝업을 비활성화하는 방법? (0) | 2020.08.06 |
console.log ()를 재정의하십시오. (0) | 2020.08.06 |
UIAlertController 사용자 정의 글꼴, 크기, 색상 (0) | 2020.08.06 |