Thursday, December 24, 2009

What are the differences between scripting languages and programming languages?

Scripting languages are languages that allow you to send commands directly to a system that executes these commands. These commands are read line by line and executed. An error is issued when a line cannot be executed for any reasn (wrong syntax, illegal operation,...). e.g. Python, shell-script, Matlab





Programming languages are languages that allow you to create a program by writing structured code that is read all at once by the system, checked for errors, and translated into an unreadable format that the machine can then execute. e.g. Java, C/C++, Visual Basic...





Programming languages are generally faster in execution than scripting languages but are often more difficult to use and have more rigid syntax. You can generally use either of them to do pretty much anything, though each is more suited for specific applications.What are the differences between scripting languages and programming languages?
A scripting language executes a series of commands - usually to the command shell of an OS - like a weekly backup of all files newer than 7 days old.





A programming language allows the writer to create an application which uses functions usually not part of the command shell, such as opening files and manipulating the data within them.What are the differences between scripting languages and programming languages?
The short answer: These days, the line between a scripting language and a programming language is blurred. As such, in practical application, the differences are meaningless. So the answer is: no.





Some details 鈥?what a nerd might tell you: Scripting or writing scripts, is programming within a program. Traditionally you would write scripts to automate certain functionality within another program. Traditionally scripts would have very specific task like for example: reading a text file to extract all the email addresses.





The primary difference between a ';programming language'; (C, C++, VB etc.) and a ';scripting language'; (PHP, ASP, JSP, JavaScript, VBScript)is that code written in a programming language needs to be compiled before it is run. Once it is compiled, it can be run any number of times.





Scripting languages, on the other hand, are interpreted at run-time. This means that every time you want to run the program, a separate program needs to read the code, interpret it, and then follow the instructions in the code. Compiled code has already been interpreted into machine language, so it is will typically execute faster because the conversion into machine language has already been done.





Markup languages (HTML, XML) are somewhat different from both of the others. A markup language is simply a set of tags that are used to ';mark up'; text documents so that sections of text can be logically arranged and labeled. These documents can be viewed as plain text, or, more commonly, are viewed through a browser. The browser parses the document, looking for markup tags, and it then arranges the text and/or formats it according to the values in the tags.
A scripting language is considered an 'intrepreted' language. Each program step is executed as it is reached, and the host 'interprets' the command right then.





A programming language requires a compiler which translates each command during the compilation process and produces a program, typically an .exe file which can be run as a 'stand alone' program.
Firstly, a scripting language _is_ a programming language. I think though you are trying to determine the difference between a scripting language and a compiled language. The difference is simple:





Compiled languages must be compiled before they can be executed - this means you run it through a compiler and it converts your source code into executable machine code.





Scripting languages are interpreted - this means they are only compiled ';on the fly';, line-by-line as each line is executed. For this reason, code written in scripting languages will almost always run slower than it's equivalent compiled language code.

1 comment: