Студопедия

КАТЕГОРИИ:

АстрономияБиологияГеографияДругие языкиДругоеИнформатикаИсторияКультураЛитератураЛогикаМатематикаМедицинаМеханикаОбразованиеОхрана трудаПедагогикаПолитикаПравоПсихологияРиторикаСоциологияСпортСтроительствоТехнологияФизикаФилософияФинансыХимияЧерчениеЭкологияЭкономикаЭлектроника


Programming languages. Computers cannot understand ordinary spoken English or any other natural language




 

Computers cannot understand ordinary spoken English or any other natural language. The only language they can understand and execute directly is called machine code. This consists of the 1s and 0s (binary codes) that are processed by the CPU.

Machine code as a means of communication is very difficult to write, so we use symbolic languages that are easier to understand. The translation of symbolic instructions to machine code is accomplished through the use of a special program called a language processor. There are three types of language processors: assemblers, compilers, and interpret­ers. Each translates symbolic instructions to machine code, but each does it differently.

A programming language is a machine-readable artificial language designed to express computations that can be performed by a machine, particularly a computer. Programming languages can be used to create programs that specify the behavior of a machine, to implement algorithms precisely. A programming language must convey the logical steps of the program plan so that the control unit or the CPU can interpret and follow the instructions. A programming

language's surface form is known as its syntax. Most programming languages are purely textual; they use sequences of text including words, numbers, and punctuation, much like written natural languages. On the other hand, there are some programming languages which are more graphical in nature, using visual relationships between symbols to specify a program. Programming languages have improved throughout the years, just as computer hardware has improved. They have progressed from machine-oriented languages that use strings of binary 1s and 0s to problem-oriented languages that use common mathematical and/or English terms.

The so-called assembly languages use abbreviations such as ADD, SUB, MPY to represent instructions. These mnemonic codes are like labels easily associated with the items to which they refer. Basic languages, where the program is similar to the machine code version, are known as low-level languages. In these languages, each instruction is equivalent to a single machine code instruction, and the program is converted into machine code by an assembler. A low-level language does not need a compiler or interpreter to run; the processor for which the language was written is able to run the code without using either of these. These languages are still quite complex and restricted to particular machines. Machine code and assembly languages are called low-level languages because they are close to the hardware and provide little or no abstraction from a computer's instruction set architecture.

  To make the programs easier to write and to overcome the problem of intercommunication between different types of machines, high-level languages were designed such as BASIC, COBOL, FORTRAN or Pascal. These are all problem-oriented rather than machine-oriented. High-level languages are closer to human languages; they use forms resembling English, which makes programming easier; they provide strong

abstraction from the details of the computer and hide the details of CPU operations, they are more portable across platforms. Programs written in one of these languages (known as source programs) are converted into a lower-level language by means of a compiler (generating the object program). On compilation, each statement in a high-level language is generally translated into many machine code instructions. Some languages are interpreted by an interpreter program, which converts the program into machine code one line at a time as each line is required by the processor. A compiled program only needs to be compiled once, but an interpreted program needs to be interpreted every time it is used. Compiled programs are faster than interpreted programs.

Different programming languages support different styles of programming (called programming paradigms).

The details look different in different languages, but a few basic instructions appear in just about every language:

  • input: Get data from the keyboard, a file, or some other device.
  • output: Display data on the screen or send data to a file or other device.
  • math: Perform basic mathematical operations like addition and multiplication.
  • conditional execution: Check for certain conditions and execute the appropriate sequence of statements.
  • repetition: Perform some action repeatedly, usually with some variation.

The languages used to create Web documents are called markup languages; they use instructions (markups) to format and link text files. Examples are:

HTML(Hyper Text Markup Language) – the code used to create Web pages. It is a page description language used for creating webpages. HTML uses a system of tags to mark page links and formatting. For example, the tag <u> tells the program to start underlining a text. Although programs cannot be created using HTML, small programs can be embedded in HTML code using a scripting language like JavaScript.

VoiceXML – it makes Internet content accessible via speech recognition and phone.

 

Instead of using a web browser on a PC, you use a telephone to access voice-equipped websites via a VoiceXML interpreter (a voice browser). For input, VoiceXML uses voice recognition. For output, it uses pre-recorded audio content and speech synthesis (text-to-speech). You just dial the phone number of the website and then give spoken instructions, commands, and get the required information. A typical VoiceXML page could be ‘sports.vxml’

People communicate instructions to the computer in symbolic languages and the easier this communication can be made, the wider the application of computers will be. Scientists are already working on Artificial Intelligence and the next generation of computers may be able to understand human languages.


Поделиться:

Дата добавления: 2014-11-13; просмотров: 519; Мы поможем в написании вашей работы!; Нарушение авторских прав





lektsii.com - Лекции.Ком - 2014-2024 год. (0.006 сек.) Все материалы представленные на сайте исключительно с целью ознакомления читателями и не преследуют коммерческих целей или нарушение авторских прав
Главная страница Случайная страница Контакты