compile

compile - Many High-Level Languages Choosing a programming...

Info iconThis preview shows pages 1–10. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Many High-Level Languages Choosing a programming language... I Basic I Fortran 95 I Ada I Python I Haskell I C++ I Java We choose Java because it has fewer ways to shoot yourself in the foot. Terminology I compiling (originally): linking subroutines I translating: converting from a high-level language to a low-level I compiling: translating to native (of some real machine) code I batch: compile once, run many times I interpreting: running the program under the control of a software program I interactive: read-eval-print loop. Evaluate means interpret in this case; but now it could be extended to compile and run. Implementation A language may be translated or implemented by zero, one, or many different systems. Unqualified statements such as 1. Language X is compiled. 2. Language X is slow. are nonsense, because the speed of execution and the type of translation depend on the implementation. Of course, the language may influence or seek to influence the implementation. A language may be closely associated with a particular implementation. But a language itself is not an implementation. The world of language implementations is often quite complex. For example, there are the GNU gfortran and g77 compilers, not to mention many commercial compilers for Fortran. Also, there are the SUN JDK tools for Java, the IBM Jikes compiler for Java, and the GNU gjc compiler. Traditional Compilation How do you solve a hard problem? How do you solve a hard problem? One important approach is to break it into well-defined subproblems. (A compiler is just a big program.) Compilation Steps When examined in more detail, compilation takes several steps. 1. preprocessing, macro processing 2. translation (compiling) 3. assembling mnemonics 4. linking other code and preparing for execution Macros (an extremely dangerous facility) are common in C and C++. Java does preprocessing to translate character sets. Language Systems Language translation and execution systems are big and complex these days because computers can execute larger and larger programs faster and faster. The programmer or program user rarely sees the individual steps. IDEs, interactive language systems, JIT compilers, incremental compilers, and dynamic linking all conspire to hide and blur the important individual steps. (But make programming development faster and easier). Interpreting An interpreter is a program that takes another program as input and executes it, possibly line-by-line, possibly without translating it to an intermediate form. Sometimes the translation is to an intermediate form which may be executed by a virtual or abstract machine . Examples of abstract machines include: Forth virtual machine, p-code machine (Pascal), Python virtual machine, SECD machine (lambda calculus), Smalltalk virtual machine, Warren Abstract machine (Prolog)....
View Full Document

Page1 / 40

compile - Many High-Level Languages Choosing a programming...

This preview shows document pages 1 - 10. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online