📜 ⬆️ ⬇️

Why the concept of bytecode is no longer as relevant as it was before


Introduction


Compiled languages ​​of an interpreted type are those programming languages ​​that are compiled into some kind of intermediate representation (sometimes referred to as " byte code "). The most striking example is the JVM (Java Virtual Machine).


This article sets out my thoughts about the concept of a virtual machine for programming languages ​​in current realities. In reality, where most services work on the Internet, and desktop programs are gradually being removed from production.


Causes


At the time of the birth of the World Wide Web, Java technology appeared, first promoting the use of a virtual machine as a runtime environment for high-level programming languages.


Sun Microsystems tried to combine the reliability and high speed of the compiled languages ​​with portability and ease of use of the interpreted. To some extent, the conceived idea was realized, because Java is still the most common technology in building high-loaded servers.


Among other things, one of the main requirements of the platform was put forward, which later became a slogan - "Compile once, run everywhere!" . This meant that the programmer only had to compile the source code into a so-called byte code that could be run on any system where the JVM was installed.


This was the driving force behind technology, throwing many languages ​​into the background. It was a kind of revolution in the world of digital computing, because before no one had managed to achieve a similar level of cross-platform. Now users can download the same version of the program to many operating systems and processor architectures, and be sure that it will certainly work exactly as it was intended by developers.


But times change, and technology with them. The World Wide Web is gaining more and more popularity, crowding out some things we are used to.


The era of remote services


"Why supply software to users if you can just make a website?" - This question was asked by large businessmen, which later resulted in a large-scale emigration of services to the World Wide Web. Standard desktop programs have begun to lose their popularity, because it is much easier and more efficient to make a simple (or not so) website.


Consequently, there is no need to download programs from the Internet as often. Open the site and perform the necessary actions much faster than downloading megabytes of binary data.


In the meantime, Java has gained popularity in building those sites, since nothing more convenient (to this day) existed at that time. Source files began to be compiled only for a specific server architecture, therefore, the principle "Compile once, run everywhere!" ceased to have its former meaning . Users stopped downloading programs, and developers began to compile only for a specific architecture.


Language evolution


Previously, compiled programming languages ​​had rather poor functionality of the standard library, which made it necessary to use a lot of platform-specific functions even for a simple application that doesn’t do anything supernatural.


Programming languages ​​also did not stand still, and languages ​​such as Rust and Golang , both compiled, came to the light, and both have standard and many third-party libraries that provide architecture and operating system independent functionality. In addition, the C / C ++ ecosystem was also not standing still.


As a result, it turned out that modern standard libraries and virtual machines perform the same role — they translate cross-platform code into platform-dependent functions.


Remaining part


Some may argue that the demand for desktop programs is still there. These are mostly closed programs intended for internal use in corporations, as well as a small number of commonly available applications.


In both cases, compiling for a hundred different platforms does not make sense, since in most cases only three well-known operating systems ( GNU / Linux , Microsoft Windows and Mac OS ) and one family of processor architectures ( x86 ) are used.


Conclusion


In total, we have slowing virtual machines (as bytecode execution environments) that have lost their main advantages due to the two factors above:


  1. The need to run the program on a hundred different architectures does not make sense, since most of the programs run on servers, and there are not that many user architectures and operating systems.
  2. Compiled languages ​​did not stand still, and their standard libraries acquired the necessary basic functionality for cross-platform code.

Discussions in the comments are welcome, I hope that the article prompted you to some thoughts about choosing the right language for your tasks.


Additions


As noted in the comments , the managed code has several advantages that are not available to the compiled code, including reflection and annotations.


')

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


All Articles