1.3 Below your program 你的程序背后
1.3 Below your program 你的程序背后
A typical application, such as a word processor or a large database system, may consist of millions of lines of code and rely on sophisticated software libraries that implement complex functions in support of the application. As we will see, the hardware in a computer can only execute extremely simple low-level instructions.To go from a complex application to the simple instructions involves several layers of software that interpret or translate high-level operations into simple computer instructions, an example of the great of abstraction.
implement /implimənt/ v. 实施;执行;贯彻;使生效;n. 工具;器 具;(常指)简单的户外用具;
1. verb v n : If you implement something such as a plan, you sure that what has been planned is done.
2. N-count : An implement is a tool or other piece of equipment. (Fomal)
extremely /ik'stri:mli/ adv. 非常;极其;极端;
adv. Your use extremely in front of adjective and adverbs to emphasize that the specified quality is present to a very great degree. = very
interpret/in'tæprit/ v. 诠释;说明;口译;把...理解为;词形变化: interprets, interpreting, interpreted;
1. verb v n as n If you interpret something in a particular way, you decide that this is its meaning and significance.
2. verb If you interpret what someone is saying, you translate it to another language.
一个典型的应用程序,例如:一个字处理程序或者一个具大的数据库系统, 可能包含好几百万行的代码,依赖精细复杂的软件库,支持应用程序实现复杂的功能。正如我们将要看到的,在计算机中的硬件仅仅能够执行非常简单的低级指令。 从一个复杂的应用程序到一条简单的指令走来, 涉及许多软件层,包括编译和传输从高级操作到简单的计算机指令,一个具大而抽象的例子。
Figure 1.3 shows that these layers of software are organized primarily in a hierarchical fashion, with application being the outmost ring and a variety of system software sitting between the hardware and application software.
图1-3所示: 软件的这些层次被主要组织起来以一种分层的方式, 最外层是应用程序, 在硬件和应用程序软件之间坐落着各种各样的系统软件。
There are many types of systems software, but two types of systems software are central to every computer system today: an operating system and a complier.
有许多类型的软件系统, 但是对于今天,每种计算机系统以两种系统软统软件为中心: 操作系统和编译器。
An operating system interfaces between a user’s program and hardware and provides a variety of services and supervisory functions. Among the most important functions are:
操作系统接口位于用户程序和硬件之间, 提供多种服务和监管服务。 所有最最重要的功能是:
l Handling basic input and output operations.
处理基本的输入和输出操作
l Allocating storage and memory
分配存储空间和内存
l Providing for protected sharing of the computer among multiple applications using it simultaneously.
同时使用多功能应用程序时,对于共享计算机提供保护。
Examples of operating systems in use today are Linux, iOS, Widows.
当今,所使用的计算机系统是: Linux, IOS, Windows.
Figure 1.3 A simplified view of hardware and software are hierarchical layers, shown as concentric circles with hardware in the center and applications software outermost.
一个简单的软件和硬件视图是分层结构,如同心圆所示,在中央是硬件, 最外边的是应用程序软件。
In complex applications, there are often multiple layers of application software as well.
在复杂的应用程序中,也存在多种应用程序层。
For example, a database system may run on top of the systems software hosting an application, which in turn runs on top of database.
例如, 一个数据库应用程序可能运行在寄主应用程序的系统软件顶部, 寄主应用程序在数据库顶部。
Compilers perform another vital function: the translation of a program written in high-level language, such as C, C++, Java, or Visual Basic into instructions that the hardware can execute.
vital /vaitəl/ adj. 必不可少的;对...极重要的;生命的;维持生命所必需的;
1. If you say that something is vital, you mean that it is necessary or very important.
2. If you describle someone and something as vital, you mean that they are very energetic and full of life. = lively.
Given the sophistication of modern programing languages and the simplicity of the instructions executed by the hardware, the translation from a high-level language program to hardware instructions is complex. We give a brief overview of the process here and then go into more depth in Chapter 2 and in Appendix A.
From a High-level Language to language of hardware
The actually speak to electronic hardware, you need to send electrical signals. The easiest signals for computers to understand are on and off, and so the computer alphabet is just two letters. Just as the 26 letters of English alphabet do not limit how much can be written, the two letters of the computer alphabet do not what computers can do. The two symbols for these two letters are the numbers 0 and 1, and we commonly think of the computer language as numbers in base 2, or binary numbers. We refer to each “letter” as a binary digit or bit. Computers are slaves to our commands, which are called instructions, which are just collections of bits that the computer understands and obeys, can be thought of as numbers. For example, the bits
1000,1100,1010,0000
Tell one computer to add two numbers. Chapter 2 explains why we use numbers for instructions and data; we don’t want to steal that chapter’s thunder, but using numbers for both instructions and data is a foundation of computing.
The first programmers communicated to computers in binary numbers, but this was so tedious that they quickly invented new notations that were closer to the way humans think. At first, these notations were translated to binary by hand, but this process was still tiresome. Using the computer to help program the computer, the pioneers invented programs to translate from symbolic notation to binary. The first of these programs was named an assembler. This program translates a symbolic version of an instruction into the binary version. For example, the programmer would write
Add A, B
And the assembler would translate this notation into:
1000,1100,1010,0000
This instruction tells the computer to add the two numbers A and B. The name coined for this symbolic language, still used today, is assembly language. In contrast, the binary language that the machine understands is the machine language.
Although a tremendous improvement, assembly language is still far from the notations a scientist might like to use to simulate fluid flow or that an accountant to write one line for every instruction that the computer will follow, forcing the programmer to think like computer.
The recognition that a program could be written to translate a more powerful language into computer instructions was one of the great breakthroughs in the early days of computing.