You get a bonus - 1 coin for daily activity. Now you have 1 coin

PROGRAM LANGUAGE REVIEW

Lecture



Assembler

Assembly Language is a symbolic representation of machine language. It facilitates the programming process compared to programming in machine codes.

It is not necessary for the programmer to use the real addresses of memory cells with the data contained in them, participating in the operation, and the calculated results, as well as the addresses of those commands to which the program does not refer.

Some tasks, such as exchanging with non-standard data processing devices for complex structures, cannot be solved using high-level programming languages. It is the power of the assembler.

In principle, assembly language is a machine language. And a programmer who realizes any task in high-level languages, with the help of Assembler, and can determine whether the solution of this problem is meaningful from the point of view of using a computer.

Knowing how to understand the printout of assembly language, it makes it possible to facilitate the search for errors in programs, because Some languages ​​are compilers (see p. 1.2.).

Lisp

One of the oldest programming languages ​​Fortran was created in the 50s. of our century. Fortran and similar programming languages (Algol, PL / 1) were intended for solving computational problems arising in mathematics, physics, engineering calculations, economics, etc. These languages ​​mostly work with numbers.

The second oldest Lisp programming language ( L ist I nformation S ymbol P rocessing ), by J. McCarthy in 1962, is more likely to work with character strings than to work with numbers. This particular purpose of Lisp has opened up a new field of activity for programmers, now known as “artificial intelligence”. Currently Lisp is successfully used in expert systems, analytical computing systems, etc.

The vastness of the area of ​​possible applications of Lisp has caused the emergence of many different Lisp a dialects. This is easily explained: the use of Lisp for understanding natural language requires a certain set of basic functions that are different, for example, from that used in medical diagnostics.

The existence of many different Lisp dialects led to the creation in the early 80s. Common LISP Committee, which had to choose the most suitable Lisp dialect and suggest it as the main one. This dialect, chosen by the Committee in 1985, was called Common LISP . Later, he was accepted at US universities, as well as by many developers of artificial intelligence systems, as the main dialect of Lisp language .

Lisp programming language is significantly different from other programming languages, such as Pascal , C , etc. Working with symbols and working with numbers as basic elements require different ways of thinking.

Lisp was originally conceived as a theoretical tool for recursive constructions, and today it has become a powerful tool that provides the programmer with various support, allowing him to quickly build prototypes of very, very serious systems.

Professor at the Massachusetts Institute of Technology J. Samman noted that the mathematical clarity and maximum clarity of Lisp is not all. The main thing - Lisp allows you to formulate and remember the "idioms", so characteristic of projects on artificial intelligence.

Fortran

One of the first and most successful compilers was the Fortran language, developed by IBM. Professor J. Books and a group of American programming experts in 1954 published the first language report. Literally, the name of the language FOR mulae TRA N slation is the transformation of formulas.

Among the reasons for the longevity of Fortran (and it is one of the most common languages ​​in the world), we can note the simple structure of both Fortran itself and its intended translators. A program in FORTRAN is recorded in a sequence of sentences or operators (a description of a certain transformation of information), and is issued according to certain standards. These standards impose restrictions, in particular, on the form of the record and the location of parts of the operator in the blank line for the record of operators. A program recorded in Fortran is one or more segments (subroutines) of operators. The segment that controls the work of the program as a whole is called the main program.

Fortran was conceived for use in the field of scientific and engineering computing. However, in this language, tasks with branched logic are easily described (modeling of production processes, solving game situations, etc.), some economic tasks and especially editing tasks (creating tables, summaries, statements, etc.).

A modification of the Fortran language, which appeared in 1958, was named Fortran II and contained the concept of subroutine and common variables for providing communication between segments.

