English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

2 answers

Scripts are short, specific in its usage, not suitable for compilation; if you are not sure of my meaning being right; consider why Python codes half the time compiled .pyc and intepreted .py because this is a good way to figure out what to compile and what not to.

Python, Java, .Net all uses byte codes, the term in them are different but still they are byte codes, not machine codes. Think of it as compiles to a machine that is not real but the act of compiling to a machine code interpolates programming codes to codes that optimizes use of registers and stuff that should be there within a real machine; if that machine code is in a coding for a machine that is not real then it is byte code.

2007-01-10 17:36:45 · answer #1 · answered by Andy T 7 · 0 0

Hello,

A note before explaining:

A)
Interpreter: Is a parser, checks each line of code for correctness and proceeds further, and stops further parsing when error is found in the script.

B)
Compiler: Is a also Parser (#A), but here, before executing or running the application, they are compiled to machine native language as an whole Object, so the application can run faster than the scripts. Compiler = "Parser" + "Converting a Object to Machine Language", so machine can understand, what it is.

A Brief:

Script (or a language a human can read) are something with can be written easily without any additional tools or utilities installed. (So its like giving computer a strength by default to execute to a minimal). In early days, when the WEB (in the mean of Internet) came to the public view, Where the technology was built to such a level that any operating system can understand the code and page can be viewed. So came the S/GML (Standard Generic Markup Language) as the common specification to Internet browsers for content viewing. As the technology grown with the days of WEB, the hunger was more to come up with something more than Markup Language (a plain English syntax where only browser can interpret them while viewing), So the SCRIPT thing came to rule, where we can embed them in the WEB page for any such interaction. SCRIPT was something similar to which is like HTML code where parsing of those markup language or scripting syntax happens in the time of viewing the page, which goes fine with WEB technology. Then that SGML took over to HTML 1.0 (where the first version of the web page was released with Hypertext Transfer protocol) and same the SCRIPT, first came was JavaScript 1.0 (with minimum functionality to embed)
which executes as the page progresses to show in the browser. Here the need was so specific, where compiler didn't served the purpose (which is compiled before execution and the appln runs) where they need some thing which is not compiled and interpret it while running.

So, SCRIPTS, are designed from the ground as an Interpreter for WEB technologies. Now a days, the SCRIPTING is more improved, and used in various ways and different languages for serving the purpose, not only for WEB, but also for Standalone execution, WMI, HTA and so on....

Finally, this is the main cause that SCRIPTS are made and run as the Interpreter, not as compiler.

BYTE CODE:

This is Technology OR Methodology where the application just complies the source code, but does not converts to the native machine language, which becomes specific to one machine. And the Executer takes care of this remaining part when the application is executed or running, so the remaining is compiled with native machine language where it is called, and runs the application. So as the JAVA, thats why they call it machine independent programming language, which does the same thing.

well, this is just an over lay

Hope this helps

2007-01-10 17:46:24 · answer #2 · answered by Raghavendra Mudugal 3 · 0 0

fedest.com, questions and answers