What is framework and runtime?

Nowhere did I find a clear definition of these two concepts.

I understand the framework as a platform that is necessary for any applications to work. For example, a set of dynamically linked libraries for several applications is already a framework. The Java Runtime Environment (including the JVM) also fits this definition. However, what is runtime? On the one hand, this is just a phase of the program execution. On the other hand, there are a bunch of terms like runtime libraries, runtime system... What Microsoft puts into this concept is also unclear. Please explain!

Author: yanpas, 2016-02-02

2 answers

The difference between the library and the framework is small, but it is fundamental. If your code just uses the functions of a module, then this module is most likely a library. But if the module forces you to write the code as it wants and calls it itself, then this is already a framework. But the module itself is a set of source files (sometimes already compiled).

Runtime is a part of the code that exists in an executable file (or in separate so / dlls) and provides all sorts of "convenience". For example, find out the type object or make the same virtual calls. It is usually added by the compiler and the average user may not even know about it. Also, the word runtime refers to the time when the program is running. What exactly is meant-you need to keep track of the context.

Runtime libraries are libraries that are used while the program is running. Sometimes libraries are delivered in two forms - for development and for normal work (the latter are often optimized and unnecessary things are thrown out of them). Good an example is the dll files of delphi. For the same component, there may be libraries that contain all sorts of tools for the IDE, and there are those that are only for code performance.

JRE is not a framework, it is a runtime library. Although on the other hand, it is a framework for bytecode. But since only special perverts squeak on the bytecode, this is not a framework for an ordinary programmer. But all of java is one solid framework:)

 9
Author: KoVadim, 2016-02-02 13:13:22

I would like to add a little to the answer given earlier.

  1. Framework vs Library. Both are a set of some utilities and functionality, but the fundamental difference is in the Inversion Of Control. Let me explain: imagine a console application in which you ask the user for some data, and then perform calculations and give the result. In the course of calculations, you can use, for example, a library of mathematical functions, but you YOU ask YOURSELF the course and structure of the program, and the functions from the library are simply used as needed. In frameworks, there is an inversion of control, i.e. the course of the program is determined by the FRAMEWORK, and you need to fill in certain empty spaces with your code (for example, write a controller in MVC frameworks).
  2. Runtime. By "runtime " you most likely mean auxiliary programs that are used when executing the main programs via a specific API. For example, the browser's JS engine uses an event loop and uses different APIs (for example, XMLHttpRequest) to get additional features that don't apply to JS itself. These APIs are essentially runtime, which extend the capabilities and help you execute the script code. At the same time, from the outside, interacting with the API, it may seem that these features seem to belong to JS itself or are calls to some library functions, although in fact they can be implemented in general, they are not related to JS in any other way.
 3
Author: curveball, 2018-03-01 19:59:43