By 1962, the emergence of a language known as Fortran IV , which has become the most widely used at the present time, dates back. The beginning of the commission’s activities at the American Standards Association (ASA) , which developed two standards by 1966 - the FORTRAN languages ​​and the basic FORTRAN (Basic FORTRAN), also dates back to this time . These languages ​​roughly correspond to modifications IV and II , but the basic Fortran is a subset of FORTRAN, while FORTRAN II is not such for Fortran IV . Language Fortran still continues to evolve and improve, influencing the creation and development of other languages. For example, Fortran is the basis of Basic , an interactive language that is very popular for solving small problems, an excellent language for learning how to use algorithmic languages ​​in programming practice. This language has been developed - Beginner's All –purpose Symbolic Instruction Code - a group of employees of the Computing Center of Durmouth College, New Hampshire, created in 19 .... . But this is the next language.

BASIC

Like the famous hamburgers, baseball and basketball, Basic is the product of New England. As I said, created in 1964, as a language for learning programming. BASIC is a common acronym for " B eginner's A ll-purpose S ymbolic Institutional C ode" (BASIC) - Multi-Purpose C S Immunic About Teaching C One for N Sites. "

Soon, both the trainees and the authors of the programs discovered that the Basic could do almost everything that the boring, clumsy Fortran does. And since BASIC was easy to learn and easy to work with, programs were usually written on it faster than on FORTRAN . BASIC was also available on personal computers, usually it was built into the ROM. So BASIC won popularity. Interestingly, 20 years after the invention of BASIC , it is still the easiest to learn from dozens of general-purpose programming languages ​​that are available to fans of programming. Moreover, he does an excellent job.

Despite the statements of snobs - supporters of the C and Pascal languages , BASIC is considered a business language, equipped with powerful tools for solving specific tasks that most users usually solve with the help of small computers, namely working with files and displaying text and graphic images on the display screen.

Despite the few flaws in Basic , no one will deny that Kemeny and Kurts have achieved their main goal: to make programming more accessible for more people.

Historically, BASIC has usually been realized as an interpreter (the interpreter BASIC itself is a familiar isomer). The reasons for the transition from the amateur level to the professional level are numerous extensions of the classical version of the language: the ability to turn off line numbering, multi-line structured program structures, "write" structures, named subroutines with parameters, and local variables.

Moreover, with the advent of Microsoft's QuickBasic translator, developers were able to build applications in BASIC from separately compiled modules, some of which can be written in other languages. Now, as in the case of other leading programming languages, the developer has a choice of several industrial subroutine libraries that contain ready-made solutions for common programming problems.

Refal

Undoubtedly it is necessary to tell about some programming languages ​​created in our homeland. One of these languages ​​is Refal , developed here in Russia (USSR), in 1966. IPM Academy of Sciences of the USSR. This language is simple and convenient for describing manipulations on arbitrary text objects.

Refal is widely used in the development of translators from algorithmic languages, both universal and problem-oriented, and autocodes. In addition to use in translation problems, Refal has such important areas of application as the machine implementation of cumbersome analytical calculations in theoretical physics and applied mathematics; design of “smart” information systems that carry out non-trivial logical processing of information; machine proof of theorems; modeling targeted behavior; development of interactive learning systems; research in the field of artificial intelligence, etc.

Programming on Refal e is specific, primarily due to the fact that Refal is a functional type language in contrast to ordinary operator languages ​​such as Algol , Fortran , etc .. If a program in operator languages ​​is nothing but a set of operator orders, then the Refal e program is essentially a description of the connections and relationships between certain concepts.

Due to the fact that in Refal the programmer himself determines the structure of the processed information, the effectiveness of the program essentially depends on the successful or unsuccessful selection of this structure. To specify the structures in Refal , brackets are used, and the specificity of all implementations of the language is such that the use of brackets dramatically increases the efficiency of program execution. This is achieved by using address brackets.

Variables of the “expression” type also have a certain specificity - this means their ability to lengthen when identified. Proper use of variables of this type also allows you to significantly improve the efficiency of the Refal program.

Prologue and Prologue ++

Prologue is a language designed to find solutions. This is a declarative language, that is, a formal formulation of the problem can be used to solve it. The prolog defines logical relations in the problem as different from the step-by-step solution of this problem.

