• Complain

Des Watson - A Practical Approach to Compiler Construction

Here you can read online Des Watson - A Practical Approach to Compiler Construction full text of the book (entire story) in english for free. Download pdf and epub, get meaning, cover and reviews about this ebook. City: Cham, publisher: Springer International Publishing, genre: Home and family. Description of the work, (preface) as well as reviews are available. Best literature library LitArk.com created for fans of good reading and offers a wide selection of genres:

Romance novel Science fiction Adventure Detective Science History Home and family Prose Art Politics Computer Non-fiction Religion Business Children Humor

Choose a favorite category and find really read worthwhile books. Enjoy immersion in the world of imagination, feel the emotions of the characters or learn something new for yourself, make an fascinating discovery.

Des Watson A Practical Approach to Compiler Construction
  • Book:
    A Practical Approach to Compiler Construction
  • Author:
  • Publisher:
    Springer International Publishing
  • Genre:
  • City:
    Cham
  • Rating:
    4 / 5
  • Favourites:
    Add to favourites
  • Your mark:
    • 80
    • 1
    • 2
    • 3
    • 4
    • 5

A Practical Approach to Compiler Construction: summary, description and annotation

We offer to read an annotation, description, summary or preface (depends on what the author of the book "A Practical Approach to Compiler Construction" wrote himself). If you haven't found the necessary information about the book — write in the comments, we will try to find it.

Des Watson: author's other books


Who wrote A Practical Approach to Compiler Construction? Find out the surname, the name of the author of the book and a list of all author's works by series.

A Practical Approach to Compiler Construction — read online for free the complete book (whole text) full work

Below is the text of the book, divided by pages. System saving the place of the last page read, allows you to conveniently read the book "A Practical Approach to Compiler Construction" online for free, without having to search again every time where you left off. Put a bookmark, and you can go to the page where you finished reading at any time.

Light

Font size:

Reset

Interval:

Bookmark:

Make
Springer International Publishing AG 2017
Des Watson A Practical Approach to Compiler Construction Undergraduate Topics in Computer Science 10.1007/978-3-319-52789-5_1
1. Introduction
Des Watson 1
(1)
Department of Informatics, Sussex University, Brighton, East Sussex, UK
Des Watson
Email:
The high-level language is the central tool for the development of todays software. The techniques used for the implementation of these languages are therefore very important. This book introduces some of the practicalities of producing implementations of high-level programming languages on todays computers. The idea of a compiler , traditionally translating from the high-level language source program to machine code for some real hardware processor, is well known but there are other routes for language implementation. Many programmers regard compilers as being deeply mysterious pieces of softwareblack boxes which generate runnable codebut some insight into the internal workings of this process may help towards their effective use.
Programming language implementation has been studied for many years and it is one of the most successful areas of computer science. Todays compilers can generate highly optimised code from complex high-level language programs. These compilers are large and extremely complex pieces of software. Understanding what they do and how they do it requires some background in programming language theory as well as processor design together with a knowledge of how best to structure the processes required to translate from one computer language to another.
1.1 High-Level Languages
Even in the earliest days of electronic computing in the 1940s it was clear that there was a need for software tools to support the programming process. Programming was done in machine code , it required considerable skill and was hard work, slow and error prone. Assembly languages were developed, relieving the programmer from having to deal with much of the low-level detail, but requiring an assembler , a piece of software to translate from assembly code to machine code. Giving symbolic names to instructions, values, storage locations, registers and so on allows the programmer to concentrate on the coding of the algorithms rather than on the details of the binary representation required by the hardware and hence to become more productive. The abstraction provided by the assembly language allows the programmer to ignore the fine detail required to interact directly with the hardware.
The development of high-level languages gathered speed in the 1950s and beyond. In parallel there was a need for compilers and other tools for the implementation of these languages. The importance of formal language specifications was recognised and the correspondence between particular grammar types and straightforward implementation was understood. The extensive use of high-level languages prompted the rapid development of a wide range of new languages, some designed for particular application areas such as COBOL for business applications [] tried to be very much more general-purpose. Large teams developed compilers for these languages in an environment where target machine architectures were changing fast too.
1.1.1 Advantages of High-Level Languages
The difficulties of programming in low-level languages are easy to see and the need for more user-friendly languages is obvious. A programming notation much closer to the problem specification is required. Higher level abstractions are needed so that the programmer can concentrate more on the problem rather than the details of the implementation of the solution.
High-level languages can offer such abstraction. They offer many potential advantages over low-level languages including:
  • Problem solving is significantly faster. Moving from the problem specification to code is simpler using a high-level language. Debugging high-level language code is much easier. Some high-level languages are suited to rapid prototyping, making it particularly easy to try out new ideas and add debugging code.
  • High-level language programs are generally easier to read, understand and hence maintain. Maintenance of code is now a huge industry where programmers are modifying code unlikely to have been written by themselves. High-level language programs can be made, at least to some extent, self-documenting, reducing the need for profuse comments and separate documentation. The reader of the code is not overwhelmed by the detail necessary in low-level language programs.
  • High-level languages are easier to learn.
  • High-level language programs can be structured more easily to reflect the structure of the original problem. Most current high-level languages support a wide range of program and data structuring features such as object orientation, support for asynchronous processes and parallelism.
  • High-level languages can offer software portability. This demands some degree of language standardisation. Most high-level languages are now fairly tightly defined so that, for example, moving a Java program from one machine to another with different architectures and operating systems should be an easy task.
  • Compile-time checking can remove many bugs at an early stage, before the program actually runs. Checking variable declarations, type checking, ensuring that variables are properly initialised, checking for compatibility in function arguments and so on are often supported by high-level languages. Furthermore, the compiler can insert runtime code such as array bound checking. The small additional runtime cost may be a small price to pay for early removal of errors.
1.1.2 Disadvantages of High-Level Languages
Despite these significant advantages, there may be circumstances where the use of a low-level language (typically an assembly language) may be more appropriate. We can identify possible advantages of the low-level language approach.
  • The program may need to perform some low-level, hardware-specific operations which do not correspond to a high-level language feature. For example, the hardware may store device status information in a particular storage locationin most high-level languages there is no way to express direct machine addressing. There may be a need to perform low-level i/o, or make use of a specific machine instruction, again probably difficult to express in a high-level language.
  • The use of low-level languages is often justified on the grounds of efficiency in terms of execution speed or runtime storage requirements. This is an important issue and is discussed later in this section.
These disadvantages of high-level languages look potentially serious. They need further consideration.
1.1.2.1 Access to the Hardware
A program running on a computer system needs to have access to its environment. It may input data from the user, it may need to output results, create a file, find the time of day and so on. These tasks are hardware and operating system specific and to achieve some portability in coding the high-level language program performing these actions, the low-level details have to be hidden. This is conventionally done by providing the programmer with a library acting as an interface between the program and the operating system and/or hardware. So if the program wants to write to a file, it makes a call to a library routine and the library code makes the appropriate operating system calls and performs the requested action.
To address the stated advantage of low-level languages mentioned above there is nothing to stop the construction of operating system and machine-specific libraries to perform the special-purpose tasks such as providing access to a particular storage location or executing a particular machine instruction. There may be machine-specific problems concerned with the mechanism used to call and return from this library code with, for example, the use of registers, or with the execution time cost of the call and return, but such difficulties can usually be overcome.
Next page
Light

Font size:

Reset

Interval:

Bookmark:

Make

Similar books «A Practical Approach to Compiler Construction»

Look at similar books to A Practical Approach to Compiler Construction. We have selected literature similar in name and meaning in the hope of providing readers with more options to find new, interesting, not yet read works.


Reviews about «A Practical Approach to Compiler Construction»

Discussion, reviews of the book A Practical Approach to Compiler Construction and just readers' own opinions. Leave your comments, write what you think about the work, its meaning or the main characters. Specify what exactly you liked and what you didn't like, and why you think so.