Dynamic programming languages ​​Static and dynamic languages ​​and processors

Lecture



A dynamic language is such a programming language and such a translator that allow you to define data types and parse and translate "on the fly" directly at the execution stage.

Behind dynamic languages ​​is the future. They are more suitable for rapid application development than any other tool.

Dynamic languages ​​include: Basic, Perl, Tcl, Python, PHP, Ruby, Smalltalk, JavaScript.

Visual Basic also possesses some dynamic features, but due to its developers' neglect of the translator's intellectual potential, which was in classic BASIC and the excessive complexity of Visual Basiv, it largely became a static language.

The essence and future of the dynamism of languages ​​- and all languages ​​will inevitably come to this - is in the intellectuality of the translator. The dynamic language translator itself must complete the missing structures in the DDL component and be tolerant of programmer errors and program text failures (for example, perform the actions correctly when the script is not fully transmitted over the network). The latter, by the way, is able to make HTML processors of good browsers.

Programmers prefer to get rid of unnecessarily complex and outdated methods and seek to use approaches that simplify and speed up development. As a result, many of them increasingly prefer dynamic programming languages, such as JavaScript, Perl, Python, and Ruby.

Software experts have not come to a common definition of a dynamic language, however, in essence, such a language allows you to create programs that can change your code and logical structures at runtime, while adding different types, module names, classes and functions. Often these languages ​​are interpretable and, as a rule, they check types during execution.

Dynamic languages ​​are becoming an alternative to more widely used static languages, such as C ++ and Java. Programs written in static languages ​​contain unchanged code and logical structures, which remain so until the programmer modifies them. Static languages ​​for the most part are compiled. Typically, they involve type checking at compile time before the program starts.

A survey conducted by consulting company Tiobe Software, which compiled the index of the popularity of programming languages, showed that the most popular C, C ++ and Java languages ​​remain. However, the same survey suggests that the use of dynamic languages ​​is growing rapidly.

Developers increasingly prefer approaches that involve the use of dynamic languages. Among these approaches are AJAX (Asynchronous JavaScript and XML), LAMP, Linux; Apache web server; MySQL DBMS, as well as Perl, PHP or Python) and Ruby on Rails. In addition, large companies, including Microsoft and Sun Microsystems, support dynamic languages ​​in their development platforms.

Python author Guido van Rossum, currently working at Google with development-related research, emphasizes that dynamic languages ​​are more flexible than static languages ​​and allow developers to write more functionally rich code, and faster and easier. In addition, Karl Hove, a long-time Unix kernel development analyst, senior analyst at Blackfriars Communications, said many dynamic languages ​​are freely available, which gives them an additional advantage in the eyes of developers.

Typing in dynamic languages

Typification is the main, but not the only factor determining whether a language is dynamic.

In programming, the language type system determines the classification of similar values ​​and expressions, ways of working with them and their interaction with each other. As a rule, it assumes a description of the data structures that the language supports.

Most static languages ​​(but not always) support a strict and static type system. Dynamic languages, as a rule (but also not always), are weakly and dynamically typed. For example, some dynamic languages, such as Lisp, are strongly typed; Some static languages, such as C and C ++, are weakly typed.

Programs written in statically typed languages ​​explicitly declare (but do not necessarily define) variables before they are used. Many programmers like the structure, which requires the declaration of variables.

In programs created in dynamically typed languages, variables must be defined (but not explicitly declared) before using them. This eliminates the need to write too long code — many programmers like the ability to use a variable when it is needed, without having to pre-declare it.

Programming languages ​​in which specific data types are assigned to variables are considered strictly typed. In weakly typed languages, variables are not related to a specific type of data, which again allows for greater flexibility, but reduces the level of structuring of programs.

Advantages and disadvantages of static and dynamic languages

Strong typing provides for the existence of rules that determine what exactly a program can do with various elements during compilation when identifying and correcting errors associated with types.

Weak typing allows for some pre-specified exceptions to the rules for determining types or uses a type violation mechanism — usually for those cases when a specific deviation from the rule does not lead to program errors. Weak typing provides for the correction of errors associated with the types that will not lead to the appearance of exceptions during program execution.

This avoids the additional costs of correction during the compilation of those "errors" that will not cause problems in a particular program.

David Heinmeyer Hensson, co-author of 37signals, a Web application development company, noted that the use of all static typing rules in the development process can lead to unjustified delays in the execution of projects and their results.

Hove also believes that dynamic languages ​​allow developers to achieve results faster.

The code in these cases turns out to be more compact, since, for example, it does not contain mandatory declarations of variable types. This allows developers to effectively declare commands using a code of a small amount (rather than detailed, highly specific programming), which significantly speeds up the process of creating an application.

The ability to write code quickly and effectively saves programmers from detailed and repetitive work and allows them to focus on more creative tasks.

Historically, programs written in dynamic languages ​​worked more slowly than programs that use static languages, which is explained by the additional workload caused by additional checks during execution, which was a critical moment for ancient computers, but now has lost its relevance with the advent of ever faster processors and larger memory modules.

Greater flexibility

Since applications written in dynamic languages ​​do not need to explicitly declare variables and some other structural elements before using them, programs can define the types of variables, module names, classes and functions on the fly, thereby allowing programmers to act more flexibly.

However, this also means that dynamic languages ​​are not well suited for applications such as classical system programming, which requires static types and interfaces, especially when developing programs for microcontrollers.

However, in this area, everything can change radically after the development of appropriate optimizers for compiling and assembling executable modules.

When using dynamic languages, developers may not define the type of variable, interface, or abstract class, while in static languages ​​this is not allowed and is often considered a bad programming style. In some programs, however, all this may become necessary, since such a solution may be effective and not cause development problems.
  Dynamic programming languages ​​Static and dynamic languages ​​and processors