The central part of Prolog is the inference engine, which solves queries using a given set of facts and rules that are addressed as statements. The prolog also has no division of variables into types and can dynamically add rules and facts to the output. Thus, it is a flexible language, and it is more suitable for an object-oriented extension than a language with strictly specified types, for example, Pascal . Prolog ++ is an addition to the standard Prolog in.

All language properties are still available to programmers. Consequently, Prolog ++ can be attributed to the group of hybrid languages, of which Object Pascal and C ++ are considered representatives . The Prolog ++ extension supports all the properties typically found in object-oriented languages: concepts of objects and classes, single and multiple inheritance, subclassing, and message passing. Some advanced features that exist in languages ​​such as C ++ and Smalltalk are also supported , including public and private methods.

An interesting feature is support in a programming language with data management. This technique, which can also be called event-driven programming, is used in most object-oriented programming languages, especially those designed for machines with a mouse-driven interface.

An object-oriented program responds to events that determine the flow of control. In Prolog e ++ programming with data management is achieved using the concept of demons . A daemon is an object whose methods are called in case of certain events and can thus be used to support programming with data management.

The language itself is based on the concept of messaging. The program on Prolog e ++ is built around a set of objects Prolog a ++ , which exchange messages. In this sense, Prolog ++ is closer to a pure object-oriented language, such as Smalltalk , than C ++ or Object Pascal . Object definitions are built based on calls.

Open_Object [object_name] and Close_Object [object_name] , and methods are defined in much the same way as in other object-oriented languages. To set inheritance, you can explicitly specify which method of which object should be inherited, which is necessary for multiple inheritance.

Lex

Lex is a generator of lexical analysis programs. Lexical analysis is the recognition of tokens in the input stream of characters. Suppose that a certain finite set of words (tokens) in a language and an input word are given. It is necessary to establish which element of the set (if it exists) coincides with the given input word. Usually lexical analysis is performed by the so-called lexical analyzer. A lexical analyzer is a program. Lexical analysis is used in many cases, for example, to build a batch editor or as a recognizer of directives in an interactive program, etc. However, the most important application of the lexical analyzer is its use in the compiler. Here the lexical analyzer performs the function of a data entry program.

The lexical analyzer performs the first compilation stage — it reads the lines of the compiled program, selects lexemes and transfers them to further compilation stages (grammatical parsing, code generation, etc.).

The lexical analyzer recognizes the type of each token and marks it accordingly. For example, when compiling a C program, the following types of tokens can be distinguished: number, identifier, operator, delimiter, etc.

The lexical analyzer must not only select the lexeme, but also perform some transformations. For example, if the lexeme is a number, then it must be translated into an internal (binary) form of the record as a number with a floating or fixed point. And if the lexeme is an identifier, then it must be placed in the table in order to refer to it not by name, but by address in the table.

Although the lexical analysis is simple in its idea, nevertheless, this phase of the compiler often takes more time than any other. This is partly due to the need to view and analyze the source text character by character. Sometimes it is even necessary to return the read character to the input stream in order to repeat the review and analysis.

C

C is a general-purpose programming language that is well known for its efficiency, economy, and portability. These advantages of Sio provide a good quality of development of almost any type of software product. Using C as an instrumental language allows you to get fast and compact programs. In many cases, programs written in C are comparable in speed to programs written in assembly language. At the same time, they have better visibility and are more easily accompanied. C combines efficiency and power in a relatively small-sized language.

C is a wonderful language, and although some people don’t like it, most programmers still love it. In C, you can create programs that do whatever you want. There is no other language that also stimulates programming. It seems that other programming languages ​​erect artificial obstacles for creativity, but C does not. Using this language allows you to reduce the time spent on creating working programs. C allows you to program quickly, efficiently and predictably. Another advantage of C is that it allows you to use all the capabilities of your computer. This language is created by a programmer for use by other programmers, which cannot be said about other programming languages.

Features of the C language

The C language has its own essential features; let's list some of them:

