计算机英语文本文档

  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

一Operating System
I. Introduction引言
An operating system (OS), in computer science, is the basic software
that controls a computer. It has three major functions: it coordinates and
manipulates computer hardware, such as computer memory, printers, disks,
keyboard, mouse, and monitor; it organizes files on a variety of storage
media, such as floppy disk, hard drive, compact disc, and tape; and it
compact discmanages hardware errors and the loss of data.
在计算机科学中,操作系统(OS)是控制计算机的基本软件。它具有3个主要功能:协调与操作计算机硬件,如计算机存储器、打印机、磁盘、键盘、鼠标和监视器;在各种存储介质上编排文件,如软盘、硬盘、光盘和磁带;以及处理硬件错误和数据丢失.
II. How an Os Works操作系统是怎样工作的
Operating systems control different computer processes, such as
running a spreadsheet program or accessing information from the
computer’s memory. One important process is the interpretation of
commands that allow the user to communicate with the computer. Some
command interpreters are text-oriented, requiring commands to be typed
in. Other command interpreters are graphically oriented and let the user
communicate by pointing and clicking on an icon, an on-screen picture that
represents a specific command. Beginners generally find graphically
oriented interpreters easier to use, but many experienced computer users
prefer text-oriented command interpreters because they are more powerful.操作系统控制不同的计算机进程,如运行一个电子表格程序或访问计算机存储器里的信息。一个重要的进程是解释使用户得以与计算机进行通信的命令。有些命令解释器是面向文本的,要求将命令键入。另一些命令解释器是面向图形的,允许用户通过指向并点击图标,即屏幕上代表具体命令的图片,来进行通信。初学者一般觉得面向图形的解释器使用起来容易一些,但是许多有经验的计算机用户更喜欢使用面向文本的命令解释器,因为它们的功能更强大一些。
Operating systems are either single-tasking or multitasking. The more
primitive single-tasking operating systems can run only one process at a
time. For instance, when the computer is printing a document, it cannot start
another process or respond to new commands until the printing is
completed.操作系统或者是单一任务处理的,或者是多任务处理的。早期的单一任务处理操作系统每次仅能运行一个进程。例如,当计算机打印文件时,在打印结束之前,计算机不能开始另一个进程或响应新的命令。
All modern operating systems are multitasking and can run several
processes simultaneously. In most computers there is only one central
processing unit (CPU), (the computational and control unit of the computer),
so a multitas

ksimultaneously on the CPU. The most common mechanism used to create
this illusion is time-slice multitasking, whereby each process is run
individually for a fixed period of time. If the process is not completed
within the allotted time, it is suspended and another process is run. This
exchanging of processes is called context switching. The OS performs the
“bookkeeping” that preserves the state of a suspended process. It also has a
mechanism, called a scheduler, that determines which process will be run
next. The scheduler runs short processes quickly to minimize perceptible
delay. The processes appear to run simultaneously because the user’s sense
of time is much slower than the processing speed of the computer.所有现代操作系统都是多任务处理的,可以同时运行数个进程。在大多数计算机中,只有一个中央处理器(CPU)(计算机的计算与控制单元),因此多任务处理操作系统造成一种假象,即数个进程同时在中央处理器上运行。用来造成这种假象的最常见办法是时间片多任务处理,依靠这种方法每个进程都单独运行固定的一段时间。如果进程在分配的时间内没有完成,它即被暂停,而另一个进程开始运行。进程之间的这种切换被称为上下文转换。操作系统进行“簿记”,保存被暂停进程的状态。它还有一种确定下一步运行哪个进程的机制,称之为调度程序。调度程序快速运行短进程,以尽可能缩短可察觉的延迟。由于用户对时间的感觉要比计算机的处理速度慢得多,因此多个进程看似在同时运行。
Operating systems can use virtual memory to run processes that
require more main memory than is actually available. With this technique,
space on the hard drive is used to mimic the extra memory needed.
Accessing the hard drive is more time-consuming than accessing main
memory, however, so performance of the computer slows.
interpreter操作系统可以使用虚拟内存,以运行所需主存空间大于实际可用主存空间的进程。使用这种技术,硬盘驱动器上的空间被用来模拟所需的额外内存。然而,访问硬盘驱动器比访问主存耗时多,因此计算机运行起来很慢。
III. Current Operating Systems当前的操作系统
The operating systems commonly found on personal computers are
UNIX, Macintosh OS, MS-DOS, OS/2, and Windows.个人计算机常用的操作系统有UNIX、Macintosh OS、MS-DOS、OS/2以及Windows。
1. UNIX
UNIX, in computer science, is a multiuser, multitasking operating
system originally developed by Ken Thompson1 and Dennis Ritchie2 at
AT&T3 Bell Laboratories4 in 1969 for use on minicomputers. UNIX exists
in various forms and implementations; among these are versions developed
at the University of California at Berkeley5 (known as BSD6 releases) and
versions releasedis considered a powerful operating system which, because

it is written in the
C language, is more portable—less machine-specific—than other operating
systems. UNIX is available in several related forms, including AIX, a
version of UNIX adapted by IBM (to run on RISC7-based workstations),
A/UX (a graphical version for the Apple8 Macintosh), and Mach (a
rewritten but essentially UNIX-compatible operating system for the NeXT
computer).在计算机科学中,UNIX是一种多用户、多任务处理操作系统,最初由肯?汤普森和丹尼斯?里奇于1969年在美国电话电报公司的贝尔实验室里开发,用于小型计算机。UNIX以各种形式和实现方式存在;这其中包括加利福尼亚大学伯克利分校开发的版本(称为“伯克利软件发行中心版本”)和美国电话电报公司发行的版本——其最新版本是“美国电话电报公司系统V”。UNIX被认为是一种功能强大的操作系统。因为是用C语言编写的,它比其他操作系统更具有可移植性——受机器限制比较少。UNIX还有几个相关的系统形式,包括:AIX,由IBM公司改写的UNIX版本(在基于精简指令集计算机的工作站上运行);A/UX(用于苹果计算机公司的麦金托什个人计算机上的图形版本);以及Mach(一种重写的但基本上与UNIX兼容的操作系统,用于NeXT计算机)。
Its popularity is due in large part to the growth of the interconnected
computer network known as the Internet, the software for which initially
was designed for computers that ran UNIX. Variations of UNIX include
SunOS (distributed by SUN Microsystems Inc.9), Xenix (distributed by
Microsoft Corporation), and Linux 10 . UNIX and its clones support
multitasking and multiple users. Its file system provides a simple means of
organizing disk files and lets users protect their files from other users. The
commands in UNIX are not intuitive, however, and mastering the system is
difficult.UNIX的流行,在很大程度上是由于被称作因特网的计算机互联网络的发展,因为因特网使用的软件最初是为运行UNIX的计算机设计的。UNIX的变种包括SunOS(由太阳微系统股份有限公司发布)、Xenix(由微软公司发布)和Linux。UNIX及其克隆产品支持多任务处理和多个用户。其文件系统提供了一种编排磁盘文件的简便方法,并允许用户保护其文件而防范其他用户。然而,UNIX中的命令不很直观,要掌握这个系统比较困难。
2. MS-DOS
MS-DOS is the acronym for Microsoft Disk Operating System. In
computer science, MS-DOS—like other operating systems—oversees such
operations as disk input and output, video support, keyboard control, and
many internal functions related to program execution and file maintenance.
MS-DOS is a single-tasking, single-user operating system with a
command-line interf3. OS/2
OS/2, or Operating System 2, is an operating system developed for the
personal computer in the mid-1

980s by International Business Machines
Corporation (IBM) and Microsoft Corporation. At the time OS/2 was
introduced in late 1987, the most common personal computers were
IBM-compatible computers running the Microsoft Disk Operating System
(MS-DOS) and computers manufactured by Apple Computer Corporation
running Apple’s system for the Macintosh (Mac OS). The Macintosh
operating system included multitasking, a feature that enabled computers to
run several applications simultaneously. In a computer network,
multitasking allows several users on different computers to have
simultaneous access to the same application or data set. OS/2 was the first
operating system designed for IBM-compatible personal computers that
allowed multitasking.OS/2,或称“第二代操作系统”,是20世纪80年代中期由IBM公司和微软公司为个人计算机开发的一种操作系统。1987年末,OS/2推出时,最常见的个人计算机是运行MS-DOS的IBM兼容机和由苹果计算机公司生产、运行其麦金托什个人计算机操作系统(Mac OS)的计算机。麦金托什个人计算机操作系统包含多任务处理功能,一个使计算机能够同时运行数个应用程序的特征。在一个计算机网络中,多任务处理允许不同计算机上的数个用户同时访问同一个应用程序或数据集。OS/2是为IBM兼容个人计算机设计、允许多任务处理的第一个操作系统。
The first version of OS/2, version 1.0, was text-oriented and lacked a
graphical user interface (GUI) that would allow users to enter commands
with a point-and-click input device, such as a computer mouse. A year later
IBM and Microsoft released OS/2 version 1.1, which included a GUI called
the Presentation Manager. The Presentation Manager interface contained
icons, pictures or words on the screen that users could click on with a
mouse to enter instructions. OS/2 version 1.1 also allowed users to have
multiple windows open (windows are portions of the screen that each
contain a different document or program) and included pull-down lists of
commands that the user could choose by clicking on them with their mouse.OS/2的第一个版本,1.0版本,是面向文本的,没有允许用户通过使用计算机鼠标等指向与点击输入设备来输入命令的图形用户界面(GUI)。一年后,IBM和微软发布了OS/2的1.1版本,它包括一个称为表示管理程序的图形用户界面。表示管理程序界面包含图标,亦即屏 IBM and Microsoft ended their collaboration on OS/2 in 1991 after
Microsoft released its Windows software, a multitasking environment that
ran on MS-DOS. In 1992 IBM released version 2.0 of OS/2, which ran
Microsoft Windows programs and could perform multitasking of DOS
operations. It also contained an object-oriented programming environment
that allowed software designers to create programs using high-level,
object-oriented programming languages.1

991年,在微软发布了Windows软件——在MS-DOS上运行的多任务处理环境——之后,IBM和微软结束了它们在OS/2上的合作。1992年,IBM发布了OS/2的2.0版本。该版本运行微软的Windows程序,并可以执行DOS操作下的多任务处理。它也包含面向对象的编程环境,允许软件设计者使用高级的面向对象编程语言编程。
Subsequent versions of OS/2 offered enhanced performance and
multimedia capabilities, and in 1994 IBM announced that more than 5
million copies of OS/2 had been sold since its introduction. The same year,
IBM introduced a new version of OS/2 called OS/2 Warp that featured
improved performance, more multimedia capabilities, an array of
integrated applications, and easy access to the Internet. IBM has continued
to upgrade and extend OS/2 Warp.OS/2后来的版本增强了性能和多媒体能力。1994年,IBM宣布,自OS/2推出后已售出5百多万份。同一年,IBM推出OS/2的一个新版本,称为OS/2 Warp。其特色为:改善的性能、增强的多媒体能力、一系列的集成应用程序和方便的因特网接入。IBM公司继续对OS/2 Wrap进行升级和扩充。

4. Windows
Windows, in computer science, is a personal computer operating
system sold by Microsoft Corporation that allows users to enter commands
with a point-and-click device, such as a mouse, instead of a keyboard. The
Windows operating system provides users with a graphical user interface
(GUI), which allows them to manipulate small pictures, called icons, on the
computer screen to issue commands. Windows is the most widely used
operating system in the world. It is an extension of and replacement for
Microsoft’s Disk Operating System (MS-DOS).在计算机科学中,Windows是由微软公司出售的一种个人计算机操作系统,它允许用户通过指示和点击设备,譬如鼠标,来代替键盘输入命令。Windows操作系统为用户提供了一个图形用户界面,允许用户操作计算机屏幕上称之为图标的图片来发出命令。Windows是世界上使用最广泛的操作系统。它是微软的磁盘操作系统(MS-DOS)的扩充和替代品。
The Windows GUI environment for the user. With Windows, the user can move a cursor
around on the computer screen with a mouse. By pointing the cursor at
icons and clicking buttons on the mouse, the user can issue commands to
the computer to perform an action, such as starting a program, accessing a
data file, or copying a data file. Other commands can be reached through
pull-down or click-on menu items. The computer displays the active area in
which the user is working as a window on the computer screen. The
currently active window may overlap with other previously active windows
that remain open on the screen. This type of GUI is said to include WIMP1
features: windows, icons, menus, and pointing device (such as a mouse).Windows图形用户界面

旨在为用户提供一个自然或直观的工作环境。使用Windows,用户可以用鼠标在计算机屏幕上移动光标。通过将光标指向图标并点击鼠标上的按钮,用户可以给计算机发出命令,让其执行一个动作,如启动一个程序、访问一个数据文件或复制一个数据文件。其他命令可以通过下拉或点击式菜单项来访问。计算机将用户正在工作的活动区域显示为计算机屏幕上的窗口。当前正在使用的活动窗口可以与先前使用的、仍然在屏幕上打开着的其他活动窗口重叠。这种类型的图形用户界面被说成是包含了WIMP特征:窗口、图标、菜单和指点设备(如鼠标)。
Computer scientists at the Xerox Corporation’s2 Palo Alto Research
Center (PARC3) invented the GUI concept in the early 1970s, but this
innovation was not an immediate commercial success. In 1983 Apple
Computer featured a GUI in its Lisa computer. This GUI was updated and
improved in its Macintosh computer, introduced in 1984.施乐公司帕洛阿尔托研究中心的计算机科学家,在20世纪70年代初创造了图形用户界面这个概念,但是这个创新没有马上取得商业上的成功。1983年,苹果计算机公司在其Lisa计算机上采用了一种用户图形界面。这种用户图形界面在其1984年推出的麦金托什个人计算机中得到升级和改善。
Microsoft began its development of a GUI in 1983 as an extension of
its MS-DOS operating system. Microsoft’s Windows version 1.0 first
appeared in 1985. In this version, the windows were tiled, or presented next
to each other rather than overlapping. Windows version 2.0, introduced in
1987, was designed to resemble IBM’s OS/2 Presentation Manager, another
GUI operating system. Windows version 2.0 included the overlapping
window feature. The more powerful version 3.0 of Windows, introduced in
1990, and subsequent versions 3.1 and 3.11 rapidly made Windows the
market leader in operating systems for personal computers, in part because
it was prepackaged on new personal computers. It also became the favored
platform for software dev
In 1993 Microsoft introduced Windows NT (New Technology). The
Windows NT operating system offers 32-bit multitasking, which gives a
computer the ability to run several programs simultaneously, or in parallel,
at high speed. This operating system competes with IBM’s OS/2 as a
platform for the intensive, high-end, networked computing environments
found in many businesses. 1993年,微软推出了Windows NT(新技术)。Windows NT操作系统提供32位的多任务处理,使计算机具有了高速地同时或并行运行数个程序的能力。这种操作系统与IBM的OS/2展开竞争,争做许多企业的密集型高端联网运算环境的平台。


In 1995 Microsoft released a new version of Windows for personal
computers called Windows 95. Windows 95 has a s

leeker and simpler GUI
than previous versions. It offers 32-bit processing, efficient multitasking,
network connections, and Internet access. 1995年,微软发布了用于个人计算机的一个Windows新版本,称作Windows 95。Windows 95与以前的版本相比,用户图形界面造型更加优美,也更加简单。它提供了32位进程处理、高效的多任务处理、网络连接和因特网接入。


Few computer users run MS-DOS or OS/2 directly. They prefer
versions of UNIX or windowing systems with graphical interfaces, such as
Windows 98 or the Macintosh OS, which make computer technology more
accessible. However, graphical systems generally have the disadvantage of
requiring more hardware—such as faster CPUs, more memory, and
higher-quality monitors—than command-oriented operating systems. 几乎没有计算机用户直接运行MS-DOS或OS/2。他们更愿意选择UNIX的各种版本或者带有图形界面的窗口型系统,如Windows 98或Macintosh OS,因为它们使计算机技术更容易利用。然而,与面向命令的操作系统相比,图形系统一般具有需要更多硬件的缺点,如速度更快的中央处理器、更多的内存和更高质量的监视器。

IV. Future Technologies 未来的技术
Operating systems continue to evolve. A recently developed type of
OS called a distributed operating system is designed for a connected, but
independent, collection of computers that share resources such asdrives. In a distributed OS, a process can run on any computer in the
network (presumably a computer that is idle) to increase that process’s
performance. All basic OS functions—such as maintaining file systems,
ensuring reasonable behavior, and recovering data in the event of a partial failure—become more complex in distributed systems. 操作系统在不断地演进。最近开发的一种称之为分布式操作系统的操作系统类型,是为共享硬盘驱动器等资源的一批连接在一起、但相互独立的计算机设计的。在分布式操作系统中,一个进程可以在网络中的任何一台计算机(可能是一台空闲的计算机)上运行,以加快该进程的执行。操作系统的所有基本功能——如维护文件系统、确保合理的行为以及在发生部分故障的情况下恢复数据——在分布式系统中变得比较复杂。

Research is also being conducted that would replace the keyboard with
a means of using voice or handwriting for input. Currently these types of
input are imprecise because people pronounce and write words very
differently, making it difficult for a computer to recognize the same input
from different users. However, advances in this field have led to systems
that can recognize a small number of words spoken by a variety of people.
In addition, software has been developed that can be taught to recognize an
individual’s handwriting.用语音或手写的方法代替键

盘输入的研究工作也在进行中。目前,这些类型的输入还不很准确,因为人们在词的发音和书写上有很大的不同,使计算机难以识别不同用户的相同输入。然而,这个领域取得的发展已经带来了能够识别由各种不同的人所说的少数单词的系统。另外,经过训练能够识别一个人的手迹的软件也已经开发出来。


二Programming Language
I. Introduction
Programming languages, in computer science, are the artificial
languages used to write a sequence of instructions (a computer program)
that can be run by a computer. Similar to natural languages, such as English,
programming languages have a vocabulary, grammar, and syntax. However,
natural languages are not suited for programming computers because they
are ambiguous, meaning that their vocabulary and grammatical structure
may be interpreted in multiple ways. The languages used to program
computers must have simple logical structures, and the rules for their
grammar, spelling, and punctuation must be precise. 在计算机科学中,编程语言是用来编写可被计算机运行的一系列指令(计算机程序)的人工语言。与英语等自然语言相类似,编程语言具有词汇、语法和句法。然而,自然语言不适合计算机编程,因为它们能引起歧义,也就是说它们的词汇和语法结构可以用多种方式进行解释。用于计算编程的语言必须具有简单
Programming languages vary greatly in their sophistication and in
their degree of versatility. Some programming languages are written to
address a particular kind of computing problem or for use on a particular
model of computer system. For instance, programming languages such as
FORTRAN1 and COBOL2 were written to solve certain general types of
programming problems—FORTRAN for scientific applications, and
COBOL for business applications. Although these languages were designed
to address specific categories of computer problems, they are highly
portable, meaning that they may be used to program many types of
computers. Other languages, such as machine languages, are designed to be
used by one specific model of computer system, or even by one specific
computer in certain research applications. The most commonly used
programming languages are highly portable and can be used to effectively solve diverse types of computing problems. Languages like C, PASCAL1,
and BASIC fall into this category.编程语言在复杂性和通用程度上大相径庭。有些编程语言是为了处理特定类型的计算问题或为了用于特定型号的计算机系统而编写的。例如,FORTRAN和COBOL等编程语言是为解决某些普遍的编程问题类型而编写的——FORTRAN为了科学领域的应用,而COBOL为了商业领域的应用。尽管这些语言旨在处理特定类型的计算机问题,但是它们具有很高的可移植性,也就是说

它们可以用来为多种类型的计算机编程。其他的语言,譬如机器语言,是为一种特定型号的计算机系统,甚至是一台特定的计算机,在某些研究领域使用而编写的。最常用的编程语言具有很高的可移植性,可以用于有效地解决不同类型的计算问题。像C、PASCAL和BASIC这样的语言就属于这一范畴。
II. Language Types
Programming languages can be classified as either low-level languages
or high-level languages. Low-level programming languages, or machine
languages, are the most basic type of programming languages and can be
understood directly by a computer. Machine languages differ depending on
the manufacturer and model of computer. High-level languages are
programming languages that must first be translated into a machine
language before they can be understood and processed by a computer.
Examples of high-level languages are C, C++, PASCAL, and FORTRAN.
Assembly languages are intermediate languages that are very close to
machine languages and do not have the level of linguistic sophistication
exhibited by other high-level languages, but must still be translated into
machine language. 编程语言可划分为低级语言和高级语言。低级编程语言或机器语言,是编程语言中最基础的类型,能被计算机直接理解。机器语言的区别取决于

