Features of the mql5 language, subtleties and tricks - page 154

 
Roman:

Although translated into byte-code, Java has its own virtual execution machine (JVM).
Also the language is strictly typed, unlike other languages with an interpreter.
Most likely, strict typing and JVM is the reason for fast execution and transmission of instructions to the hardware.
The American trading terminals are written in Java for a reason. The CME Group in Chicago officially provides a terminal which is written in Java.
A programmer once told me that Java has its roots in telecommunications.
And the telecom industry, from the beginning, requires speed in processing and transmitting data.
And Oracle has its own community for the development of this language.
So the language is alive and well, and is being refined by the Oracle community.

Incidentally, the Quik brand and the LUA language were also developed by the Americans.
But in the shaggy 90s, it was successfully sold to the Russian Federation.
Back in those years, the Americans already realised that LUA had no future development.
And they successfully sold it to the Russian Federation, where an exchange market had just begun to form after the collapse of the Soviet Union.

Igor Makanu:

The model there is the same as in .Net - the source code is compiled into bytecode, this will also be the interpreter, and unpacking the bytecode on a given PC will already generate native code for the virtual environment in which it will be executed, i.e. it will already be compiled code

https://habr.com/ru/post/107585/

google "java compiler or interpreter" for Java - there will be similar articles

Thank you.
I'm basically aware of all that, but I just didn't expect to see such a big difference between Java and MQL5 (three times as much in favour of Java):

Perhaps graphics is not the best subject for comparison. But there's only one maths there.

Files:
gravity.zip  3 kb
 
Vict:

Have you ever wondered how much startup time it takes? How much memory is eaten and how many threads the JVM runs to compile bytes of code? I ran a monster that compiled hello world on the fly, and it ended up with both natives. Except C monster doesn't have one. And about python.


It's ok to buy a multi-core numeric cobbler with a carload of RAM and say that my java/sharp/... ...are very cool in this test, and keep quiet about the overall load. They will never catch up with C. Progress, take tetris from the 80s, rewrite it in sharpe, and race as fast as before, but with a 60 core CPU)).

ZS: akin to how two threads in Elbrus are only involved in translating from x86 instructions. BELAZ (Belarus): a parcel.

C and Java are, for a reason, two equal leaders in the programming language rankings.

You may be right to some extent, but you seem to be behind the times.
Admittedly, I too have only recently realised how far behind I was when I started studying to become a programmer.
I thought I knew a lot, but with the establishment of new neural connections, my self-esteem plummeted.

 
Nikolai Semko:

Thank you.
I'm basically aware of all that, but I just didn't expect to see such a big difference between Java and MQL5 (three times in favour of Java):

Graphics may not be the best subject for comparison. But there is only one mathematics there.

What do you expect from MQL5? You can't get the device context, so you draw using emulation software on charts.



Alexey Navoykov:
By the way, as for Sharp, it looks like they made it possible to directly compile into native code. I haven't tried it yet, but it should be cool.

Love the hubr, especially for the commentshttps://habr.com/ru/company/microsoft/blog/265889/

https://docs.microsoft.com/ru-ru/dotnet/framework/net-native/

 
Igor Makanu:

What do you expect from MQL5? You can't get the device context, can you? So you draw using software emulation on charts


I don't think this is the case.

I think that the context is bound when executing

ObjectCreate(chart_id,name,OBJ_BITMAP_LABEL,subwin,0,0)
 
Nikolai Semko:

C and Java are, for good reason, the two equal leaders in the programming language rankings.

You may be right in some respects, but you seem to be behind the times.
Admittedly, I, too, have only recently realized how far behind I was when I started studying programming.
I thought I knew a lot, but with the establishment of new neural connections, my self-esteem plummeted.

Maybe. Von sharp is moving Microsoft, its windows store (here comes the compilation into nativ), it's fashionable after all. We need to do as a herd.

 
Igor Makanu:

The model there is the same as in .Net - the source code is compiled into bytecode, this will also be the interpreter, and unpacking the bytecode on a given PC will already generate native code for the virtual environment in which it will be executed, i.e. it will already be compiled code

https://habr.com/ru/post/107585/


about Java google "java compiler or interpreter" - there will be similar articles

geez, Igor this article is from 2010. A lot has changed in 9 years.

 
Nikolai Semko:

Geez, Igor, this article is from 2010. A lot has changed in 9 years.

Who's to say that things change, you can't even see the Borland compilers anymore, and 10 years ago they were all sitting on them on the runet ))))

i was never interested in java, maybe on 4pd when they had a phone in java

but the waythey work, both .Net andJava were alike, and portability between platforms was assured by pre-compilation at run-time.

 
Igor Makanu:

Who's to say that things change, you can't even see Borland compilers anymore, 10 years ago everyone on the runet was using them ))))

I mean the principles, I have never been interested in Java, maybe on 4pd when they had a phone in Java

But the waythey work is that both .Net andJava were alike and the pre-compilation at run-time made them portable across platforms.

Yes it feels like concepts like interpreter and compiler have diffused into each other.
 
Nikolai Semko:

Thank you.
I am aware of that, but I just did not expect to see such a big difference between Java and MQL5 (three times more in favor of Java):

Graphics may not be the best subject for comparison. But there's some maths involved.

a little misleading. In MQL code at every frame called very expensive ChartChanged() function. Without it, the Java gain would not be 3, but 2 times.

If the MQL code does the same thing (also 8 cents of gravity), but without arrays, the speed in Java and MQL5 will be equal.


I noticed for a long time that MQL5 is not friendly with array access. Access to an array element is disproportionately expensive. I think the developers have some things to work on.

Files:
Swirl.mq5  12 kb
 

Found an interesting study from two years ago comparing the effectiveness of different languages

https://greenlab.di.uminho.pt/wp-content/uploads/2017/09/paperSLE.pdf