您的当前位置:首页英文翻译材料格式参考

英文翻译材料格式参考

2020-07-17 来源:小侦探旅游网


北方民族大学 毕业设计材料翻译

系(部)名 称: 计算机科学与工程学院 学 生 姓 名: 专 业: 学 号: 指导教师姓名:

北方民族大学教务处制

目 录

I. Introduction ................................................................................................................................... 1 II. Language Types ............................................................................................................................ 1 III. Classification of High-Level Languages ..................................................................................... 2 IV. Language Structure and Components .......................................................................................... 3 V. History .......................................................................................................................................... 4 一、引言........................................................................................................................................... 1 二、语言类型 ................................................................................................................................... 1 三、高级语言的分类 ....................................................................................................................... 2 四、语言的结构与成分 ................................................................................................................... 3 五、历史........................................................................................................................................... 3

I

Computer Language and Programming

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 FORTRAN and COBOL 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, PASCAL , and BASIC fall into this category.

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

1

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.

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.

III. Classification of High-Level Languages

High-level languages are commonly 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

2

the program, a simple statement can be used to refer back to the procedure. In essence, a procedure is just a mini-program. A large program can be constructed by grouping together procedures 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.

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 the 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 returns this value to the computer. Classes 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.

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).

3

Statements known as data declarations give names and properties to elements 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.

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 programs 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 Backus, and then COBOL, created by Grace Hopper. The first functional language was LISP, written by John McCarthy in the late 1950s. Although heavily updated, all three languages are still widely used today.

In the late 1960s, the first object-oriented languages, such as SIMULA, emerged. Logic languages became well known in the mid 1970s with the introduction of PROLOG, a language used to program artificial intelligence software. During the 1970s, procedural languages continued to develop with ALGOL, BASIC, PASCAL, C, and Ada. SMALLTALK was a highly influential object-oriented language that led to the merging of object-oriented and procedural languages in C++ and more recently in JAVA. 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.

4

计算机语言与编程

一、引言

在计算机科学中,编程语言是用来编写可被计算机运行的一系列指令(计算机程序)的人工语言。与英语等自然语言相类似,编程语言具有词汇、语法和句法。然而,自然语言不适合计算机编程,因为它们能引起歧义,也就是说它们的词汇和语法结构可以用多种方式进行解释。用于计算编程的语言必须具有简单的逻辑结构,而且它们的语法、拼写和标点符号的规则必须精确。

编程语言在复杂性和通用程度上大相径庭。有些编程语言是为了处理特定类型的计算问题或为了用于特定型号的计算机系统而编写的。例如,FORTRAN和COBOL等编程语言是为解决某些普遍的编程问题类型而编写的——FORTRAN为了科学领域的应用,而COBOL为了商业领域的应用。尽管这些语言旨在处理特定类型的计算机问题,但是它们具有很高的可移植性,也就是说它们可以用来为多种类型的计算机编程。其他的语言,譬如机器语言,是为一种特定型号的计算机系统,甚至是一台特定的计算机,在某些研究领域使用而编写的。最常用的编程语言具有很高的可移植性,可以用于有效地解决不同类型的计算问题。像C、PASCAL和BASIC这样的语言就属于这一范畴。

二、语言类型

编程语言可划分为低级语言和高级语言。低级编程语言或机器语言,是编程语言中最基础的类型,能被计算机直接理解。机器语言的区别取决于制造商和计算机的型号。高级语言是在计算机能够理解和处理之前必须首先翻译成机器语言的编程语言。C、C++、PASCAL和FORTRAN都是高级语言的例子。汇编语言是中级语言,非常接近于机器语言,没有其他高级语言所表现出的语言复杂程度,但仍然得翻译成机器语言。

1、机器语言

在机器语言中,指令被写成计算机能够直接理解的被称之为比特的1和0的序列。机器语言中的一条指令通常告诉计算机4件事情:(1)到计算机主存储器(随机访问存储器)的哪个位置去找一或两个数字或者简单的数据段;(2)要执行的一个简单操作,例如将两个数字加起来;(3)将这个简单操作的结果存放在主存储器的什么位置;以及(4)到哪里找要执行的下一条指令。虽然所有的可执行程序最终都是以机器语言的形式被计算机读取,但是它们并非都是用机器语言编写的。直接用机器语言编程极端困难,因为指令是1和0的序列。机器语言中的一条典型的指令可能是10010 1100 1011,意思是将存储寄存器A的内容加到存储寄存器B的内容中。

2、高级语言

1

高级语言是利用人类语言中的词和句法的一套相对复杂的语句。它们比汇编语言和机器语言更类似于正常的人类语言,因此用来编写复杂的程序更容易。这些编程语言允许更快地开发更庞大和更复杂的程序。然而,在计算机能够理解之前,高级语言必须被称之为编译器的另外一种程序翻译成机器语言。因为这个原因,与用汇编语言编写的程序比较起来,用高级语言编写的程序可能运行的时间更长,占用的内存更多。

3、汇编语言

计算机编程人员使用汇编语言使机器语言程序编写起来更简单一些。在汇编语言中,每条语句大致对应一条机器语言指令。汇编语言的语句是借助易于记忆的命令编写的。在典型的汇编语言的语句中,把存储寄存器A的内容加到存储寄存器B的内容中这一命令,可以写成ADD B, A。汇编语言与机器语言具有某些共同特征。例如,对特定的比特进行操作,用汇编语言和机器语言都是可行的。当尽量减少程序的运行时间很重要时,程序员就使用汇编语言,因为从汇编语言到机器语言的翻译相对简单。当计算机的某个部分必须被直接控制时,如监视器上的单个点或者流向打印机的单个字符,这时也使用汇编语言。

