Comparison of performance programming languages

Programming languages ​​are used by developers to write specific sets of instructions to microprocessors that perform specific tasks. There are many kinds of languages. The engine, created by computerization pioneer Charles Babbage, became the forerunner of modern personal computers, or rather PC logic. In order for the developer to correctly select the instructions for writing the program, you will need to perform a competent comparison of programming languages. About this article!

The origins of programming languages

The origins of programming languages

In 1942, the ENIAC language was born when a computer idea swept the scientific world. It was a 30-ton monster that contained over 20,000 vacuum tubes and occupied 167 square meters of area. Programming was just as cumbersome. After the calculations were completed, it took weeks to decrypt ENIAC; the process of recovering data from the hard drive did not exist at all. There was only one "cipher", so it was not necessary to compare programming languages.

In 1945, Dr. John von Neumann, while working on his improvement, found that adding and saving converter code in programming significantly reduces the process time, so a new line of EDVAC appeared, which stands for Electronic Discrete Variable Automatic Computer. Unlike ENIAC, EDVAC used binary instead of decimal — a series of zeros and ones on punch cards supplied to the machine. Decimal is the first generation, binary is the second. Now developers have a formal basis for comparing programming languages. And also a choice.

Soon, the first elementary programming language was developed. The Conditional Short Code control transfer was invented in 1949. Unlike machine code, Short Code used logical operators such as “if”, “then” to define commands that were similar to mathematical statements, for example, if red means “THEN stop” or “IF 0”, then multiply on two.

"Compiler" was born in 1952. FORTRAN was the first third generation programming language created in 1957, followed by LISP, Algol in 1958, and COBOL in 1959. The third generation programming languages ​​used actual English words or syntax for binary or machine translation compilers. Which was pretty convenient. Comparison of programming languages ​​during this period was performed in favor of Algol or COBOL, depending on the technical power of the machine.

Algol or the "cipher" of algorithms lost to BNF Pascal in 1968. Each calculation could only happen with a specific sequence of code or function. Subsequent languages ​​improved the efficiency of coding programs using object-oriented programming, as well as scripting methods and syntax, creating highly structured C ++, Perl, and Java Visual Basic Widgets. Now there were several “ciphers”. During this period, developers had many criteria for comparing programming languages.

Types of encoding programs

Types of encoding programs

There are three types of clearly differentiated languages: machine, low and high level languages.

Assignment of software languages:

  1. A machine language that a computer directly understands using binary code, i.e. 0 and 1.
  2. Low-level languages ​​are much easier to use than machine languages, but are largely based on computers with machine language.
  3. High-level programming languages ​​are easier to learn because they use words or commands from a natural language, usually English, for example, the most famous Basic language.

Types of high-level languages, depending on the point of view of the work of programs and the philosophy of their creation, are divided into:

  1. Imperative, Cobol, Pascal, C and Ada.
  2. Declarative, Lisp and Prologue.
  3. Object Oriented, Smalltalk and C ++.
  4. Problem-oriented, specific languages ​​for management.
  5. Natural programming language, new types that seek to bring design and construction closer to the language of people. Make it easier.

Another high-level classification takes into account the development of computers and is used in the form of criteria for comparing programming languages:

  1. The first generation is machine and assembler.
  2. The second generation - the first programming languages ​​of a high imperative level FORTRAN, COBOL.
  3. The third generation is programming languages ​​of a high imperative level, but much more used and relevant at the present time: ALGOL 8, PL / I, PASCAL, MODULA.
  4. The fourth generation - in database management applications: NATURAL, SQL.
  5. Fifth generation - for artificial intelligence and natural language processing: LISP, PROLOG.

Comparison criteria. Principle

Comparison criteria

Comparing web programming languages ​​has never been a simple and objective task. Typically, ten evaluation criteria are considered.

