Lesson 5. Programming languages 


Мы поможем в написании ваших работ!



ЗНАЕТЕ ЛИ ВЫ?

Lesson 5. Programming languages



I. Read and translate the text.

Usage

A programming language provides a structured mechanism for defining pieces of data, and the operations of transformations that may be carried out automatically on that data. A programmer uses the abstractions present in the language to represent the concepts involved in a computation. These concepts are represented as a collection of the simplest elements available (called primitives).

Programming languages differ from most other forms of human expression in that they require a greater degree of precision and completeness. When using a natural language to communicate with other people, human authors and speakers can be ambiguous and make small errors, and still expect their intent to be understood. However, figuratively speaking, computers do exactly what they are told to do, and cannot “understand” what code the programmer intended to write. The combination of the language definition, a program, and the program’s inputs must fully specify the external behavior that occurs when the program is executed, within the domain of control of that program.

Programs for a computer might be executed without human interaction, or a user might type commands in an interactive session of an interpreter. In this case the “commands” are simply programs, whose execution is chained together. When a language is used to give commands to a software application it is called a scripting language.

Many languages have been designed from scratch, altered to meet new needs, combined with other languages, and eventually fallen into disuse. Although there have been attempts to design one “universal” computer language that serves all purposes, all of them have failed to be generally accepted as filling this role. The need for diverse computer languages arises from the diversity of contexts in which languages are used.

Notes

A greater degree of precision and completeness — большая степень точности и завершенности; be ambiguous—- быть неясным, сомнительным; within the domain of control—- в домене (области) управления; from scratch - «на ходу».

II. Answer these questions.

1. What spectrum of languages does the user have in his/ her disposal? 2. Which languages do you call “low level”? 3. Which languages are the best for machine? 4. Which languages are the best for programmer? 5. What language do you call a machine language? 6. How is фn instruction usually written in a machine language? 7. What is the difference between natural language and computer language? 8. Why is it possible for man to make mistakes? Does it prevent us from understanding each other? 9. Why have attempts to devise a universal computer language failed?

III. Render the main points of the text in English and in Russian.

IV. Read and translate the text. Express your opinion on the following points:

•the first programming languages;

•achievements of the 1930s and 1940s;

•first-generation machines;

•ALGOL, FORTRAN, LISP, BASIC, PASCAL, COBOL.

Early developments

The first programming languages predate the modern computer. The 19th century had “programmable” looms and player piano scrollswhich implemented what are today recognized as examples of specific programming languages. By the beginning of the 20th century, punch cards encoded data and directed mechanical processing. In the 1930s and 1940s, the formalisms of Alonzo Church’s lambda calculus and Alan Turing’s Turing machines provided mathematical abstractions for expressing algorithms. The lambda calculus remains influential in language design.

In the 1940s, the first electrically powered digital computers were created. The first high-level programming language to be designed for a computer was Plankalkul, developed by Konrad Zuse between 1943 and 1945.

The computers of the early 1950s, notably the UNIVAC I and the IBM 701 used machine language programs. First generation machine language programming was quickly superseded by a second generation of programming languages known as Assembly languages. Later in the 1950s, assembly language programming, which had evolved to include the use of macro instructions, was followed by the development of three higher-level programming languages: FORTRAN, LISP, and COBOL. Updated versions of all these are still in general use and each has strongly influenced the development of later languages. At the end of the 1950s, the language formalized as Algol 60 was introduced, and later programming languages are, in many respects descendants of Algol. The format and use of the early programming languages was heavily influenced by the constraints of the interface.

Notes

Loom — ткацкий станок; player piano scrolls — автоматическое нажатие на клавиши фортепиано; lambda calculus — лямбда-исчисление; in many respects — во многих отношениях

 

V. Discuss the programming languages you know.

VI. What do you know about “natural language” systems?

VII. Read the text. Comment on differences between high-level and low-level languages. Why are low-level and high-level languages inherently relative?

High level language