1. Machine Languages 机器语言
In machine languages, instructions are written as sequences of 1s and
0s, called bits, that a computer can understand directly. An instruction in
machine language generally tells the computer four things: (1) where to find
one or two numbers or simple pieces of data in the main computer memory
(Random Access Memory, or RAM), (2) a simple operation to perform,
such as adding the two numbers together, (3) where in the main memory to
put the result of this simple operation, and (4) where to find the next
instruction to perform. While all executable programs are eventually read
by the computer in machine language, they are not all programmed in
machine language. It is extremely difficult to program directly in machine
language because the instructions are sequences of 1s and 0s. A typical
instruction in a machine language might read 10010 1100 1011 and mean
add the contents of storage register A to the contents of storage register B.在机器语言中,指令被写成计算机能够直接理解的被称之为比特的1和0的序列。机器语言中的一条指令通常告诉计算机4件事情:(1)到计算机主存储器(随机访问存储器)的哪个位置去找一或两个数字或者简单的数据段;(2)要执行的一个简单操作,例如将两个数字加起来;(3)将这个简单操作的结果存放在主存储器的什么位置;以及(4)到哪里找要执行的下一条指令。虽然所有的可执行程序最终都是以机器语言的形式被计算机读取,但是

它们并非都是用机器语言编写的。直接用机器语言编程极端困难,因为指令是1和0的序列。机器语言中的一条典型的指令可能是10010 1100 1011,意思是将存储寄存器A的内容加到存储寄存器B的内容中。

2. High-Level Languages 高级语言
High-level languages are relatively sophisticated sets of statements
utilizing words and syntax from human language. They are more similar to
normal human languages than assembly or machine languages and are
therefore easier to use for writing complicated programs. These programming languages allow larger and more complicated programs to be
developed faster. However, high-level languages must be translated into
machine language by another program called a compiler before a computer
can understand them. For this reason, programs written in a high-level
language may take longer to execute and use up more memory than
programs written in an assembly language. 高级语言是利用人类语言中的词和句法的一套相对复杂
3. Assembly Languages 汇编语言
Computer programmers use assembly languages to make
machine-language programs easier to write. In an assembly language, each
statement corresponds roughly to one machine language instruction. An
assembly language statement is composed with the aid of easy to remember
commands. The command to add the contents of the storage register A to
the contents of storage register B might be written ADD B, A in a typical
assembly language statement. Assembly languages share certain features
with machine languages. For instance, it is possible to manipulate specific
bits in both assembly and machine languages. Programmers use assembly
languages when it is important to minimize the time it takes to run a
program, because the translation from assembly language to machine
language is relatively simple. Assembly languages are also used when some
part of the computer has to be controlled directly, such as individual dots on
a monitor or the flow of individual characters to a printer. 计算机编程人员使用汇编语言使机器语言程序编写起来更简单一些。在汇编语言中,每条语句大致对应一条机器语言指令。汇编语言的语句是借助易于记忆的命令编写的。在典型的汇编语言的语句中,把存储寄存器A的内容加到存储寄存器B的内容中这一命令,可以写成ADD B, A。汇编语言与机器语言具有某些共同特征。例如,对特定的比特进行操作,用汇编语言和机器语言都是可行的。当尽量减少程序的运行时间很重要时,程序员就使用汇编语言,因为从汇编语言到机器语言的翻译相对简单。当计算机的某个部分必须被直接控制时,如监视器上的单个点或者流向打印机的单个字符,这时也使用汇编语言。

III. Classification of High-Level Languages 高级语言的分类
High-level languages are com

monly classified as procedure-oriented,
functional, object-oriented, or logic languages. The most common
high-level languages today are procedure-oriented languages. In these
languages, one or more related blocks of statements that perform some
complete function are grouped together into a program module, or
procedure, and given a name such as “procedure A.” If the same sequence
of operations is needed elsewhere in the program, a simple statement can be
used to refer back to the procedure. In essence1, a procedure is just a
mini-program. A large pprocedures that perform different tasks. Procedural languages allow
programs to be shorter and easier for the computer to read, but they require
the programmer to design each procedure to be general enough to be used
in different situations. 高级语言通常分为面向过程的、函数式的、面向对象的或逻辑的语言。当今最常见的高级语言是面向过程的语言。在这种语言中,执行某个完整功能的一个或多个相关的语句块组成一个程序模块或过程,而且被给予诸如“过程A”的名称。如果在程序的其他地方需要同样的操作序列,可以使用一个简单的语句调回这个过程。实质上,一个过程就是一个小型程序。一个大程序可以通过将执行不同任务的过程组合在一起而构成。过程语言使程序变得比较短,而且更易于被计算机读取,但是要求程序员将每个过程都设计得足够通用,能用于不同的情况。
Functional languages treat procedures like mathematical functions
and allow them to be processed like any other data in a program. This
allows a much higher and more rigorous level of program construction.
Functional languages also allow variables—symbols for data that can be
specified and changed by the user as the program is running—to be given
values only once. This simplifies programming by reducing the need to be
concerned with the exact order of statement execution, since a variable does
not have to be redeclared, or restated, each time it is used in a program
statement. Many of the ideas from functional languages have become key
parts of many modern procedural languages. 函数式语言像对待数学函数一样对待过程,并允许像处理程序中的任何其他数据一样处理它们。这就使程序构造在更高、更严密的水平上得以实现。函数式语言也允许变量——在程序运行过程中可以被用户指定和更改的数据符号——只被赋值一次。这样,通过减少对语句执行的确切顺序给予关注的必要性,就简化了编程,因为一个变量没有必要每次在一个程序语句中用到,都重新定义或重新赋值。函数式语言的许多观点已经成为许多现代过程语言的关键部分。


Object-oriented languages are outgrowths of functional languages. In
object-oriented languages, the code used to write th

e program and the data
processed by the program are grouped together into units called objects.
Objects are further grouped into classes, which define the attributes objects
must have. A simple example of a class is the class Book. Objects within
this class might be Novel and Short Story. Objects also have certain
functions associated with them, called methods. The computer accesses an
object through the use of one of the object’s methods. The method performs
some action to the data in the object and reClasses of objects can also be further grouped into hierarchies, in which
objects of one class can inherit methods from another class. The structure
provided in object-oriented languages makes them very useful for
complicated programming tasks. 面向对象的语言是函数式语言的发展结果。在面向对象的语言中,用来编写程序的代码和程序处理的数据,组合成叫做对象的单元。对象进一步组合成类,而类则定义对象必须具有的属性。类的一个简单例子就是书这个类。这个类中的对象可能是小说和短篇小说。对象还有某些与其相关的功能,称为方法。计算机通过使用对象的某种方法来使用这个对象。方法对对象中的数据执行某个操作,然后将值返回给计算机。对象的类也可更进一步组合成层,而在层中一个类的对象可继承另一个类的方法。面向对象的语言中所提供的这种结构,使面向对象的语言对于复杂的编程任务非常有用。


Logic languages use logic as their mathematical base. A logic program
consists of sets of facts and if-then rules, which specify how one set of facts
may be deduced from others, for example: 逻辑语言将逻辑用作其数学基础。一个逻辑程序由一系列的事实与“如果……则”规则组成,来具体说明一系列事实如何可以从其他实事中推断出来,例如:


If the statement X is true, then the statement Y is false.如果X语句为真,则Y语句为假。

In the execution of such a program, an input statement can be logically
deduced from other statements in the program. Many artificial intelligence
programs are written in such languages. 在这样一个程序的执行过程中,一条输入语句可以按照逻辑从程序中的其他语句推断出来。许多人工智能程序使用这种语言编写。


IV. Language Structure and Components 语言的结构与成分

Programming languages use specific types of statements, or
instructions, to provide functional structure to the program. A statement in a
program is a basic sentence that expresses a simple idea—its purpose is to
give the computer a basic instruction. Statements define the types of data
allowed, how data are to be manipulated, and the ways that procedures and functions work. Programmers use statements to manipulate common
components of programming languages, such as variables and

macros
(mini-programs within a program). 编程语言使用特定类型的语句或指令,来给程序提供功能结构。程序中的一条语句是表达一个简单意思的基本句子,其目的是给计算机一条基本指令。语句对允许的数据类型、数据如何处理以及过程和函数的工作方式进行定义。程序员利用语句来操作编程语言的常见成分,如变量和宏(程序中的小型程序)。


