Interpreter MSH

MSH interpreter


I bring to your attention my vision of an ideal language. In my previous articles, I already set forth my idea of ​​the ideal language From MUMPS to MSH Features and differences of the MSH programming language from MUMPS .

The reviews were mostly negative. After reading the reviews, I was surprised to find that everything in the world of programming languages ​​is already very perfect. But vague suspicions gnaw me that everything is not so good in this world. Of course, there are already a lot of languages, but a variety of language concepts is not observed.

If we discard the minor embellishments of languages, then there are several such concepts.

  • Object programming
  • Data management, typing.
  • Passing a variable number of parameters to procedures and functions.
  • Management of the execution process.

From the solution of these problems the properties of a programming language are added up.

Object programming


In my opinion this is an important concept and it must be present in the language. Of course, even if the language does not have classes and objects, then nothing prevents you from thinking and writing programs in the object style, but still, the presence of such mechanisms makes it possible to simplify this task.

Data management, typing


I consider this section the most important in the concept of language. I met a lot of discussions on this subject on Habré. Mostly argued for static and dynamic typing. In dynamic typing, the advantage was called the flexibility of the language, but the disadvantage is supposedly the unreliability of the language and poor adaptability to development environments. In static typing, everything is exactly the opposite. I consider the arguments about the best reliability of languages ​​with static typing to be absurd, it is possible that static typing helps in the development of programming tools, but nothing more. I am not a supporter of either approach. I consider typing as such the main evil of modern programming languages. Although it is present in the vast majority of programming languages. The language must completely take over all data management, including deal with their types. Which is quite real. And the programmer must deal with the logic of the program. If you need to check the data, then typing will not help. They just need to be checked for content. I can explain the presence of typification only by tradition and inertness of thinking.

Passing a variable number of parameters to procedures and functions


This is a minor problem, but it is difficult to solve by most languages. Although a great example exists in Assembler. Passing parameters through the stack. You just need to abandon the list of formal parameters, and pass parameters through a list. It is not entirely clear to me to return a variable number of function values ​​for what and how to use it. In any case, one entity must be returned.

Process management


This section I also consider to be crucial for the concept of language. The control constructs of languages ​​are almost identical. Small nuances arise using the goto command. I don’t understand why they are fighting this team with such frenzy. A very convenient command, especially if the argument of this command can be calculated. In the implementation of parallel computing, variants of the variant are mainly 2. Either they are implemented by means of libraries, or they can be included in the language itself. I am a supporter of the second method.

Languages ​​lack event handling. Although it is widely used. To build a GUI, to implement event processing, the main loop is launched. This solution does not shine with elegance. To get inside such a cycle is another problem. A normal language should have an event handling facility.

My ideas are of course subjective, and perhaps even incorrect. But they are based on my personal experience. A modern OS is a bunch of junk that is not debugged, which will never be debugged. Pile of APIs, various libraries from which errors are streaming. The number of programming languages ​​has exceeded all possible limits. Moreover, in principle they differ little from each other. And generally I will not say anything about the number of frameworks. Any even the average system is a multi-layer cake from various, possibly poorly compatible subsystems, the full debugging of which will never be performed. Debugging a simple C program can take months. And all this in my opinion is generated by typing in programming languages.

At the moment, there is no language that meets my ideas about the correct programming language. The closest to it in my opinion is the MUMPS programming language, but there is no implementation of such a language as a programming language. There are database implementations in which this language is used as a language. The limitations of this approach are obvious, which made me develop a new MSH language and write its implementation as an interpreter. At the moment, not everything that I am going to do is implemented in it. In particular, there is no development environment, but you can get an idea of ​​the language.

The implementation is made for Linux x64.

Who is interested in my work, write to the mail, I will send the distribution.
PS.
MSH is not only a typeless language, it is non-declarative. In principle, there are no variable descriptions in it. In the general case, a variable has not only a type, but also a structure. Arrays, lists, HASH, stacks, and a declaration is required to describe each of the structures. In MUMPS, there are no such declaration languages ​​in principle; any variable is a tree. No space for such a tree is reserved. A tree node is created at the time of writing data to it, and only such nodes exist in which the recording was made. There are no restrictions on the type of index. Therefore, comparing MUMPS with PHP, Java Script, and other languages ​​is incorrect. MUMPS is a separate world, with its own problems and advantages. To understand it, you need to rebuild thinking. It is impossible to understand MUMPS by reading abusive reviews. We must immerse ourselves in it. Read the documentation. Install the MUMPS system. Work on it. The fact that they don’t understand me here is quite natural. We are talking about different worlds. In the world of MUMPS there are no discussions that we are conducting here about types, structures. Few of the MUMPSists are interested in how and where their data is stored. Any data in MUMPS always has two representations: a number and a string. And depending on the operation, this or that representation is taken. I always know the exact result depending on the operation that I applied. MUMPS forces the programmer to work in terms of a tree. Trees can be located both on external media: globals (analogue of databases), and in memory: locales (analogue of variables in programs). Basically, when designing an information system, I directly work with data on a disk of intermediate local data, I have a minimum and they do not create any problems for me. Therefore, at MUMPS forums you will not find discussions about the types of variables of their localizations. A typical design method is to design input trees, weekends. And then, as necessary, you write programs to form input and output trees. Data in MUMPS is primary, and programs are secondary. With my articles, I aim to introduce as many programmers as possible to this other world of MUMPS. I think this world is more correct. I admire these simple, powerful and elegant language. It gives me pleasure to write on it. To my deep regret, I have little to do this. I want to create a language in which everything can be written without going beyond the limits of this language. Write a server, write a Desktop client, add a language to browsers. A typical design method is to design input trees, weekends. And then, as necessary, you write programs to form input and output trees. Data in MUMPS is primary, and programs are secondary. With my articles, I aim to introduce as many programmers as possible to this other world of MUMPS. I think this world is more correct. I admire these simple, powerful and elegant language. It gives me pleasure to write on it. To my deep regret, I have little to do this. I want to create a language in which everything can be written without going beyond the limits of this language. Write a server, write a Desktop client, add a language to browsers. A typical design method is to design input trees, weekends. And then, as necessary, you write programs to form input and output trees. Data in MUMPS is primary, and programs are secondary. With my articles, I aim to introduce as many programmers as possible to this other world of MUMPS. I think this world is more correct. I admire these simple, powerful and elegant language. It gives me pleasure to write on it. To my deep regret, I have little to do this. I want to create a language in which everything can be written without going beyond the limits of this language. Write a server, write a Desktop client, add a language to browsers. and the programs are secondary. With my articles, I aim to introduce as many programmers as possible to this other world of MUMPS. I think this world is more correct. I admire these simple, powerful and elegant language. It gives me pleasure to write on it. To my deep regret, I have little to do this. I want to create a language in which everything can be written without going beyond the limits of this language. Write a server, write a Desktop client, add a language to browsers. and the programs are secondary. With my articles, I aim to introduce as many programmers as possible to this other world of MUMPS. I think this world is more correct. I admire these simple, powerful and elegant language. It gives me pleasure to write on it. To my deep regret, I have little to do this. I want to create a language in which everything can be written without going beyond the limits of this language. Write a server, write a Desktop client, add a language to browsers. without going beyond that language. Write a server, write a Desktop client, add a language to browsers. without going beyond that language. Write a server, write a Desktop client, add a language to browsers.

Also popular now: