Friday, March 23, 2007

Compilers can be Intelligent

Compiler is a tool used by developers to produce the binary image of the source code. Developer uses this tool frequently while the code is being developed. There are compilers for all languages except for some languages, where the interpreters execute the program.

The current compilers do preprocessing for cleaning the code and handling the various compiler directives. Then the result is subjected to lexical and syntax analysis where the typo errors and language related errors are handled. After this there will be code generation and code optimization.

The current compilers have configuration options for a particular compilation set up needs. Every time the code is compiled the same above said steps are done. In some cases the incremental compilation is done to act only on the recently changed code. To develop a small program couple of times the compilation happens in average. In this process compiler does not use the information generated by the profiler to act intelligent. Compiler can learn about the program and about its data objects. This information can be used to make compiler act intelligently over that program. But compilers do not use any information about the program, which makes the successive compilations easier for the same program.

Compilers need to become like expert systems. They can obtain the expertness while compiling the programs. As, typically the program development involves couple of rounds of compilation the learning process for the compilation need not be the separate phase.

What are the areas where the compilers can behave as intelligent tools?

· Compiler can declare any local variable if its declaration is missing and indicate the user about the same in the form of warning.

· Compiler can declare any global variable if its declaration is missing and indicate the user in the form of warning.

· Compiler can free the dynamic memory allocated inside a function or block if user does not free the memory by mistake and indicate the same to the user in the form of warning.

· Compiler can include the header file as appropriate corresponding to a used library instead of throwing the errors.

These abilities of the compiler speed up the program development task and thereby reduce the program development life cycle time.

No comments:

Save Water and Save Life

Save Water and Save Life