I've always taken the "knowledge" that MQL is a "compiled" language at face value. Someone in another forum is claiming that MQL is in fact encrypted and then interpreted. He makes a good argument for his case because you can take the following code and discard its source and the "compiled" program will still raise an array out of range error and point to the exact line number and character indentation (from the left hand margin in the editor) where the error is occurring. How is this possible if the file is in fact "compiled"?
Steps to reproduce:
Compile the following and discard the source file.
Once the source is deleted, run the "compiled" ex4. You will get the following:
How is this possible?
I don't believe that MQL is a compiled language. There must be an interpreter (MT) for running MQL code.
See a definition of interpreted language:
https://en.wikipedia.org/wiki/Interpreted_language
Compiled languages produce machine code and it can be executed by CPU (ex4 or ex5 can't be executed directly by CPU).
See a definition of compiled language:
I don't believe that MQL is a compiled language. There must be an interpreter (MT) for running MQL code.
See a definition of interpreted language:
https://en.wikipedia.org/wiki/Interpreted_language
Compiled languages produce machine code and it can be executed by CPU (ex4 or ex5 can't be executed directly by CPU).
See a definition of compiled language:
An interpreter takes one statement at a time and executes it. It does not scan all source beforehand, and it thus encounter an error only at runtime.
Mql4/5 are clearly compiled.
No, No.
An interpreter takes one statement at a time and executes it. It does not scan all source beforehand, and it thus encounter an error only at runtime.
Mql4/5 are clearly compiled.
I don't want to argue with you but I believe you're wrong. When MT "compiles" your code it just encrypts it and does (semantic) error checking. MT doesn't produce machine code. If you don't believe me then try to run "compiled" MQL code outside MT. I admit that the definition of compiled and interpreted languages is a little bit vague but I'm convinced that MQL is clearly interpreted language ;-)
Same here.
I know that machine code needn't be the output of compiling. But the output must be native code, byte code, C code or some other code that can usually be compiled into machine code. And machine code can be run directly in CPU. Where is such a output from MQL? MQL need for its running MT (its interpreter). You can keep your opinion and I will keep my own. Have a nice day.
Trying to access an element that doesn't exist will always give 'array out of range'.
But it wasn't the matter.
This is not a question of beleif. This is a fact. MQL5 is definitely a compiled language, producing native 32 and 64 bit code. You can find some posts about compilation on the russian forum, for example this one.
The main proof of the fact is that the speed of compiled mql5 program is very close to a compiled c++ program. This can't be for an interpreter.
Yes, the final output is encrypted, but this does not mean that compilation is somehow impossible.
As for the original question, I'm not sure I get the point. If you change the source code and do not recompile it, you'll get old error messages from the running old executable.
This is not a question of beleif. This is a fact. MQL5 is definitely a compiled language, producing native 32 and 64 bit code. You can find some posts about compilation on the russian forum, for example this one.
The main proof of the fact is that the speed of compiled mql5 program is very close to a compiled c++ program. This can't be for an interpreter.
Yes, the final output is encrypted, but this does not mean that compilation is somehow impossible.
As for the original question, I'm not sure I get the point. If you change the source code and do not recompile it, you'll get old error messages from the running old executable.

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
I've always taken the "knowledge" that MQL is a "compiled" language at face value. Someone in another forum is claiming that MQL is in fact encrypted and then interpreted. He makes a good argument for his case because you can take the following code and discard its source and the "compiled" program will still raise an array out of range error and point to the exact line number and character indentation (from the left hand margin in the editor) where the error is occurring. How is this possible if the file is in fact "compiled"?
Steps to reproduce:
Compile the following and discard the source file.
Once the source is deleted, run the "compiled" ex4. You will get the following:
How is this possible?