List of criteria:

  1. Expressivity is the simplicity of a language for expressing algorithms.
  2. The accuracy of the definition is consistency and lack of ambiguity.
  3. Types and data structures.
  4. Modularity - the ability to develop components on their own.
  5. I / O - support for interaction with the environment.
  6. Portability.
  7. Efficiency and performance for comparing the performance of programming languages.
  8. Pedagogy - ease of learning and teaching.
  9. Generality - applicability, use.
  10. Standardization.

This list is used for comparison in a very wide range from LISP to COBOL via ALGOL and serves as a starting point for obtaining results.

High expressivity

High expressivity

The C language has always been highly expressive and potentially very economical, given the small number of keywords and the power of some operators. However, there is currently a need to support more complex structures in which a C implementation becomes unsafe.

Comparing the syntax of programming languages ​​is of great importance to developers. For example, C ++ provides a quantum leap over C, providing new useful features in a different context. For example, operator overloading gives the language remarkable expressiveness when implementing scientific and mathematical applications, the syntax of classes and objects allows convenient manipulation of various data structures and operations. Templates can be considered as macros of precompilers, but with a lot more functions. But all this is not exempt from errors caused mainly by maintaining compatibility with C at the stages of connection and execution.

As a result, C ++ is more expressive than C for medium and large applications, which is to be expected, since it was designed to cover more problems with the help of “multiple paradigms”. Comparison of C programming languages ​​with Java Delphi.

High expressivity

For its part, the second uses a syntax very similar to the C ++ language, although it excludes some of its darker functions. In particular, the removal of pointers did not make it more expressive, but much safer.

Aspects for Developers

Aspects for Developers

The C language has long been considered a good example of a consistent and unambiguous language, especially among contemporaries. The creators recognize certain shortcomings in the notation. The main problem is the large number of aspects offered to the developer, among which the size and data types stand out. For example, in 1980s PC compilers, the range of int types was between 32768 and 32767, which was a clear reflection of 16-bit processors. Currently, it is customary to accept 32-bit for integers, so the range often varies from -2147483648 to 2147483647. Obviously, this creates serious problems with language portability.

These shortcomings, unfortunately, are completely inherited by C ++, and today they do not have a clear solution. The Java language, was created from the very beginning with the aim of eliminating the ambiguities and dependencies of the implementer and its auxiliary classes, therefore it is currently the best of the popular languages.

Types and data structures

The C language provides mechanisms that are currently considered rudimentary for structured data types. Arrays allow you to specify homogeneous collections of fixed length at compile time and have a very close relationship when manipulating with pointers. A noticeable drawback is the lack of data types for representing strings that are unusually supported by character arrays.

Although this "minimalism" helps to improve performance or optimization during compilation, in many cases support for more complex types and related operations, such as vectors, lists, queues, and others, is required. In practice, there are several libraries that complement these aspects, for example, the popular Glib, but its programming is more time-consuming because it is not built into the language. The following example illustrates the creation of a dynamic array vector.

dynamic array vector creation

Typically, a programmer should avoid this kind of implementation from scratch. The following example solves the same problem using the Glib library.

Types and data structures

For its part, C ++ provides tools to create very powerful data structures that are tightly integrated into the language. Also, the developer can create his own types with various related operations.

Modularity and packaging levels

Modularity and packaging levels

Initially, this criterion related to the possibility of developing independent components that could eventually interact. In this sense, languages ​​allow you to develop functions, classes, and packages, each with its own conventions.

As regards the “packaging levels” of components, the C language in practice provides only two levels: visible components in the source code file and globally visible components, for example, functions and variables. In C ++, the concepts of “class” and “namespace” provide two additional levels of “packaging”, while in Java, equivalents correspond to classes and “packages”. The criterion of the input-output means determines the possibility of sequential, arbitrary and indexed access to the files that they possess. A link is also made to access database systems.

Access to database systems

Since “C” was and remains one of the most popular languages ​​used to develop medium and large systems, any application that provides a programming interface allows access through the C language. This is practically justified for all the most popular commercial and non-commercial databases with which C has unlimited access, although not the most convenient.

For its part, a program written in C ++ usually has the ability to use the C API. Many database systems provide an improved object-oriented interface available in this language.