C provides a complete set of structured programming statements. C offers an unusually large set of operations. Many C operations correspond to machine instructions, and therefore allow live transmission to machine code. A variety of operations allows you to select their various sets to minimize the resulting code.

C supports pointers to variables and functions. A pointer to the program object corresponds to the machine address of this object.By intelligently using pointers, you can create efficiently executed programs, since pointers allow you to refer to objects in the same way as a machine does. C supports pointer arithmetic, and thus allows direct access and manipulation of memory addresses.

In its composition C contains a preprocessor that processes text files before compiling. Among its most useful applications when writing C programs are: defining program constants, replacing function calls with similar but faster macros, conditional compilation. The preprocessor is not limited to processing only source C text files, it can be used for any text file.

Си - гибкий язык, позволяющий принимать в конкретных ситуациях самые разные решения. Тем не менее, Си налагает незначительные ограничения в таких, например, действиях, как преобразование типов. Во многих случаях это является достоинством, однако программисты должны хорошо знать язык, чтобы понимать, как будут выполняться их программы.

Недостатки языка Си

Также, как и особенностей, в языке Си присутствует куча недостатков. Ведь от них не защищен не один проект, в том числе проект разработки и выполнения программ, на языке Си:

Язык Си предъявляет достаточно высокие требования к квалификации использующего его программиста. При изучении Си желательно иметь представление о структуре и работе компьютера. Большую помощь и более глубокое понимание идей Си, как языка системного программирования, обеспечат хотя бы минимальное знание языка ассемблер. Уровень старшинства некоторых операторов не является общепринятым, некоторые синтаксические конструкции могли бы быть лучше. Тем не менее, как оказалось Си – чрезвычайно эффективный и выразительный язык, пригодный для широкого класса задач.

Си++

Безусловно, Си++ восходит, главным образом, к Си. Си сохранен как подмножество, поэтому сделанного в Си акцента на средствах низкого уровня достаточно, чтобы справляться с самыми насущными задачами системного программирования. Си, в свою очередь, многим обязан своему предшественнику BCPL.

Название Си++ - изобретение лета 1983-его. Более ранние версии языка использовались начиная с 1980-ого и были известны как " Cи с Классами ". Первоначально язык был придуман потому, что автор хотел написать событийно управляемые модели для чего был бы идеален Simula67 , если не принимать во внимание эффективность. " Cи с Классами " использовался для крупных проектов моделирования, в которых строго тестировались возможности написания программ, требующих (только) минимального пространства памяти и времени на выполнение. В " Cи с Классами " не хватало перегрузки операций, ссылок, виртуальных функций и многих деталей. Си++ был впервые введен за пределами исследовательской группы автора в июле 1983-го. Однако тогда многие особенности Си++ были еще не придуманы.

Название Си++ выдумал Рик Масситти. Название указывает на эволюционную природу перехода к нему от Си. " ++ " - это операция приращения в Си. Чуть более короткое имя + является синтаксической ошибкой, кроме того, оно уже было использовано как имя совсем другого языка. Знатоки семантики Си находят, что Си++ хуже, чем Си. Названия D язык не получил, поскольку он является расширением Си и в нем не делается попыток исцелиться от проблем путем выбрасывания различных особенностей.

Си++ - это универсальный язык программирования, задуманный так, чтобы сделать программирование более приятным для серьезного программиста. За исключением второстепенных деталей Си++ является надмножеством языка программирования Си. Помимо возможностей, которые дает Си, Си++ предоставляет гибкие и эффективные средства определения новых типов. Используя определения новых типов, точно отвечающих концепциям приложения, программист может разделять разрабатываемую программу на легко поддающиеся контролю части. Такой метод построения программ часто называют абстракцией данных. Информация о типах содержится в некоторых объектах типов, определенных пользователем. Такие объекты просты и надежны в использовании в тех ситуациях, когда их тип нельзя установить на стадии компиляции. Программирование с применением таких объектов часто называют объектно-ориентированным. При правильном использовании этот метод дает более короткие, проще понимаемые и легче контролируемые программы.