Dynamic Languages ​​Overview

Dynamic languages ​​are far from new. For example, BASIC, APL and Lisp were developed in the late 50s. Since then, many other languages ​​have emerged, including ABAP, Groovy, SAS, and Tcl; some of them, as the table shows, are becoming very popular.

JavaScript and ECMAScript

In 1995, Netscape Communications created a strongly typed JavaScript language, weakly associated with the Java language, which also supports strong typing. It can be embedded in the HTML code of a Web page, allowing you to add dynamic content that can respond to mouse movement and other user actions.

ECMAScript, approved by ISO and the European Organization for Standardization ECMA, is a cross-platform, general-purpose scripting language. It was created in order to combine the basic basic elements of JavaScript, and is comparable to Microsoft's Jscript.

Php

In 1995, programmer Rasmus Lerdorf proposed PHP, the most popular of dynamic languages, according to a Tiobe survey.

PHP (originally this name was decoded as a personal home page, “personal home page”) is a freely distributed server-side cross-platform object-oriented scripting language designed to create dynamic Web pages. Users add PHP code to the page's HTML code.

The PHP Data Objects extension defines simple and consistent interfaces for accessing various relational databases.

Zend Technologies, which manufactures PHP products and services, collaborates with Microsoft, which makes this language supported in the Windows operating system.

Perl

In 1987, Larry Wall introduced the Practical Extraction and Reporting Language ( www.perl.org ).

Perl is a Unix-based, freely available, interpretable server-side programming language designed for writing Web scripts. Originally created for word processing and manipulation, it is now actively used in Web forms. Developers use Perl for a variety of tasks, such as developing Web applications and a graphical user interface, and for network programming.

Perl supports procedural, object-oriented, and functional programming approaches, as well as automatic memory management.

Python

Van Rossum created Python ( www.python.org ) in 1990. It is a free, interpretable, object-oriented language with dynamic typing, similar to Perl. Python, which van Rossum named after the popular television show Monty Python's Flying Circus (Monte Python's Flying Circus), is easy to read and is known for its clear and simple syntax.

It is an easily portable language; Many operating systems, including Mac OS, Unix and Windows, can interpret its operators.

Python supports structured programming and has features that are used in functional and aspect-oriented programming. Using various extensions, Python supports other programming approaches.

Developers, including Google experts, use flexible Python to create various kinds of applications.

Ruby

Information Systems Specialist Yukihiro Matsumoto publicly introduced Ruby in 1995.

Ruby is similar to Perl and Smalltalk. This is a freely interpretable, fully object-oriented language. He is known for his clarity, accuracy, consistency, structure and extensibility. Ruby is easily transferred to various operating systems — Linux, Mac OS, Unix, and Windows.

Ruby can be used in extreme programming because it allows developers to write individual components of applications in other languages ​​that more closely meet the goals of the project.

Ruby supports dynamic typing and object-oriented, procedural, and functional programming.

Extended support

Created several increasingly popular development platforms that use dynamic languages. A number of major technology companies have added dynamic language support to their development environments. According to their calculations, this should arouse interest in such approaches among programmers.

LAMP. The LAMP platform ( www.lampware.org ) is designed to develop applications that require a flexible approach, primarily for the Web. For the last two years, it has become increasingly popular, since simple Web applications are needed by many. Recently, companies have begun using LAMP to develop more complex programs. In addition to LAMP, many similar packages appeared for various operating systems, including cross-platform assemblies.

AJAX. The set of AJAX technologies, proposed mainly in the 90s, allows you to create Web-based applications that work better than traditional Web-programs and, moreover, outwardly and in their operation are more similar to desktop software. The disadvantages of AJAX are the poor indexability of search robots and the lack of tolerance for errors and failures.

Seaside. The Seaside platform ( www.seaside.st ), released in 2004, is an AJAX-like wrapper for creating Web applications using the dynamic language Smalltalk.

Ruby on Rails. The Ruby language is the foundation of the Ruby on Rails platform, which is growing in popularity because it is free and easy to use. The Rails platform uses integrated programming packages and ready-made code, called conventions (convention). Hensson created it so that it was complete and did not require any pre-configuration. Supporters of Rails believe that this platform is better suited for creating infrastructures that transfer information from a database to a web application. Such solutions are used in e-commerce, online communities and for data extraction.

Eclipse Foundation. The Eclipse Foundation, a nonprofit organization that develops the Eclipse development platform, which is written in Java, adds a PHP-integrated development environment to it.

Microsoft. Microsoft supports dynamic languages ​​such as Iron Python, JScript and PHP and provides for their use, for example, in the common language runtime (CLR) environment in the .NET platform. This environment controls the execution of programs written in any of the supported languages.

At the same time, Microsoft offers on its CodePlex jointly developed portal the Phalanger compiler. This compiler allows PHP scripts to work in .NET without any changes.

Sun. “Of the three components of the Java platform — the virtual machine, application programming interfaces, and language — it is possible to replace the language,” said Tim Bray, director of Web Microsystems at Sun Microsystems. He noted that Sun intends to implement in Java support for various languages, including dynamic ones.

The company currently supports JavaScript on its Java platforms and through the NetBeans integrated development environment. Recently, according to Bray, Sun hired specialists to create a Java-based Ruby implementation called JRuby.

Bray, like many other industry analysts and programmers, believes that dynamic languages ​​will continue to evolve, while their popularity and support will grow. Bray admits that many dynamic languages ​​lack the tools or performance needed to create large-scale software. However, he believes that some of the features that give them flexibility gradually penetrate into corporate languages, such as Java, and endow them with new features.

created: 2014-09-30
updated: 2021-03-13
132679



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