开发者

What is the difference between a programming language and a scripting language? [duplicate]

开发者 https://www.devze.com 2023-01-11 09:22 出处:网络
This question already has answers here: Closed 12 years ago. Possible Duplicates: What’s the difference between a “script” and an “application”?
This question already has answers here: Closed 12 years ago.

Possible Duplicates:

What’s the difference between a “script” and an “application”?

When is a language considered a scripting language?

  1. What is the difference between a web application core language and a web scripting language? What is exact use of a web scripting language like Python?

  2. When we use a scripting language like 开发者_开发技巧Python with web application programming languages like Java or .NET, can the web application compiler understand the scripting language code and compile the same?

  3. Is it possible to write a totally new web application by using a scripting language like Python?


1. There is no difference. The distinction between “programming language” and “scripting language” is antiquated, and it was never really well-defined. It used to be vaguely like this: scripting languages tend to be interpreted rather than compiled, and people tended to write smaller pieces of codes (“scripts”) in them. Nowadays, however, the distinction is not useful anymore, and we call C# and Python both programming languages.

2. A Java or C# compiler, by definition, compiles Java and C#, respectively. Such a compiler cannot, in general, also compile code written in another programming language such as Python or JavaScript.

3. Yes, it is possible to write web applications in Python — in fact, it’s the more traditional approach. Many Google web apps (e.g. Google Docs) are written in Python. MediaWiki (used by Wikipedia) is written in PHP, and LiveJournal is written in Perl. These three programming languages are very similar (certainly compared to Java and C#). The use of compiled, statically-typed, VM-based languages (Java and C#) for writing web applications is a more recent development.


The main difference is that scripting languages tend to be used for specific purposes, that is, they tend to have a restrictive domain, take for instance JavaScript for browser scripting, likewise, many DB's include some sort of scripting language for programming DB specific tasks.

Programming languages, as a denomination, tend to refer to general purpose programming languages, one good example of this is Java, which can be used for developing many different kinds of applications from mobile to enterprise apps.


What is the difference between a web application core language and a web scripting language? What is exact use of a web scripting language like python?

Programming languages are compiled, and are usually strongly typed.

Scripting languages are interpreted, and are often weakly typed.

Python can be used for anything any other turing-complete language can be used for :)

When we use a scripting language like python with web application programming languages like Java or .net, can the web application compiler can understand the scripting language code and compile the same?

Nope. Well, there is jython, a python interpreter written in java, so in that sense, yes. But really, no.

Is it possible to write a totally new web application by using a scripting language like python?

Yeah, but python doesn't have a lot of the built-in web stuff languages like php or asp do. With a framework like Django, though, it's entirely possible to build complete, professional web applications fairly quickly (even with very little knowledge of python itself, I've found).

0

精彩评论

暂无评论...
验证码 换一张
取 消