The creators of Java, thanks to previous experience, have standardized an object-oriented interface for accessing any database in a portable way. This API is called Java Database Connectivity, and due to the great popularity of Java, almost all major database providers have created implementations of this interface, which contributes to portability in terms of access to them, while incompatibility and SQL extensions are preserved.

In this sense, Java has introduced a radical, albeit predictable, approach to developing a language that has virtually no executor-specific functions. The achieved portability is qualitatively superior to what can be obtained using the C / C ++ language, and is automatically performed by any developer. Therefore, if maximum mobility is needed at a "low cost", the choice is left to Java.

Comparison of productivity of programming languages

Comparison of productivity of programming languages

This aspect has always been of interest to developers and continues to be the subject of fierce debate. It is well known that almost all computers run programs through one or more central processors (CPUs), which contain the so-called “machine language” or “machine code”, consisting of a series of relatively elementary or very “low-level” operations. Such as writing bytes to memory, adding a pair of numbers, reading bytes from an external device, and others.

When talking about efficiency / productivity, it basically means comparing the speed of programming languages ​​with which programs are able to perform various tasks. And it is also necessary to consider the system resources necessary for its implementation.

All languages ​​must be “translated” at a certain point into a “machine language” for the programs being executed. To simplify, this process is called “compilation”, and both C and C ++ follow this scheme of “compiling” into the “machine language” of the processor. In particular, C has very simple data structures, which are a direct translation into “machine language”. In many cases, this simplicity makes the program productive.

Generality and standardization

In practice, C is usually used to create basic or low-level components, for example, the kernels of many operating systems, while C ++ and Java have a much wider range of commercial applications of all kinds. Java, thanks in large part to the foresight and publicity of Sun and the various "application server" providers, is now widely used in the context of web servers, servlets, and JSPs, often accompanied by a layered architecture.

C and C ++ are good examples of standardized, successful languages, which promotes open competition between implementations, without compromising portability. Unfortunately, there are no formal certification processes for them, and many developers simply ignore some features, which creates obvious flaws for programmers who want to work "in accordance with the standard."

Partly for this reason, Sun initially eliminated the use of a similar Java standardization mechanism (language and libraries), but then succumbed and follows up on it (Java Community Program.) In addition, Sun provides demanding certification tests so that developers can confirm and publish their adherence to standards.

Evolution and Update

C and its C99 library are still awaiting the full implementation of the update. The GNU GCC includes the vast majority of required features and one of the most stable languages ​​available.

C ++ continues its journey with the new C ++ 0x library-oriented update, including the GUI API. For its part, Java continues to make additions and improvements to the core libraries, as well as the core language, aimed at creating a modern and a very functional platform for various types of applications.

Library support

Given the continued constancy of use, both C and C ++ have an extremely wide range of library options for various purposes. In addition, the vast majority of new systems provide libraries that allow you to interact with programs written in these languages.

The only dubious aspect is that very few of them are standardized in the same way as language. For its part, C ++ has a more extensive library, which includes the “standard C library”, as well as the famous template library “STL”, which implements various data structures in a general form and many algorithms.

Java from the very beginning had a good policy of standardizing many libraries through classes and interfaces for a large number of aspects that were never considered in C or C ++, for example, such as a graphical interface, access to databases, web pages. This fact does not completely exclude the use of more specialized third-party libraries. The context of standardized libraries around Java is so wide that the Java platform is announced as a set of technologies designed for various types of applications.

The best programming languages ​​of 2018. Interactive

Best programming languages ​​2018

A comparison of the performance of programming languages ​​2018 can be obtained online at Spectrum.ieee. This app determines the current popularity of dozens of existing ones. You can filter them by excluding unnecessary sectors. 12 10 . , Dice API.

IEEE Spectrum, , , - . , « », « », 2014–2017 . IEEE Spectrum .

IEEE Spectrum "" 2018 . Python . , , , , . , .

Source: https://habr.com/ru/post/K7732/


All Articles