Programming Languages "Design and Constructs"

Programming Languages "Design and Constructs" is a comprehensive introduction to programming language concepts. This book provides a new approach to Programming Languages by providing a balanced mixture of explanation and experimentation. This book covers the syllabus of many unversities. The book examines design and analysis issues using a wide variety of Programming languages.

In the early 1950s, symbolic notations started to appear. Grace Hopper led a group at Univac to develop the A-0 language, and John Backus developed speedcoding for the IBM 701. Both were designed to compile simple arithmetic expressions into executable machine language.

The real break through occurred in 1957 due to arrival of FORTRAN in 1957. FORTRAN data were oriented around numerical calculations.

The formula b2 – 4ac was written in FORTRAN as the expression

B ** 2 – 4.0 * A * C.

FORTRAN takes its name from Formula Translation; readable formulas were translated into machine instructions for the IBM 704. FORTRAN was extremely successful and was the dominant language through the 1970s. Because of the suceess of FORTRAN, hundreds of programming languages have since been designed and implemented.

Elementary or Primitive data type includes integer, real, character, Boolean, enumeration and pointers. In this chapter, we introduce the concept of data type, data object and various characteristics of elementary data type. Then, we discuss the specification and implementation of elementary data objects. We also discuss the various terms related to data objects like scope of data objects, blocks, lifetime of objects etc. Then, we discuss binding of variables to values.

The study of programming languages, like the study of natural languages, can be divided into examinations of syntax and semantics. The main purpose of a language is to express meaning by means of sound. Programming language implementor obviously must be able to determine how the expressions, statements of a language are formed. The validity of a sentence is based on their syntax and semantics.

In chapter 2, we have discussed primitive type or elementary data objects. In application point of view we find that the data is generally structured in some ways. Most imperative languages provide some support for structured types. Users may be able to define their own types, and this can create some meaningful programs. Virtually all languages have included features for creating complex data objects out of the elementary data objects defined by the language designers. Various types can be combined to create aggregate types, composed of elements of other types, such as arrays and records. Most programming language have at least one built in type, although there are typeless languages, where data objects can be coerced automatically from one type to another. Arrays, lists and sets are ways to create homogeneous collection of data objects. Records are a mechanism for creating nonhomogeneous collection of data objects.

In this chapter, we explore programming language support for data abstraction. Early languages, such as FORTRAN and COBOL, limit the creation of new data types to subprogram definition.

But new language designs have provided better facilities for specify and implementing entire abstract data types. C++ and Java defines class which is abstract data types. By abstract data type we can create new data type. We begin by discussing the evolution of abstract data type concept and then discuss the concept of abstraction and abstract data type. Data encapsulation and Information hiding are also associated with abstraction. In this chapter, we also create programmer–defined data by use of subprograms. Procedures, subroutines and functions are defined and implemented.

This chapter discuss the various concepts regarding concurrency, categories of concurrency and synchronization methods. There are various kinds of concurrency at the subprogram, or

Unit level, and at the statement level. We also discuss competition and cooperation synchronization. The concurrent processes may be executing truly simultaneously, in the case that they run on separate processors, or their execution steps may be interleaved to produce the appearance of concurrency. The intention of this chapter is to discuss the aspects of concurrency that are most relevant to language design issues, rather than to present a definitive study of all of the issues of concurrency.

Storage Management is a key area in the study of programming language, since it is tightly intertwined with the meaning of programs. Memory or storage is the area where data and instructions are stored. Storage management for data and instructions is one of the central concerns of the programmer, language implementor and language designer. There are various storage management techniques with the help of these techniques data is stored in memory.

In this chapter we are dealing with these storage management techniques and different terms related with storage management. We also discuss the various problems associated with storage management. Programmer is also deeply concerned with storage management and must design programs that use storage efficiently, the programmer is likely to have little direct control over storage. Runtime stack helps to clarify our understanding of how memory is organized to implement functions, a different memory area, called the heap, helps us to understand the runtime behaviour of dynamic objects.