The term “high-level language” does not imply that the language is always superior to low-level programming languages. It refers to the higher level of abstraction from machine language. Rather than dealing with registers, memory addresses and call stacks, high-level languages deal with usability, threads, locks, objects, variables, arrays and complex arithmetic or Boolean expressions. In addition, they have no opcodes that can directly compile the language into machine code, unlike low-level assembly language. Other features such as string handling routines, object-oriented language features and file input/output may also be present.

Stereotypically, high-level languages make complex programming simpler, while low-level languages tend to produce more efficient code. Abstraction penalty is the barrier preventing applying high level programming techniques in situations where computational resources are limited. High level programming features like more generic data structures, run-time interpretation and intermediate code files often result in slower execution speed, higher memory consumption and larger binary size. For this reason, code which needs to run particularly quickly and efficiently may be written in a lower-level language, even if a higher-level language would make the coding easier.

However, with the growing complexity of modern microprocessor architectures, well-designed compilers for high-level languages frequently produce codes comparable in efficiency to what most low-level programmers can produce by hand, and the higher abstraction may allow more powerful techniques provide better overall results than their low-level counterparts in particular settings.

The terms “high-level”and “low-level”are inherently relative. Some decades ago, the C language (and similar languages) was most often considered “high-level”, as it supported concepts such as expression evaluation, data types and structures, while assembly language was considered “low-level”. Many programmers today might refer to C as low-level, as it lacks a large runtime-system (e.g. no garbage collection), basically supports only scalar operations, and provides direct memory addressing. It therefore readily blends with assembly language and the machine level of CPUs and microcontrollers.

Also note that assembly language may itself be regarded as a higher level (but still one-to-one) representation of machine code, as it supports concepts such as constant and limited expressions, sometimes even variables, procedures, and data structures. Machine code, in its turn, is inherently at a slightly higher level than the microcode or micro-operations used internally in many processors.

Notes

Opcode = operation code – код машинной команды, код операции; string handling – операции со строками символов; обработка строк; abstraction penalty – зд. проблемы абстракции (абстракция - широко используемый в моделировании принцип игнорирования аспектов проблемы, не оказывающих существенного влияния на её решение).

VIII. Look through the text again and comment on the differences and interrelations between high-level and low-level languages.

IX. Read the text. Select the key phrases and use them to retell it.

Viruses

Computer viruses, like physical viruses, are invidious, insidious, and often deadly. They are programs on a computer disk that generally remain undetected until their damage is done; they move from an infected disk to the system disk or another disk in the system, and they replicate themselves, turning data into unusable nonsense when they become active. The damage is typically permanent, and anyone who has lost important files to a virus understands how serious the problem is. Other viruses are not quite deadly to your data, but do such things as slowing your computer to a crawl, putting prank messages on the screen, and the like. Some viruses wait until a particular date or other conditions before becoming active; others act immediately to inflict harm on your computer.

Viruses are often spread through shared disks; some bulletin boards were infected with Michelangelo or Stoned and unknowingly passed them on to subscribers who downloaded files — or even simply logged on to the system. Some viruses, known as Trojan horses, are designed to act like a legitimate piece of software when first used; once on your system, though, they destroy all your data.

The effect of a worm is much like that of a virus: you lose disk space and computer capability. The difference — which doesn’t much matter if you’ve lost the use of the computer — is that a worm does not attach itself to other programs while it spreads. It does, however, write itself to each computer it encounters in a network, establishing itself on the hard disk, and using up memory until affected computer becomes disabled.

MODULE III. COMPUTER IN USE

 



Поделиться:


Последнее изменение этой страницы: 2021-11-27; просмотров: 53; Нарушение авторского права страницы; Мы поможем в написании вашей работы!

infopedia.su Все материалы представленные на сайте исключительно с целью ознакомления читателями и не преследуют коммерческих целей или нарушение авторских прав. Обратная связь - 3.137.218.230 (0.01 с.)