📜 ⬆️ ⬇️

And how else is it possible?

No, a detailed post to write me lazy. So, if suddenly someone sees something in my thoughts - plus, or minus, (the words are scary :). Sobsno what I mean: the question: why do we explain a couple of decades in different languages ​​to different processors HOW do we want to accomplish the task? And we do it millions of times, explaining to stupid processors on the set of programming languages ​​WHAT we want to get in the end. And the same tasks have already been solved millions of times.

Different frameworks of course solve common tasks quite simply, but in the end you have to solve the same simple tasks again and again. And then what for us computers in general, if we do everything ourselves? .. Maybe it's time to teach these devices, which we tamed, to make simple decisions on our own, and not to explain to them again and again what we want from them? In general, it’s rather a cry from the heart, to be honest, I’m already tired of writing programs in traditional programming languages, explaining trivial things to my favorite PC again and again: smart pointers, links, constant links, pointers, virtual functions, stack / dynamic memory. Why should I care about all this?

Take a simple task: parse the XML file and display all tag names on the screen. Solution options: infinitely many. You can use a lot of programming languages, you can write completely different code on each of them. The speed of these solutions: feel free to evaluate
may vary by 1-2-10 orders of magnitude. But the task is super simple, to achieve maximum efficiency you just need to correctly write a few lines (probably dozens of lines) of assembler code.
')
But that's not the point. How many, continuing the same example, written XML parsers? But the logic is the same there. And the same "grammar" is very much in common. And why not tell our favorite platform what XML is in essence. So that he knows what XML is, what it is eaten with, what it is not eaten with, etc. And if he received it at the entrance, he himself would convert it to the desired output, having received the task WHAT needs to be done and independently solving the HOW to do task.

Shl. XML is provided for a very rough and simple example, please do not touch the XML in kamentah :)
ZYY. The first post, do not judge strictly, I will correct, maybe :)

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


All Articles