Изначально Си++ был разработан, чтобы автору и его друзьям не приходилось программировать на ассемблере, Си или других современных языках высокого уровня. Основным его предназначением было сделать написание хороших программ более простым и приятным для отдельного программиста. Плана разработки Си++ на бумаге никогда не было. Проект, документация и реализация двигались одновременно. Разумеется, внешний интерфейс Си++ был написан на Си++. Никогда не существовало "Проекта Си++" и "Комитета по разработке Си++". Поэтому Си++ развивался и продолжает развиваться во всех направлениях, чтобы справляться со сложностями, с которыми сталкиваются пользователи, а также в процессе дискуссий автора с его друзьями и коллегами.

В качестве базового языка для Си++ был выбран Си, потому что он:

  • многоцелевой, лаконичный и относительно низкого уровня:
  • отвечает большинству задач системного программирования:
  • идет везде и на всем:
  • пригоден в среде программирования UNIX.

В Си есть свои сложности, но в наспех спроектированном языке тоже были бы свои, а сложности Си нам известны. Самое главное, работа с Си позволила " Cи с Классами " быть полезным (правда, неудобным) инструментом в ходе первых месяцев раздумий о добавлении к Си Simula -подобных классов.

Си++ стал использоваться шире, и по мере того, как возможности, предоставляемые им помимо возможностей Си, становились все более существенными, вновь и вновь поднимался вопрос о том, сохранять ли совместимость с Си. Ясно, что отказавшись от определенной части наследия Си можно было бы избежать ряда проблем. Это не было сделано, потому что:

  • есть миллионы строк на Си, которые могли бы принести пользу в Си++ при условии, что их не нужно было бы полностью переписывать с Си на Си++;
  • есть сотни тысяч строк библиотечных функций и сервисных программ, написанных на Си которые можно было бы использовать из или на Си++ при условии, что Си++полностью совместим с Си по загрузке и синтаксически очень похож на Си;
  • есть десятки тысяч программистов, которые знают Си, и которым, поэтому, нужно только научиться использовать новые особенности Си++, а не заново изучать его основы;
  • поскольку Си++ и Си будут использоваться на одних и тех же системах одними и теми же людьми, отличия должны быть либо очень большими, либо очень маленькими, чтобы свести к минимуму ошибки и недоразумения.

Позднее была проведена проверка определения Си++, чтобы удостовериться в том, что любая конструкция, допустимая и в Си, и в Си++, действительно означает в обоих языках одно и то же.

Си++ был развит из языка программирования и за очень немногими исключениями сохраняет Си как подмножество. Базовый язык, Си подмножество Си++, спроектирован так, что имеется очень близкое соответствие между его типами, операциями и операторами и компьютерными объектами, с которыми непосредственно приходится иметь дело: числами, символами и адресами. За исключением операций свободной памяти new и delete, отдельные выражения и операторы Си++ обычно не нуждаются в скрытой поддержке во время выполнения или подпрограммах.

Одним из первоначальных предназначений Си было применение его вместо программирования на ассемблере в самых насущных задачах системного программирования. Когда проектировался Си++, были приняты меры, чтобы не ставить под угрозу успехи в этой области. Различие между Си и Си++ состоит в первую очередь в степени внимания, уделяемого типам и структурам. Си выразителен и снисходителен. Си++ еще более выразителен, но чтобы достичь этой выразительности, программист должен уделить больше внимания типам объектов. Когда известны типы объектов, компилятор может правильно обрабатывать выражения, тогда как в противном случае программисту пришлось бы задавать действия с мучительными подробностями. Знание типов объектов также позволяет компилятору обнаруживать ошибки, которые в противном случае остались бы до тестирования. Заметьте, что использование системы типов для того, чтобы получить проверку параметров функций, защитить данные от случайного искажения, задать новые операции и т.д., само по себе не увеличивает расходов по времени выполнения и памяти.

