Wednesday 21 January 2015

1.0 - Q/A

Q & A

1. Why is it useful for a programmer to have some background in language design, even though he or she may never actually design a programming language
Increased capacity to express ideas
Improved background for choosing appropriate languages.
Increased ability to learn new languages.
Better understanding of the significance of an implementation.

2. How can knowledge of programming language characteristics benefit the whole computing community?
 If those who choose a language, are better informed, then perhaps better languages would eventually squeeze out poorer ones. 

 3. What programming language has dominated scientific computing over the past 45 years?
FORTRAN -  FORTRAN has been used for a long time for scientific computing. It was the first language for scientific applications because FORTRAN provides efficiency which was the primary concern for scientific applications.

4. What programming language has dominated business applications over the past 45 years?
COBOL - COBOL was the first successful high-level language for business. It is the most commonly used language for business applications because business languages are characterized by facilities for producing elaborate reports, precise ways of describing, strong decimal numbers, character data and the ability to specify decimal arithmetic operations.

5. What programming language has dominated artificial intelligence over the past 45 years? 
LISP - LISP which appeared in 1959.Artificial Intelligence (AI) is a broad area of computer applications characterized by the used of symbolic rather than numeric computations.

6. In what language was UNIX written?
The UNIX operating system is written almost entirely in C which has made it relatively easy to port, or move to different machines. Some of the characteristics of C make it a good choice for systems programming. It is low level, execution efficient and doesn’t burden the user with many safety restrictions.

7.What is the disadvantage of having to many features in a language?

If a language has to many features, some programmers wont be familiar with them all, leading to  the misuse of some features and disuse of others.

 8.How can user-defined operator overloading harm readability of a program?
If a programmer doesn't do it sensibly, it can reduce readability.

9. What is one example of lack of orthogonality in the design of C?
Consider the following rules and exceptions in C. Although C has two kinds of structured data-types arrays and records (structs). records can be any data type except void or a structure of the same type. An array element can be any data type except a void or a function. Parameters are passed by value, unless they are arrays, in which they are , in effect, passed by reference.

10. What language used orthogonality as a primary design criterion?
ALGOL 68 - ALGOL 68 is the most orthogonal programming language because every language constructs in ALGOL 68 has a type, and there are no restrictions on those types. But LISP can also be said as a good combination of simplicity and orthogonality. LISP a functional language is one in which computations are made primarily by applying a function to a given program.

11. What primitive control statement is used to build more complicated control statements in languages that lack them?

It is “goto”, but in the 1970s, the use of “goto” statements was replaced by structured programming, which could be read from top to bottom. (While, in newer languages)

12. What construct of a programming language provides process abstractions?
Programming languages usually contain abstractions for defining and manipulating data structures or controlling the flow of execution. The practical necessity that a programming language supports adequate abstractions is expressed by the abstraction principal. This principle is sometimes formulated as recommendation to the programmer to make proper use of such abstractions.

13.What does it mean for a program to be reliable?
A program is said to be reliable if it performs to its specifications under all conditions. Factors that affect reliability are type checking, exception handling, aliasing, readability and write-ability

14. Why is type checking the parameters of a subprogram important?
Type checking is important because run-time type checking is expensive, compile-time type checking is more desirable. Furthermore, the earlier errors in programs are detected, the less expensive it is to make the required repairs..

15. What is aliasing?
Aliasing is having two or more distinct names that can be used to access the same memory cell. It is now widely accepted that aliasing is a dangerous feature in a programming language. In some languages, aliasing is used to overcome deficiencies in the language’s data abstraction facilities.

16.What is exception handling?
Exception handling is the ability of a program to intercept run-time errors (as well as the unusual conditions detectable by the program), take corrective measures, and then continue in an obvious aid to reliability.

17. Why is reliability important to write-ability?
Readability is important to write-ability because if a programming language is difficult to read and understand then it can be difficult for a programmer to create new code that might need to interact or use other code. Often times code needs to be modified and if a program is difficult to read then it is difficult to add new code to it.

18.How is the cost of compilers for a given language related to the design of that language.
A language that requires many run-time type checks will prohibit fast code execution, regardless of the quality of the compiler.

19. What has been the strongest influence of programming language design over the past 50 years.
Most of the past 50 years have been designed around the prevalent computer architecture, called the von Neumann architecture, after one of its originators, John von Neumann. 

20. What is the name of the category of programming languages whose structure is dedicated by the Von Neumann computer architecture?  
These languages are called the imperative languages.

21 What two programming language deficiencies were discovered as a result of the research in software development in the 1970s.
The late 1960s and early 70s brought intense analysis of software development. the result in large begun the structure programming movement of both the software development process and program language design.
An important reason for this research was the shift in the major cost of computing from hardware to software. The primary programming language deficiencies that were discovered were in-completeness of type checking and inadequacy of control statements (requiring the extensive use of gotos).

22. What are the three fundamental features of Object-orientated programming language.
The three fundamentals features of an object-oriented programming language are data abstraction, which encapsulates processing with data objects and controls access to data, adds inheritance and dynamic method binding. Inheritance is a powerful concept that greatly enhances the potential reuse of existing software, thereby providing the possibility of significant increases in software development productivity. Dynamic (run-time) method binding allows more flexible use of inheritance.

23. What language was the first to support the three fundamental features of the object-orientated programming?
The first language that supported the three fundamental features of object-oriented programming was Smalltalk. Although Smalltalk never became as widely used as many other languages, support for object-oriented programming is now part of most popular imperative languages, including Ada 95, Java, C++ , and C#.

24. What is an example of two language design criteria that are in direct conflict with each other? 
The example of two language design criteria that are in direct conflict with each other are reliability and cost of execution. For example the Java language definition demands that all references to array elements be checked to ensure that the index or indices are in their legal ranges. This step adds a great deal to the cost of execution of Java programs that contain large numbers of references to array elements. C does not require index range checking, so C programs execute faster than semantically equivalent Java programs, although Java programs are more reliable. The designers of Java traded execution efficiency for reliability.

25. What are the three general methods of implementing a programming language?
The three general methods of implementing a programming language are compilation (programs are translated into machine language), pure interpretation (programs are translated by another programs known as interpreter), and Hybrid Implementation (a compromise between compilers and pure interpreter).

26. Which produces faster program execution, a compiler or pure interpreter?
A compiler, as a compiler translates directly into machine code.

27. What role does a symbol table play in a compiler?
The symbol table serves as a database for the compilation process. The primary contents of the symbol table are the type and attribute information of each user-defined name in the program. This information is placed in the symbol table by the lexical and syntax analyzers and is used by the semantic analyzer and the code generator.

28. What does a linker do?
Most user programs also require programs from the operating system. Among the most common of these are programs for input and output. The compiler builds calls to required system programs when they are needed by the user program. Before the machine language programs produced by a compiler can be executed. The required programs from the operating system must be found and linked to the user program. The process of collecting system programs and linking them to user programs is called linking and loading or just linking. in addition user programs may have to be linked to other user programs.

29.Why is the Von Neumann bottleneck important?
The speed of the connection between a computers memory and its processor usually determines the the speed of the computer, because instructions often can be executed faster  than they can be moved to the processor for execution. This connection is called the von Neumann bottleneck; it is the primary limiting factor in the speed of von Neuman architecture computers, The von Neumann bottleneck has been one of the primary motivations for the research and development of parallel computers.

30. What are the advantages of implementing a language with pure interpreter?
The advantages of a pure interpreter, is allowing easy implementation of many source level debugging operations, because all run time errors messages can refer to source level units.

No comments:

Post a Comment