Algorithmic languages of low and high level. Lecture: High-level programming languages. Comparative characteristics Comparative analysis of high-level algorithmic languages
Object Oriented Programming
Object-oriented programming is a programming technique in which a program is viewed as a set of discrete objects containing, in turn, sets of data structures and procedures that interact with other objects.
Pascal, Visual Basic Java
From the point of view of programming principles, programming languages can be divided into 3 groups: procedural, functional and logical
The basis of all programming languages are procedural languages, since at the heart of the computer ( CPU) at the lowest level is the ability to execute only primitive instructions that explicitly tell the processor what to do. Other types of languages can be thought of as add-ons to procedural programming languages. These languages (functional and logical) contain and implement certain mathematical models that allow more efficient programming of some specific types of tasks. But translators (compilers), libraries and other tools of these programming languages are still implemented through procedural programming languages.
Procedural programming languages
The program consists of a sequence of imperative commands (explicitly specifying what transformations to perform on the data). The data is stored as variables.
Logic programming languages
Programming languages of this type are based on formal logic and Boolean algebra. The program does not contain explicit algorithms. A description of the conditions of the problem and logical relationships is given, according to which the programming system builds an inference tree and finds solutions to the problem.
Functional programming languages
Functional programming is based on the use of lists and functions. Variables may not exist at all.
An example of a procedural language is the Pascal programming language. Prolog is a logical programming language and Lisp is a functional programming language.
Programs in logical and functional programming languages have relatively low performance due to the complexity of implementation.
Low-level languages (machine code and assembler) are procedural programming languages in principle. But, these are languages of such a low level that the term “procedural” does not even fit them. Rather, it is better to call them imperative programming languages.
Most modern procedural programming languages are developing in the direction of object-oriented programming.
Object Oriented Programming
Variables and functions are grouped into objects and classes. This achieves a higher level of structuring and abstraction of the program. Some objects (classes) can be generated from other objects (classes). Object-oriented languages have concepts such as inheritance, polymorphism, and late binding.
Language takes a special place Java programming. This is due to 2 of its excellent properties. Firstly, the implementation of this language is not tied to a specific architecture of a computing device (computer, mobile phone and so on) and a specific operating system. Program for Java language is translated into intermediate code that can be executed on any machine running the Java Virtual Machine. To port a Java program to new type computer, there is no need to rewrite the compiler for the Java language and other development tools. Moreover, there is no need to have the source code of Java programs and recompile them. It is enough to rewrite a virtual Java machine for a new computer architecture and run Java applications on it in an intermediate code that is the same for any computer architectures.
Secondly, Java can be used not only to develop standard programs, but also special types of applications, the so-called applets and servlets, which are naturally embedded in Internet applications (HTML pages and Web servers). This gives Java a very high degree of autonomy and makes it the programming language of the future. Java is a procedural, object-oriented programming language.
Parallel programming languages stand out separately from procedural programming languages. These languages are designed to create programs that can more fully exploit the potential of multiprocessor computers. A program in a parallel programming language describes several processes that are independently executed each on its own processor and exchange data at the right time. An example of a low-level programming language for transputers ( special kind parallel computers) is the Occam programming language. An example of a high-level programming language with support for concurrency is the Modula-2 programming language. Apparently, parallel programming languages are becoming a thing of the past and their functions of parallelizing programs are implemented either at the level of processors (multi-core processors), or these functions are taken over by operating systems.
Script (tagged)-declarative programming languages
AT recent times tagged languages for describing various data structures, mainly related to the transmission of information over the Internet, have become widespread. One of these languages is XML - a tagged language for describing tree structures with attributes, used in the construction various types documents. XML is gradually replacing HTML, MS Word files and PDF files are built on its basis. To transform XML files, for example, to reformat it according to a new template, the XSLT tag language was developed again. The structure of the XSL file (XSLT Transformation File) is fully compliant with the XML specification. At its core, XSLT is a functional programming language.
In the Pascal language, as in most programming languages, there are tools that allow you to design an auxiliary algorithm as a subroutine. This is necessary when a subalgorithm is repeatedly repeated in the program or it is possible to use some fragments of previously developed algorithms. In addition, subroutines are used to break large programs into separate semantic parts in accordance with the modular principle in programming.
To use a subalgorithm as a subroutine, it must be given a name and describe the algorithm according to the rules of the Pascal language. In the future, if necessary, call it in the program, make the subroutine call a mention in right place the name of the corresponding subalgorithm with a list of input and output data. Such a mention leads to the execution of the statements included in the subroutine, working with the specified data. After the subroutine is executed, work continues with the instruction immediately following the subroutine call.
There are two types of subprograms in Pascal - procedures and functions.
Procedures and functions are placed in the description section of the program. For the exchange of information between procedures and functions and other blocks of the program, there is a mechanism input and output parameters. The input parameters are the values that are passed from the calling block to the subroutine (the input data for the subroutine), and the output parameters are those that are transferred from the subroutine to the calling block (the results of the subroutine).
The same subroutine can be called repeatedly, performing the same actions with different sets of input data. The parameters used when writing the text of a subroutine in the description section are called formal, and those that are used when calling it - actual.
The procedure description format is:
procedure procedure name (formal parameters); procedure description section begin executable part of the procedure end;
Function description format:
function function name (formal parameters):result type; function description section begin executable part of the function end;
In functions, you can declare your own variables, these variables are called local, that is, they can only be used in the function in which they are declared.
When the function exits, they are destroyed.
If you declare a variable outside of any functions (such variables are called global), then it can be used in all functions without declaration.
Data structures define the classification of data and relationships between them. Structures can be simple (elementary) or complex (composite). There are the following structures: constant, variable, array, record and table. A constant and a variable can be considered elementary data, single, indivisible elements of more complex data organization systems.
Constant- this is a number, text or logical value that does not change in the process of implementing an algorithm, solving a problem on a computer.
Variable- This is a unit of data organization, which in the process of processing information can be assigned different values. A variable has a name - an identifier and a type: numeric, symbolic (letter, string), logical. Variables may be accompanied by words indicating their type.
Array - this is a set of elements of the same type united by one name (array identifier). The main parameters of arrays include its type (numerical, symbolic, logical), dimension (one-dimensional, two-dimensional, etc.) and size (the number of array elements in each dimension).
recursion- this is such an organization of the algorithm, in which the procedure refers to itself. The procedure itself is called recursive.
Classification and characteristics of software
The program controls the operation of the computer. All computer programs that are stored in its external memory form software(ON).
Software | |||||
system software | application software | ||||
Operating Systems | Utilities | Programming systems | general purpose | Specialized programs | Professional programs |
loaded in RAM and organizes the execution of other programs, interacts with the computer | system program– optimizes disk storage, protects against viruses, etc. | designed to create new programs | text tables, graphics, music, database management | expert systems, hypertext, multimedia | AISU - automation Information system management, CAD system computer-aided design, Educational systems, Geoinformation search engines |
Windows, UNIX, Linux, Hummingbird, etc | BASIC, Pascal, Delphi, | Notepad, Word, Excel, Paint, Sound Forge, Access | "1C-enterprise", "Compass" - for drawing, |
annotation. The relevance of the study is explained by the importance of obtaining high-quality forecasts of the main financial indicators in the conditions current trends, as well as the successful experience of using neural networks in forecasting tasks, which can be done by choosing the right programming language. This actualizes the purpose of this article - a comparative analysis of programming languages.
Keywords: programming language, programming environment, tools.
Existing programming languages are designed to solve a fairly narrow range of tasks. Language cannot be a panacea good qualities for some tasks (or people) may be bad for others.
A programming language (Basic, Pascal) should be distinguished from its implementation, which is usually presented as part of a programming environment (Quick Basic, Virtual Pascal) - a set of tools for editing source texts, generating executable code, debugging, managing projects, etc. The syntax and semantics of a programming language is fixed in the language standard. Each programming environment provides its own interpreter or compiler from this language, which often allows the use of constructs that are not fixed in the standard.
The goal for the implementation of which the language is chosen is essential - either for teaching programming, or for solving a specific applied problem. In the first case, the language should be easy to understand, strict and, if possible, devoid of "pitfalls". In the second - albeit a complex, but effective and expressive tool for a professional.
Of course, in practice, learning cannot be separated from real tasks. The so-called educational tasks most often suffer from excessive abstraction and inapplicability in life. Mastering a language (or programming environment) in itself cannot be considered a task, more precisely, it is a very unproductive approach. Effective language acquisition is possible only on real examples. On the other hand, programming a solution to a full-fledged problem “from life” at the initial stage of language acquisition turns out to be an unbearable burden that can scare away, rather than interest.
When solving a specific applied problem, in most cases, the programming language and environment are not chosen, but are set from the outside - by the customer, manager, etc. In the same rare case when a choice is possible, in my opinion, it follows from the following conditions (in order of priority):
a) the nature of the task itself and the technical requirements;
b) developed tools and libraries available for this environment;
c) tools available in the language and programming environment.
Often, with such a choice, they do exactly the opposite: first they decide that they will program on objects, then that a specific library will be used, and then they adjust the technical requirements for this, explaining all this by the fact that the customer “does not know what he wants”.
The applicability of a language for a particular task depends on what set of concepts a professional operates on, what concepts (paradigms) it allows to work within, what standard and common user libraries are available, etc.
According to the set of concepts, languages are divided into high- and low-level languages. The first provide a high level of abstraction from the hardware, the second - a low level, close to the machine.
From the point of view of whether special, domain-specific objects are included in the set of concepts, languages are divided into universal(procedural) and specialized. The latter include Prolog, Lisp. Universal languages allow you to implement any algorithm using a standard set of constructs. Due to this, the code in such a language can be rather easily transferred from one procedural language to another with the help of conservative changes.
Here are the main concepts introduced into certain commonly used languages and related concepts: typing and data structures. Any language is characterized by a set of basic types, the ability to replenish this set with the help of a number of constructors: array, record (structure), union. Some languages have a generic type (Variant in Delphi and Visual Basic) that can be freely used as any of the base types. The degree of type control can be very different - from complete absence to extremely rigid. It is important to have (perhaps in the form of a library) data structures of variable length, such as dynamic arrays.
Differences in languages come down to the way procedures and functions are defined, options for passing parameters, the ability to define recursive procedures, and the presence of a procedural data type.
The presence and broad classification of memory types makes it possible to effectively manage its distribution, but also introduces complexity that requires a more careful attitude from the programmer. Usually allocate (maximum spectrum): registers, global, local and dynamic variables.
The availability of means for logically combining a group of procedures, functions, variables allows you to work with large projects, simplifying their structure. An important property is the ability to describe the procedures for initiating and terminating a module.
The combination of structures and methods for their processing (encapsulation) creates significant convenience in programming. The possibility of inheritance allows you to bring a set of structures into the system. Automatically called constructors and destructors make it easy to keep track of relationships. All this constitutes handy tool to describe the concepts and actions of an application program.
Hardware independence, implemented with machine-independent semantics and the introduction of a number of specific concepts into the language, such as a base type with a non-fixed size (int in C) .
From the point of view of efficiency, it is important how the program is executed - by consistent interpretation source code (interpreter) or direct execution finished code (compiler). It is advisable to use the interpreter only in the case when the speed of interpretation does not greatly affect the efficiency of the program. In addition to interpretation and compilation, intermediate options are possible with the generation pseudocode, which differs from the original text by a high interpretation speed or other useful properties (for example, the ability to execute on machines of various architectures - like Java).
Let's consider popular languages and software environments from the point of view of adaptability to various classes of tasks.
Born in the 1960s in America, BASIC was conceived as a simple language to learn quickly. BASIC has become the de facto standard for microcomputers precisely because of its simplicity both in mastering and in implementation. However, to achieve this quality, a number of decisions were made (lack of typing, line numbering and non-structural GOTO, etc.), which negatively affect the style of students of programming. In addition, the disadvantage means of expression led to the emergence of a huge number of dialects of the language that are not compatible with each other. Modern, specialized versions of BASIC (such as Visual Basic), despite the acquired "structurality", have all the same shortcomings, first of all - carelessness in relation to types and descriptions. It is suitable for use at the initial stage of training, as an automation tool (in cases when it is built into appropriate systems) or as a tool for quickly creating applications.
Developed by the famous theorist N. Wirth based on the ideas of Algol-68, Pascal was intended primarily for teaching programming. Built on the principle of "necessary and sufficient", it has strong type control, constructs for describing arbitrary data structures, a small but sufficient set of structured programming operators. Unfortunately, reverse side Simplicity and rigor is the cumbersomeness of descriptions of language constructs. The most famous implementation - Turbo / Borland Pascal - despite the differences from the Pascal standard, is an environment and a set of libraries that have made the educational language industrial system for developing programs in the MS −DOS environment.
The brightest representative of low-level languages is Assembler, whose set of concepts is based on hardware implementation. It is an automation tool for programming directly in processor codes. Machine commands are described in the form of mnemonic operations, which makes it possible to achieve a sufficiently high code modifiability. Since the set of instructions on different processors is different, there is no need to talk about compatibility. Using an assembler is useful in cases where you need to interact directly with the hardware, or get more efficiency for some part of the program due to greater control over code generation.
After a long struggle on the Windows front, Borland moved into the enterprise systems market. Delphi is not the successor of Borland Pascal / Borland C, its niche is the so-called. quick creation applications (Rapid Application Developing, RAD). Such tools allow you to create a working program from ready-made components in the shortest possible time, without wasting a lot of effort on trifles. A special place in such systems is occupied by the possibility of working with databases.
As a prime example of specialization, the Java language was born in response to the need for an ideally portable language that could run programs efficiently on the WWW client side. Due to the nature of the environment, Java can be good choice for a system built on Internet/Intranet technology.
At the heart of the C language are requirements system programmer: full and efficient access to all computer resources, programming tools high level, portability of programs between different platforms and operating systems. C++, while maintaining compatibility with C, brings the possibilities of object-oriented programming by expressing the idea of a class (object) as a user-defined type. Thanks to these qualities, C / C ++ has taken the position of a universal language for any task. But its use can become inefficient where it is required to get a ready-to-use result in the shortest possible time, or where the procedural approach itself becomes unprofitable.
To implement the project of building a neural network model for predicting time series of financial data based on a multilayer perceptron trained using the backpropagation algorithm (as well as formalizing complete scheme application of this model for the analysis and forecasting of time series on the example of stock quotes of Russian issuers on the MICEX), the C ++ Builder 2010 development environment was chosen, since it combines the functionality and good speed work of programs made in C ++, and also allow you to quickly create a working program from ready-made components, without wasting a lot of effort on trifles.
Hardware and operating systems are changing. New problems arise from a variety of subject areas. The past is gone and new languages are emerging. But people remain - those who write and those for whom they write new programs and whose quality requirements remain the same regardless of these changes.
- Jarrod Holingworth, Bob Swart, Mark Cashman, Paul Gustavson Borland C++ Builder 6 Developer's Guide = Borland C++ Builder 6 Developer's Guide. - M .: "Williams", 2004. - S. 976.
- Vik Kurilovich Visual Basic. - Publishing house "Solon-Press", 2006, -S. 384.
- Andreeva T. A. Programming in Pascal. − Publisher: Internet University information technologies, Binom. Knowledge Laboratory, 2006 - P. 240.
- Pilshchikov V. N. Assembler. IBM assembly language programming. - PC Publisher: Dialogue-MEPhI, 2005 - S. 288.
- Zhelonkin A. Fundamentals of programming in the DELPHI integrated environment. − Publisher: Binom. Knowledge Laboratory, 2004 - P. 240.
- Joshua Bloch Java. Effective programming Effective Java. Programming Language Guide - Series: Java Publisher: Lori, 2002 - P. 224.
- Lafore R. Object-Oriented Programming in C++ Object-Oriented Programming in C++ − Publisher: Piter, 2011
Classification of programming languages.
There are various classifications of programming languages.
According to the most common classification, all programming languages, in accordance with the terms in which it is necessary to describe the task, are divided into languages low and high level.
If a language is close to a natural programming language, then it is called a high-level language; if it is closer to machine commands, it is called a low-level language.
To language group low level includes machine languages and symbolic coding languages: Autocode, Assembler. The operators of this language are the same machine instructions, but written in mnemonic codes, and not specific addresses, but symbolic names are used as operands. All low-level languages are focused on a certain type of computer, that is, they are machine-dependent.
Machine-Oriented Languages- these are languages, sets of operators and visual means of which significantly depend on the features of the computer (internal language, memory structure, etc.).
To programming languages high level refer Fortran(formula translator - was developed in the mid-50s by IBM programmers and is mainly used for programs that perform natural scientific and mathematical calculations), ALGOL, cobol(commercial language - used primarily for programming economic tasks), Pascal, BASIC(was developed by Darmouth College professors John Kemeny and Thomas Kurtz.), Xi(Dennis Ritch - 1972) Prologue(the language is based on the apparatus of mathematical logic), etc.
These languages machine independent, because they are focused not on the system of commands of a particular computer, but on the system of operands characteristic of writing a certain class of algorithms. However, programs written in high-level languages take up more memory and run slower than programs written in machine languages.
The computer does not understand a program written in a high-level programming language, since only machine language is available to it. Therefore, to translate a program from a programming language into a machine code language, one uses special programs- translators.
There are three types of translator: interpreters(this is a translator that performs operator-by-operator processing and execution of the source code of the program), compilers(converts the entire program into a machine language module, after which the program is written to the computer's memory and only then executed) and assemblers(translate a program written in assembly language into a program in machine language).
Programming languages can also be divided into generations:
– first generation languages: machine-oriented with manual memory management on first-generation computers.
– second generation languages: with a mnemonic representation of commands, the so-called autocodes.
– third generation languages: general purpose, used to create application programs of any type. For example, BASIC, Cobol, C and Pascal.
– fourth generation languages: advanced, designed to create special application programs for managing databases.
– fifth generation programming languages Key words: declarative, object-oriented and visual languages. For example, Prolog, LISP (used to build programs using artificial intelligence methods), C++, Visual Basic, Delphi.
Programming languages can also be classified into procedural and non-procedural.
In procedural languages the program explicitly describes the actions to be performed, and the result is specified only by the method of obtaining it using some procedure, which is a certain sequence of actions.
Among the procedural languages are in turn structural and operational languages. In structural languages, whole algorithmic structures are written with one operator: branches, loops, etc. In operational languages, several operations are used for this. The following structural languages are widespread: Pascal, C, Ada, PL/1. Fortran, BASIC, Fokal are known among operating rooms.
Non-procedural (declarative) programming appeared in the early 70s of the 20th century, non-procedural programming includes functional and logical languages.
In functional languages the program describes the calculation of some function. Usually this function is given as a composition of other, simpler ones, which in turn are divided into even more simple tasks etc. One of the main elements of functional languages is recursion. There is no assignment operator and loops in classical functional languages.
In logical languages the program does not describe actions at all. It defines the data and the relationships between them. After that, the system can be asked questions. The machine goes through the known and given data in the program and finds the answer to the question. The iteration order is not described in the program, but is implicitly set by the language itself. Prolog is considered the classic logic programming language. A Prolog program contains a set of predicates-statements that form a problem-oriented database and rules that look like conditions.
One more class of programming languages can be distinguished - high-level object-oriented languages. Such languages do not describe a detailed sequence of actions for solving a problem, although they contain elements of procedural programming. Object-oriented languages, thanks to a rich user interface, offer a person to solve a problem in a form convenient for him.
The first object-oriented programming language, Simula, was created in the 1960s by Nygaard and Dahl.
Java Internet programming language that allows you to create secure, portable, reliable, object-oriented interactive programs. The Java language is tightly connected to the Internet, because the first serious program written in this language was the World Wide Web browser.
Recently, when talking about programming on the Internet, they often mean the creation of publications using a markup language. hypertext documents HTML. The use of special tools (HTML editors) allows not only creating separate dynamically changing interactive HTML documents using multimedia data, but also editing entire sites.
Programming language is an artificial language. It differs from natural language in a limited number of words, the meanings of which are clear to the translator, and in very strict rules for writing commands or operators. The combination of these requirements is language syntax. And the meaning of each command and other language constructs is its semantics. Violation of the program notation form leads to the issuance by the translator of a message about syntax error, but correctly written, but not corresponding to the algorithm, the use of commands leads to semantic errors.(to log. osh) The process of searching for errors in the program is called testing, and the elimination process is debugging.
translator.
Compiler Interpret. They immediately take operators from the program text, analyze its structure and then immediately execute it. Only after successful execution of the current statement, the interpreter will move on to the next one. Moreover, if the same statement is repeated many times, the interpreter each time analyzes it as in the first one. With the help of the interpreter, you can stop the program at any time, examine the contents of memory, organize a dialogue with the user, that is, the interpreter is useful as a tool for learning programming. In real programming systems, compilation and interpretation technologies are combined. Ex: In the process of debugging a program, you can step by step to get non-object code for debugging.
There are 3 stages:
compilation - creation of an object file *.obj
Connecting with USES
Programming language specific type of processor low level programming language That is, the language operators are focused on specific processor instructions (Assembler is the lowest level, it represents each machine code instruction using a mnemonic symbol) Unambiguous transformation of one machine instruction into one assembly instruction is called transliteration. Such languages are used to write system applications, drivers and docking modules with non-standard equipment.
High-level programming languages are much closer and more understandable to humans than to computers. The peculiarity of architectures is not taken into account, => programs in these languages can be transferred to other platforms where there are translators.
Generations:
I 50x 1st assembly language, made according to the principle of 1 line 1 instruction. (non-symbolic)
II to the 50s Symbolic assembler, the concept of a variable was introduced (it gives a relative address), we can say the first full-fledged programming language.
III 60s High-level languages Fortran, Basic, Pascal, etc. have gone. The productivity of the programmer has increased dramatically.
VI early. 70s The period of languages intended for the implementation of large projects, to increase the speed of reliability, continues. -Problem-oriented languages, languages focused on large special tasks (narrow special area). Powerful operators are built into them, allowing you to write complex functionality (DBMS) in one line.
V since the 90s, visual languages have been created as a system for the automatic development of application programs using visual development tools. Ideally, visual aids that non-programmers can use. Two aspects 1 - use of visual components, 2 - coding.
Programming system:
Includes everything you need to create and debug programs
text editor
compiler (translation from high code to machine code) common compatible extension *.obj
link editor - linker (Link).
The source code of the program consists of several modules, each of which is compiled into separate files, these object files are combined into a single whole, in addition, machine codes of subroutines that implement standard functions are added, they are contained in the standard libraries supplied with the compiler, a subroutine that has these codes (system.tpu - in Pascal). The linker (linker) collects the program together, including all programmed programs and standard subroutines, calculates the real addresses.
All associations are performed in the required format (the format is set by the type of OS), the result is a file with the extension *.exe, it is placed in real RAM memory, only then can the executable file be launched. The result of the linker's work is a load module with *.exe, *.com extensions.
Availability of libraries of standard functions.
The programming system must have a debugger - execution of the program step by step, observing how the value of the variable changes.
Programming language levels:
Languages are close to our conversation, docking with some non-standard equipment is required. To make the program take up little memory and run time, be faster, then they turn to assembly.
Fortran is purely an engineering language. Programs are very compact. Language used professionally only
CABOL – accounting language is English. Rus. Versions
Algol (68) - was intended to replace Fotran, but due to the complexity of the distribution structure, it did not receive
Pascal - took the ideas of Algol, tightened the requirements for program structure
C - originally developed as a mass and planned to replace asm, has additional facilities
C++ - object-oriented extension of C
Java - created on the basis of C ++. Tried to exclude low-level features from C++. Feature - compilation not into machine code, but into platform-independent byte code.
Programming languages for the Internet - html, perl, vrml
Visual skins:
Basic - 1st place in popularity in the world was created for learning.Microsoft Visual Basic
Pascal - Delphi - popular for working with Borland Delphi database
Html, perl, php - for the web
C++ Borland C++ Builder
Java Symantec Cafe(cell phones, household appliances)
2. Translators: purpose, classification, examples. Stages of passing programs on a computer
Translator: compiler and interpreter. To get a working program, the text must be translated into machine code; for this, they turn to the translator program, which is called translator.
Compiler- Gets the object code. These are programs that process the entire program text, i.e. source. First, it scans the text in search of syntax errors, then some semantic analysis is performed, after which the text is automatically translated or translated into machine language. Often, when generating machine code, optimization is performed using a set of methods to increase the speed of the program. As a result, the complete program, which is called object code, is compact and efficient and can be transferred to other computers with a processor that supports the corresponding machine code. Interpret. They immediately take statements from the text of the program, analyze its structure and then immediately execute it. Only after successful execution of the current statement, the interpreter will move on to the next one. Moreover, if the same statement is repeated many times, the interpreter each time analyzes it as in the first one. With the help of the interpreter, you can stop the program at any time, examine the contents of memory, organize a dialogue with the user, that is, the interpreter is useful as a tool for learning programming. In real programming systems, compilation and interpretation technologies are combined. Ex: in the process of debugging a program, it can be done in steps. to get non-object code for debugging.
There are 3 stages:
The source code of the Pascal program must be saved in a file with the .pas extension. This file is processed by the compiler, and the result is object code, automatically saved in a file with the extension .tpu (turbo Pascal unit), the program is processed by the linker - a load module is obtained, automatically saved in a file with the extension .exe. Then the program goes to execution (in the process, the initial data can be connected), then we get the results.
compilation - creation of an object file *.obj, *.tpu
linking - creates an executable file *.exe
execution - the result formed by the stages
After compilation in Delphi, we get the *.dcu extension - a static library
Connecting with USES
Programming language- this is a system of notation that serves to accurately describe programs or algorithms for a computer. Programming languages are artificial languages. They differ from natural languages in a limited number of “words” and very strict rules for writing commands (operators). Therefore, when applied as intended, they do not allow free interpretation of expressions characteristic of natural language.
basic. It was developed in 1963 by Dartmouth College professors Thomas Kurtz and John Kemeny. The language was intended for teaching programming and has become widespread in the form of various dialects, primarily as a language for home computers. The following eight were used in the design of the language principles: 1. Be easy to use for beginners 2. Be a general-purpose programming language 3. Provide extensibility for experienced programmers 4. Be interactive 5. Provide clear error messages 6. Run fast on small programs 7. Do not require understanding of the operation hardware 8.Protect the user from operating system. The language was based partly on Fortran II and partly on Algol-60, with additions to make it suitable for time-sharing and, later, text processing and matrix arithmetic. The syntax of the language is similar to Fortran, and many elements are explicit borrowings from it. The language was conceived for learning, so its designs are as simple as possible. As in other programming languages, keywords taken from of English language. There are two basic data types: strings and numbers. Declaring variables does not require a special section (unlike, for example, Pascal). Declaring a variable is the first use of it.
C Sharp - C#(pronounced si sharp) is an object-oriented programming language. It was developed in 1998-2001 by a group of engineers led by Anders Hejlsberg at Microsoft as an application development language for the Microsoft.NET Framework. C# belongs to a family of languages with C-like syntax, of which its syntax is closest to C++ and Java. The language is statically typed, supports polymorphism, operator overloading (including explicit and implicit type casting operators), delegates, attributes, events, properties, generic types and methods, iterators, anonymous functions with closure support, LINQ, exceptions, comments in XML format. Having adopted a lot from their predecessors - C++, Java, Delphi. C#, based on the practice of using them, excludes some models that have proven to be problematic in development software systems, for example, C# does not support multiple class inheritance (unlike C++).
C++ programming language - compiled statically typed general purpose programming language. It supports different programming paradigms, but, in comparison with its predecessor, the C language, the greatest attention is paid to supporting object-oriented and generic programming. The name "C++" comes from C, in which the unary operator ++ denotes the increment of a variable. In the 1990s, the language became one of the most widely used general-purpose programming languages. When creating C++, they tried to maintain compatibility with the C language. Most C programs will work properly with a C++ compiler as well. C++ has a syntax based on C syntax.
Advantages C++ is an extremely powerful language that provides tools for creating efficient programs for almost any purpose, from low-level utilities and drivers to complex software systems for the most varied purposes. In particular: High compatibility with the C language, allowing the use of all existing C code (C code can be compiled with minimal rework by a C ++ compiler; libraries written in C can usually be called directly from C ++ without any additional costs, including at the callback level, allowing libraries written in C to call code written in C++). Various programming styles and technologies are supported, including traditional directive programming, OOP, generic programming, metaprogramming (templates, macros). It is possible to work at a low level with memory, addresses, ports. Ability to create generic containers and algorithms for different types data, their specialization and calculations at the compilation stage using templates. Cross-platform. Compilers are available for a large number of platforms, programs are developed in C ++ for a wide variety of platforms and systems. Efficiency. The language is designed to give the programmer maximum control over all aspects of program structure and execution. Flaws Some of the shortcomings of C++ are inherited from the ancestor language - C - and are caused by the initially set requirement of the greatest possible compatibility with C. These are disadvantages such as: Error provoking syntax: The C-derived preprocessor is very primitive. Poor support for modularity (in fact, in classical C, there is no modularity at the language level, its provision is shifted to the linker). Including the interface of an external module through preprocessor insertion of a header file (#include) seriously slows down compilation when a large number of modules are included (because the resulting file that is processed by the compiler turns out to be very large).
Pascal. The Pascal language, which appeared in 1972, was named after the great French mathematician of the 17th century, the inventor of the world's first arithmetic machine, Blaise Pascal. This language was created by the Swiss computer scientist Niklaus Wirth as a language for teaching programming methods. Pascal is a general purpose programming language. The features of the language are strict typing and the availability of structural (procedural) programming tools. Pascal was one of the first such languages. According to N. Wirth, the language should contribute to the discipline of programming, therefore, along with strong typing, possible syntactic ambiguities are minimized in Pascal, and the syntax itself is intuitive even at the first acquaintance with the language. The Pascal language teaches not only how to write a program correctly, but also how to correctly develop a method for solving a problem, choose ways to represent and organize the data used in the problem. Since 1983, the Pascal language has been introduced into the computer science courses of high schools in the United States.
Delphi programming language (Delphi)- a development environment that uses the Delphi programming language (starting from version 7, the language in the environment is called Delphi, formerly Object Pascal), developed by Borland and originally implemented in its Borland Delphi package, from which it received its current name in 2003. Object Pascal - essentially a successor Pascal language with object-oriented extensions. Delphi provides visual design user interface, has a developed object-oriented language Object Pascal(later renamed Delphi) and database access tools that are unique in their simplicity and power. The Delphi language has significantly surpassed Basic language and even in some ways the C++ language, but at the same time it turned out to be very reliable and easy to learn (especially in comparison with the C++ language). As a result, the Delphi environment made it easy for programmers to create their own components and build professional programs from them.
Java is an object-oriented programming language developed by Sun Microsystems on May 23, 1995. Java programs are translated into bytecode executable virtual machine Java (JVM) is a program that processes byte code and passes instructions to the hardware as an interpreter. The advantage of this way of executing programs is the complete independence of the bytecode from the operating system and hardware, which allows you to run Java applications on any device for which there is a corresponding virtual machine. Another important feature of Java technology is a flexible security system due to the fact that the execution of the program is completely controlled by the virtual machine. Any operation that exceeds the program's set permissions (such as attempting unauthorized access to data or connecting to another computer) causes an immediate abort. Often to shortcomings The concept of a virtual machine refers to the fact that the execution of bytecode by a virtual machine can reduce the performance of programs and algorithms implemented in the Java language. Recently, a number of improvements have been made that have slightly increased the speed of executing programs in Java: the use of technology for translating bytecode into machine code directly during program operation (JIT technology) with the ability to save class versions in machine code, the widespread use of platform-oriented code (native code) in standard libraries, hardware that provides accelerated bytecode processing (for example, Jazelle technology, supported by some ARM processors).
Key features: automatic memory management; advanced options for handling exceptions; a rich set of input / output filtering tools; a set of standard collections such as an array, list, stack, etc.; Availability simple means creating network applications (including using the RMI protocol); built-in language tools for creating multi-threaded applications; parallel execution of programs.
Thus, in our time there are many languages, and each of them has its own characteristics.