So that the source code actually contains the text of its own compiler (parser)
The people do not understand. I will explain in more detail. Advise the ultra-high-level programming language (HQPPL), a program that could process and change its own code in COMPILE TIME
Let me give you a simple and contrived example to illustrate what the idea is.
For example, so that a language, for example, supports constructions like "if the call to the Tarl :: MySleep method (int, double) is present in the program code more than 3 times, then define the type MyType as a long double".
I repeat. The example is purely fictional and artificial, and serves purely to illustrate the idea.
In general, I need a PAU that would have the “iskoporeki”, which would allow to write programs that analyze and change their own code at the time of compilation (!!! Not at run-time). Those. so that the program is simultaneously a user extension of the compiler and the language.
Accordingly, it turns out that when you write a program in such a language, and change the TEXT of some part of it, the TEXT of other parts of the program may change when compiling with an automatic machine {that there is such a thing as a "preprocessor" I am aware of - but more serious and radical ones are needed BUILT-IN means language. Preprocessing tools (for example #IFDEF and macros with parameters in C ++) are not enough for me. It is necessary that the language include more advanced means of parsing and modifying its own source}.
Those. In the PAPSU, there must be operators whose operands are text objects in the source code itself.
Why did I call such a language a TOP-high language?
Well, because it is not the source code that is written on it, but the "source code source", so to speak.
Those. so that the source in the language is a mixture of compiler + application written in one language. And so that the source code "was dissolved" not the whole compiler, but only its extension for a given application.
If it’s completely simple, then you need a language that has a very powerful preprocessor, not limited to the banal IFDEF and parameter macros in almost all languages. So that the language was originally sharpened by the description of the source parsing in the source itself
class_evalin Ruby. Consider the code that writes itself at runtime. Here's an example: github.com/rails/rails/blob/master/activerecord/lib/… And according to Wikipedia, Ruby is a very high level programming language ( ru.wikipedia.org/wiki/… ), like HTML: D - Viktor