1 / 20

High-level Programming Languages

High-level Programming Languages. Joshua 5D(9). Advantages for using high-level Programming Languages. Instructions are more English-like (Easier for human to understand and learn) A single instruction can define many operation at the machine level (Shorten the length of code to type).

Download Presentation

High-level Programming Languages

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. High-level Programming Languages Joshua 5D(9)

  2. Advantages for using high-level Programming Languages • Instructions are more English-like(Easier for human to understand and learn) • A single instruction can define many operation at the machine level(Shorten the length of code to type)

  3. Disadvantages for using high-level Programming Languages • Required to converted to machine languages before execution

  4. Third-generation Languages(3GL) • 3GLs are procedural languages (step-by-step ) • For business (COBOL) • For beginners (BASIC, Pascal) • For scientific purpose (FORTRAN) • For Server-side program (PHP) • Most popular and multipurpose (C language)

  5. Third-generation Languages(3GL) • COBOLADD YEARS TO AGE • Pascalage := age + years • C languageage += years

  6. Fourth-generation Languages(4GL) • 4GLs are declarative languages(Much closer to the natural languages) • Designed for solving specific problems • For Database management system (DBMS) :FoxPro, DBase, Structured Query Language (SQL)

  7. Fourth-generation Languages(4GL) More English like DBMS platform is provided and so 4GL can be easily written and run on it

  8. 3GL and 4GL • 3GL development methods are slow and error-prone (easy to make error) • Some applications could be developed more rapidly by adding a higher-level programming language and methodology which would generate the equivalent of very complicated 3GL instructions with fewer errors • 4GL projects are more oriented toward problem solving and systems engineering

  9. 3GL and 4GL • All 4GLs are designed to reduce programming effort, the time it takes to develop software • Also, 4GL is design for people with little programming knowledge instead of a programmer to write the program • it is impossible to frequently ask for a programmer to develop a function for a specific searching purpose

  10. 3GL and 4GL • 4GL are not always successful in this task, sometimes resulting in worse code • Like using SQL for calculating complex number • However, given the right problem, the use of an appropriate 4GL can be successful

  11. Fifth-generation Languages(5GLs) • Logic programming • A declarative language to develop artificial intelligence (AI) programs and expert systems • Prolog, LISP

  12. Fifth-generation Languages(5GLs) • Example: Prolog • Two types of clauses: Facts and Rules • Facts: cat(tom). There is a cat call Tom. • Rule: cat(tom) :- true. There is a cat call Tom is ture.

  13. Fifth-generation Languages(5GLs) • Given the above fact, one can ask:is tom a cat??- cat(tom). Yes • what things are cats??- cat(X). X = tom

  14. Compiler • A program that translates the whole high-level program into a machine program, which can be executed independently. • Different programming language have different compiler.

  15. Compiler Compiler Editor Analyzes the language statements syntactically one by one Enter the codes Build the output code (object code /object module) in machine language Save the file (Source Program)

  16. Interpreter • Translates and executes one instruction at a time • Execution speed is slower because it takes time to translate the instruction during execution • No object program is generated. The source is needed every time for execution.

  17. Interpreter • Can immediately execute high-level program • Test the part of program you wants quickly without compilation of the whole program

  18. Interpreter Translates one instruction from source file executes the instruction

  19. Java • If a Java .class program (compiled) is downloaded from a web page, it will be interpreted by the virtual machine (a plug-in installed in the browser as an interpreter) • This can make Java cross platform

  20. Java Server client Enter the Java codes Download the Java .class program Compiled it to a Java .class program Interpreted by virtual machine (Different OS, different plug-in ) Execute the interpreted program

More Related