Statements known as data declaelements of a program called variables. Variables can be assigned different
values within the program. The properties variables can have are called
types, and they include such things as what possible values might be saved
in the variables, how much numerical accuracy is to be used in the values,
and how one variable may represent a collection of simpler values in an
organized fashion, such as a table or array. In many programming
languages, a key data type is a pointer. Variables that are pointers do not
themselves have values; instead, they have information that the computer
can use to locate some other variable—that is, they point to another
variable. 数据声明语句给予称为变量的程序元素以名称和属性。变量在程序中可以赋予不同的值。变量可以具有的属性被称作类型,它们包括:变量中可能存储什么样的值,值中使用何种程度的数值精度,以及一个变量可以如何以有组织结构的方式——如以表或数组的形式——代表一组比较简单的值等等。在许多编程语言中,一种关键的数据类型是指示字。指示字变量本身没有值;相反,它们含有计算机可以用来查找某个其他变量的信息——也就是说,它们指向另一个变量。


An expression is a piece of a statement that describes a series of
computations to be performed on some of the program’s variables, such as
X+Y/Z, in which the variables are X, Y, and Z and the computations are
addition and division. An assignment statement assigns a variable a value
derived from some expression, while conditional statements specify
expressions to be tested and then used to select which other statements
should be executed next. 表达式是语句的一段,描述要对一些程序变量执行的一系列运算,如X+Y/Z,其中X、Y和Z为变量,运算方法为加和除。赋值语句给一个变量赋予得自某个表达式的值,而条件语句则指定要被测试、然后用于选择接下来应该执行的其他语句的表达式。


Procedure and function statements define certain blocks of code as
procedures or functions that can then be returned to later in the program.
These statements also define the kinds of variables and parameters the
programmer can choose and the type of value that the code will return when
an expression accesses the procedure or function. Many programming
languages also permit minitranslation program

s called macros. Macros
translate segments of code that have been written in a language structure
defined by the programmer into statements that the programming language
understands. 过程与函数语句将某些代码块定义为以后可在程序中返回的进程或函数。这些语句也规定程序员可以选择的变量与参数种类,以及当一个表达式使用过程或函数时代码将返回的值的类型。许多编程

V. History
Programming languages date back almost to the invention of the
digital computer in the 1940s. The first assembly languages emerged in the
late 1950s with the introduction of commercial computers. The first
procedural languages were developed in the late 1950s to early 1960s:
FORTRAN, created by John Backus1, and then COBOL, created by Grace
Hopper 2 . The first functional language was LISP 3 written by John
McCarthy4 in the late 1950s. Although heavily updated, (,) all three languages
are still widely used today. 编程语言几乎可以追溯到20世纪40年代数字计算机发明之时。最早的汇编语言,随着商业计算机的推出,出现于20世纪50年代末。最早的过程语言是在20世纪50年代末到20世纪60年代初开发的:FORTRAN语言由约翰?巴克斯创造,然后由格雷斯?霍珀创造了COBOL语言。第一种函数式语言是LISP,由约翰?麦卡锡于20世纪50年代末编写。这3种语言今天仍在广泛使用,但经历过大量修改。


In the late 1960s, the first object-oriented languages, such as
SIMULA5, emerged. Logic languages became well known in the mid 1970s
with the introduction of PROLOG6, a language used to program artificial
intelligence software. During the 1970s, procedural languages continued to object-oriented and procedural languages in C++ and more recently in
relational languageJAVA 10 . Although pure logic languages have declined in popularity,
variations have become vitally important in the form of relational
languages for modern databases, such as SQL. 20世纪60年代末,出现了最早的面向对象的语言,如SIMULA语言。逻辑语言在20世纪70年代中期随着PROLOG语言的推出而变得广为人知;PROLOG语言是一种用于编写人工智能软件的语言。在20世纪70年代,过程语言继续发展,出现了ALGOL、BASIC、PASCAL、C和Ada等语言。SMALLTALK语言是一种具有高度影响力的面向对象的语言,它导致了面向对象的语言与过程语言在C++和更近期的JAVA语言中的结合。尽管纯粹的逻辑语言受欢迎的程度有所下降,但其变体以现代数据库所使用的关系语言——如结构化查询语言——的形式,变得至关重要。


三Computer Program

相关文档
最新文档