Why are most programming languages ​​built on top of frameworks?

As programming languages ​​continue to evolve, we see that these programming languages ​​are located on top of frameworks such as Java or .NET, which is good.

What do you think are the best reasons to create a language on top of the framework?

Disclaimer: I'm not trying to prove something, I thought it was a good topic for discussion

+4
source share
7 answers

In a word: reuse.

Frames are large collections of classes, methods, etc., such as libraries. Unlike libraries, they also apply rules, so to speak, that define programming standards.

+5
source

If you have ever programmed COM objects manually (ATL is even worse) or written programs in C using the Win32 API, you will easily realize that .NET is good. This is a modernization of secret complex techniques with a certain lack of organization.

I cannot agree with you: with the notable exception of C # and Java, languages ​​are not tied to any "infrastructure". Frames are just a huge collection of libraries, as well as a philosophy, like every huge library. For me, this is just a word for marketing purposes. You can call .NET a "standard window library", for example.

Is the POSIX API the foundation? Is the Python library collection the foundation? Is the standard C ++ or Boost library the foundation? Is Qt the foundation? Is BLAS / LAPACK the foundation? Intel Threading Building blocks the framework?

The world does not revolve around .NET or Java.

+5
source

It is better to have one universal standard that is well written and well tested than for every programmer to reinvent the wheel once and again. The number of string classes written around the world prior to the likes of MFC CString and Java / .net String classes was just ridiculous.

+4
source

Perhaps because:

If I see further, he stands on the shoulder of the giants.

Not to mention the existing thriving community, many libraries, etc .:-)

+1
source


I am happy to be the first people who disagree with the “one foundation for all” approach. I believe that engineers should use the right tools (available) to solve the problem. Believe me, this is a good word, since each approach / methodology of software development has a large number of "believers", followed by a significant number of pessimists :)

But returning to the question ... I see two main drawbacks of the wireframe approach:

1) It may be excess Sometimes you just need a simple solution for a simple task. You do not need a tool that solves / communicates with solutions to all the problems of mankind.

2) "If you do not use you, you are against us"
The fact is that it is impossible to create a large, mature structure of optimal / simple / adequate solutions for all the problems that she is trying to solve. So sometimes you need to enter an external tool. This can be a pain in ... For example, calling Qt signals from streams other than qt does not work out of the box (this did not work at all). In this case, you may encounter a card. Instead of making your life easier, you can do serious damage to yourself / other people :)

One of the reasons for the two previous points is that it is really hard not to make assumptions. Frames are often used under many assumptions that the programmer will execute / use the A / B component, C ... standard / framework. As soon as hard-coded assumptions are introduced, the likelihood that the structure will be modular falls from the piano from the 10th floor :)

On the other hand, the “right tool for solving problems” approach allows the programmer to focus on one problem and implement it well. I say well:
1) Agnostic data For example (C ++), if you work with strings, do not accept the string type. Allow the user to work with different strings from different frameworks: QString, wxString, std :: string ...
2) Agnostic / extensible policy
The programmer may like the general way to implement any framework, but it may seem that one tiny aspect makes the framework unsuitable for him. That is why the framework user should be able to present their own policies in some key parts.
An example of family sharing with this approach is the internal / external implementation of DSL (Domain Specific Language). A concrete example (C ++) is the Blitz ++ library.

Everything I said earlier also applies to high-level languages. For example, there may be languages ​​created in the Java virtual machine (Scalla for starters).

Hope I made some good points. Best wishes,
Marcin

+1
source

Perhaps I misunderstand the question, but .NET is not built on top of the framework. In fact, it is the other way around. Frames often expand languages ​​as languages ​​become more powerful, and they often come in the same package as language compilers. However, there are also domain languages that are built on top of the existing structure and existing language. Technically, these are not languages, but rather a scripting API. The C # .NET and VB.NET language specifications have not really changed so much, with the exception of optional parameters, named arguments, co / contra variance, and several others. This is the framework around them that recently gave us expressions, linq, etc.

EDIT 1: If we don't look at virtual machines such as the JVM framework, then I can see how this could be true.

EDIT 2: Having understood the question, the answer is simple. This is portability (from the point of view of compilation into an intermediate language when you are dealing with Java or .NET environments) and the ability to use the capabilities of the platform.

+1
source

Because these structures provide reusable components that are required for any high-level language implementation: FFI, GC, JIT, linker, debugger, and the rest of the tool chain. And it’s not funny to reinstall all these components from scratch.

0
source

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


All Articles