Particular attention paid to the development of C ++ structure, reflected in the increasing scale of programs written since the development of C. You can make a small program (less than 1000 lines) work with brute force, even breaking all the rules of good style. For large programs this is not the case. If a program with 10,000 lines is poorly structured, you will find that new errors appear as fast as old ones are removed. C ++ was designed in such a way as to make it possible to structure large programs in a reasonable way so that for one person it would not be excessive to cope with programs of 25,000 lines. There are programs of much larger sizes, but those that work in general, as it turns out, consist of a large number of almost independent parts, the size of each of which is much lower than the specified limits.

Naturally, the complexity of writing and supporting the program depends on the complexity of the development, and not simply on the number of lines of the program text, so that the exact numbers with which the previous considerations were expressed should not be taken too seriously.

Note on C ++ project

The essential criterion in the development of the language was simplicity. Where there was a choice between simplifying the language guide and other documentation and simplifying the compiler, the first one was chosen. Great importance was also given to compatibility with C, this prevented the removal of C syntax.

In C ++, there are no high-level data types and no high-level primary operations. It does not have, for example, a matrix type with a call operation or a string type with a concatenation operation. If the user needs such types, they can be defined in the language itself. In fact, the main thing that C ++ programming does is the definition of universal and specially applied types. A well-designed user-defined type differs from the built-in type only in the way it is defined, not in the way it is used.

Excluded those features that could entail additional costs of memory or runtime. For example, the thought of making storage of “economic” information in each object necessary, was rejected. If the user describes a structure consisting of two 16-bit values, then the structure will fit into a 32-bit register.

C ++ was designed for use in a rather traditional compilation and execution environment, a C programming environment on a UNIX system. Tools for handling special situations and parallel programming that require non-trivial loading and support during execution are not included in C ++. As a result, the C ++ implementation is very easily portable. However, there is every reason to use C ++ in an environment where there is much more substantial support. Tools such as dynamic loading, step-by-step translation and a database of type definitions can usefully be used without affecting the language.

CONCLUSION

The invention of the programming language of the highest level allowed us to communicate with the machine, to understand it (unless of course you know the language used), as the American understands the ancient Cyrillic alphabet, which is a little familiar with Russian. Simply put, we have, in our development of the science of programming, from the computer to YOU. Believe me, this is not sarcasm; you just see how the science of programming has evolved since programming languages ​​appeared, and after all, the highest level programming language seems to be still a baby. But if we pay attention to the growth rates and development of the newest technologies in the field of programming, it can be assumed that in the near future, human knowledge in this area will help to give birth to languages ​​that can receive, process and transmit information in the form of thoughts, words, sound or gesture. One would like to call it the brainchild of a computerized future: "programming languages ​​of the" highest "level." Perhaps the concept of solving this issue is simple, and the near future of this project is just around the corner, and at this moment, somewhere in Zaporozhye, Amsterdam, Tokyo or Jerusalem, a young, unrecognized specialist is bending over the old 133MHz and is developing the latest artificial intelligence system which will finally allow a person, with the help of their machine languages, to carry on a dialogue with the machine on YOU.

Reflecting on this, I want to believe in the progress of science and technology, in a highly-computerized future of mankind, as the only creature on the planet, even if it does not use one, certain spoken language, but is able to progress and develop its intellect so quickly that the transition from multilingual systems to general understanding do not have to wait long.

It would be nice to complete your work on such an optimistic note, but no, finally, I would like to quote a person whose work fragments, in the form of information about the C language, you already came across on the pages of this text:

The only way to learn a new programming language is to write programs on it.

See also

created: 2014-09-30
updated: 2024-11-14
377



Rating 9 of 10. count vote: 2
Are you satisfied?:



Comments


To leave a comment
If you have any suggestion, idea, thanks or comment, feel free to write. We really value feedback and are glad to hear your opinion.
To reply

Programming Languages and Methods / Translation Theory

Terms: Programming Languages and Methods / Translation Theory