FreeBSD Cookbook

My notes on the principles and practices of software related issues such as compiler, assembler, graphical user interface, and operating system design. I am currently learning these topics at university and FreeBSD as UNIX operating system for study purpose.
nixCraft » FreeBSD CookBook

High level language

This is considered as third-generation language. Programming languages such as C++, Java, Cobol, Fortran, BASIC etc all are examples of high level language. The entire program is written in English like language with some rules and regulation (read as grammar). For example, consider following C program:


main()
{
int x=2;
int y=5;
int c=x+y;
printf("x + y = %d\n",c);
}
OR Basic same program in BASIC:
1 LET x = 2
2 LET y = 5
3 LET c = x+y
4 PRINT c
5 END
Both of above program are easy to read and manage. Genreally you use term called source code for English like language code.

Further, the time and cost of creating machine and/or assembly language was quite high. However, a computer cannot understand program written in English. Therefore, you use special program called compiler or interpreter to translate source code to object code:

-----------+
Program | +-------------+ +-------------+
Written | | Compiler/ | | Object code |
In | =======> | OR | =====> | (0s and 1s |
High level | | Interpreter | | code ) |
Language | +-------------+ +-------------+
-----------+

The difference between Compiler and Interpreter

CompilerInterpreter
Scan the entire program first and then translate it into machine codeTranslate the program line by line on fly
Scan the entire program first and then translate it into machine codeConvert the entire program to machine code only when there is no syntax error and then you can execute program
Execution time is lessExecution time is more
Slow for debuggingGood for fast debugging


Advantage of High level Language
  1. Readability
  2. Portability
  3. Ease of debugging
  4. Ease of software development
Introduction : Installing and configuring MySQL server
Assembly Language

0 User Contributed Notes:

<< Home


Powered by blogger