300 likes | 818 Views
Programming Languages Generations. Intelligent Languages. Non-procedural L anguages. 5GL. 4GL. Procedural Languages. 3GL. Assembly Language. 2GL. Machine Language. 1GL. 1. Programming Languages Levels: Overview. 2. Programming Languages Levels: Machine Language.
E N D
Programming LanguagesGenerations • Intelligent Languages • Non-procedural Languages 5GL 4GL • Procedural Languages 3GL • Assembly Language 2GL • Machine Language 1GL 1
Programming LanguagesLevels: Machine Language • Only language understood by computers • Does not resemble human language • Hardware specific • Difficult to read and write • Sequence of bits 3
Programming LanguagesLevels: Machine Language Example • Machine code to calculate the greatest common divisor of two integers for the x86 (Pentium) instruction set. 4
Programming LanguagesLevels: Assembly Language • Hardware specific • Mnemonic symbols • Represent machine code instructions • Example: Add two numbers • ADD R1, R2, R3 • Requires translator • Assembler • Maps mnemonics to machine instructions and data 5
Programming LanguagesLevels: Assembly Language Example • Assembly language code to calculate the greatest common divisor of two integers forthe x86 (Pentium) instruction set. 6
Programming LanguagesLevels: High Level • Computer architecture/hardware independent • Portable • Resembles natural/human languages • Easy to read, write, maintain • Require translator • Compiler • Maps statements to machine instructions and data 7
Programming LanguagesLevels: High Level Language Example High level language (C language) code to calculate the greatest common divisor of two integers. 8
Programming LanguagesLevels: Abstraction • What is abstraction? • Focus on high level rather than implementation details. • What does it mean to high level languages? • Program statements do not deal with specific computer architecture. • Programming efficiency. • What sort of statements are used in high level languages? • Variables • Arrays • Expressions • Procedures, subroutines, functions 9
CompilationMachine Code: Executable • High Level Language • Machine Code • Compiler: Hardware specific translation software. • Machine Code Generation: High level source code translated directly into machine language. • Compiler 10
CompilationBytecode: Interpreted • Compiler • Interpreter • High Level Language • Bytecode • Machine Code • Intermediate representation: High level source code translatedinto bytecode • Interpreter: Translation / execution software 11
CompilationJava • Javac Compiler • Bytecode • Java SourceCode • MachineCode • Javac compiler: Executable bytecode - filename.class • Java classes and bytecodeloaded on first usage. • Stored in cache for future use. 12