三、高级语言的分类

高级语言通常分为面向过程的、函数式的、面向对象的或逻辑的语言。当今最常见的高级语言是面向过程的语言。在这种语言中,执行某个完整功能的一个或多个相关的语句块组成一个程序模块或过程,而且被给予诸如“过程A”的名称。如果在程序的其他地方需要同样的操作序列,可以使用一个简单的语句调回这个过程。实质上,一个过程就是一个小型程序。一个大程序可以通过将执行不同任务的过程组合在一起而构成。过程语言使程序变得比较短,而且更易于被计算机读取,但是要求程序员将每个过程都设计得足够通用,能用于不同的情况。

函数式语言像对待数学函数一样对待过程,并允许像处理程序中的任何其他数据一样处理它们。这就使程序构造在更高、更严密的水平上得以实现。函数式语言也允许变量——在程序运行过程中可以被用户指定和更改的数据符号——只被赋值一次。这样,通过减少对语句执行的确切顺序给予关注的必要性,就简化了编程,因为一个变量没有必要每次在一个程序语句中用到,都重新定义或重新赋值。函数式语言的许多观点已经成为许多现代过程语言的关键部分。

面向对象的语言是函数式语言的发展结果。在面向对象的语言中,用来编写程序的代码和程序处理的数据,组合成叫做对象的单元。对象进一步组合成类,而类则定义对象必须具有的属性。类的一个简单例子就是书这个类。这个类中的对象可能是小说和短篇小说。对象还有某些与其相关的功能,称为方法。计算机通过使用对象的某种方法来使用这个对象。方法对对象中的数据执行某个操作,然后将值返回给计算机。对象的类也可更进一步组合成层,而在层中一个类的对象可继承另一个类的方法。面向对象的语言中所提供的这种结构,使面向对象的语言对于复杂的编程任务非常有用。

逻辑语言将逻辑用作其数学基础。一个逻辑程序由一系列的事实与“如果„„则”规则

2

组成,来具体说明一系列事实如何可以从其他实事中推断出来,例如:

如果X语句为真,则Y语句为假。

在这样一个程序的执行过程中,一条输入语句可以按照逻辑从程序中的其他语句推断出来。许多人工智能程序使用这种语言编写。

四、语言的结构与成分

编程语言使用特定类型的语句或指令,来给程序提供功能结构。程序中的一条语句是表达一个简单意思的基本句子,其目的是给计算机一条基本指令。语句对允许的数据类型、数据如何处理以及过程和函数的工作方式进行定义。程序员利用语句来操作编程语言的常见成分,如变量和宏(程序中的小型程序)。 数据声明语句给予称为变量的程序元素以名称和属性。变量在程序中可以赋予不同的值。变量可以具有的属性被称作类型,它们包括:变量中可能存储什么样的值,值中使用何种程度的数值精度,以及一个变量可以如何以有组织结构的方式——如以表或数组的形式——代表一组比较简单的值等等。在许多编程语言中,一种关键的数据类型是指示字。指示字变量本身没有值;相反,它们含有计算机可以用来查找某个其他变量的信息——也就是说,它们指向另一个变量。

表达式是语句的一段,描述要对一些程序变量执行的一系列运算,如X+Y/Z,其中X、Y和Z为变量,运算方法为加和除。赋值语句给一个变量赋予得自某个表达式的值,而条件语句则指定要被测试、然后用于选择接下来应该执行的其他语句的表达式。

过程与函数语句将某些代码块定义为以后可在程序中返回的进程或函数。这些语句也规定程序员可以选择的变量与参数种类,以及当一个表达式使用过程或函数时代码将返回的值的类型。许多编程语言也容许叫做宏的小型翻译程序。宏把使用程序员定义的语言结构编写的代码段翻译成编程语言可以理解的语句。

五、历史

编程语言几乎可以追溯到20世纪40年代数字计算机发明之时。最早的汇编语言,随着商业计算机的推出,出现于20世纪50年代末。最早的过程语言是在20世纪50年代末到20世纪60年代初开发的:FORTRAN语言由约翰•巴克斯创造,然后由格雷斯•霍珀创造了COBOL语言。第一种函数式语言是LISP,由约翰•麦卡锡20世纪50年代末编写。这3种语言今天仍在广泛使用,但经历过大量修改。

20世纪60年代末,出现了最早的面向对象的语言,如SIMULA语言。逻辑语言在20

3

世纪70年代中期随着PROLOG语言的推出而变得广为人知;PROLOG语言是一种用于编写人工智能软件的语言。在20世纪70年代,过程语言继续发展,出现了ALGOL、BASIC、PASCAL、C和Ada等语言。SMALLTALK语言是一种具有高度影响力的面向对象的语言,它导致了面向对象的语言与过程语言在C++和更近期的JAVA语言中的结合。尽管纯粹的逻辑语言受欢迎的程度有所下降,但其变体以现代数据库所使用的关系语言——如结构化查询语言——的形式,变得至关重要。

4

因篇幅问题不能全部显示,请点此查看更多更全内容