Websocket how? - page 8

 
Алексей Барбашин:

No, don't delete it, we'll still need it!

(All right!) Waiting for more instructions ))
 
Алексей Барбашин:

May I ask, as an adept at sharps? What is the point of using managed code over unmanaged code? Here, for example. Putting aside things like syntax and focusing on the benefits in principle.

 
Алексей Барбашин:

Well, few people write in "pure" language, and you use Sharp's libs, in the pros similarly. Well I don't insist on them, there is a compilable go, for example. I just really don't understand the need for this padding in the form of a virtual machine. I see the disadvantages, the benefits are somehow not observed. And even the offspring of the small makers, I would have gone for java better.

 
finished, all assembled without errors
 
Everything works
 
Алексей Барбашин:

It doesn't work that way. The mentioned material uses a different technology to integrate c# and mql. The above technology implements a library directly into the dll which creates a "layer" between managed and unmanaged code, otherwise sharp could not communicate with sql. But the developers did a great job and now sharp libraries can integrate into mql natively, you don't even need to declare procedure export, everything "fits" as native, as Fedor and I have shown. As for the structures, they need to be dealt with. According to what Fedor wants to do, we will need to return the data structures from the dll. Of course, we can get screwed up by mapping, but I really hope that everything will work out without any extra hassle.

I offered to check the example - it did not work, MQL5 does not see custom types

This is not about technology. MQL5 started supporting .Net "out of the box" in the second half of last year - everybody knows that ;)

Vict:

I just really don't understand the need for this padding in the form of a virtual machine. I see the disadvantages, I don't see the benefits somehow. And it's the brainchild of smallmacs, I'd rather go for java.

there are a lot of ready-made libraries.... some libraries use libraries on the plus side - .Net allows you to wrap a .dll in C++ into a single executable file

I make performance tests, and I read, C# is often near C++ speed (about 5-10% gain), so it's not twice as much as C++

Besides, C# is a very simple language, though up to certain level - the level where you took a ready-made package and attached user interface to it - literally, in 2 clicks, but to tune ready-made libraries, to connect them with other libraries - that's a full load)))

overall usability and speed of writing is a big plus, imho

SZZ: I will add Wolfram to C# next week - from experience I know that within a week I'll get the result I want.

 
Igor Makanu:

I've done performance tests and read, C# is often around C++ speed (about 5-10% gain), i.e. we are not talking about a twofold superiority of C++

Well, it depends upon how you count. For example, if we measure execution speed of some algorithm with one thread, we get nearly the same figures. But here we don't mention that N-number of cores were engaged in on-the-fly compilation, we say nothing about launching time and memory consumption. It is like with Elbrus, while one core is executing instructions, another core is busy with translation.

C# is a very simple language, but up to a certain level - up to the level of taking a ready-made package and adding a user interface to it, literally in 2 clicks,

Well, if you write a gui in pure winapi, maybe. But it could be simpler, isn't it hard to make a window with a button and a handler (fltk)?

#include <FL/Fl.H>
#include <FL/Fl_Window.H>
#include <FL/Fl_Button.H>
 
void
button_callback(Fl_Widget* o, void*)
{
        Fl_Button* button = (Fl_Button*) o;
        button->label("Уиииии!");
        button->redraw();
}
 
int
main()
{
        Fl_Window window(300, 200, "Тест.");
        window.begin();
                Fl_Button button(10, 150, 100, 30, "Нажми");
        window.end();
        button.callback(button_callback);
        window.show();
        return Fl::run();
}
 

Cool! Is the xml coming to us?


 
Алексей Барбашин:

Victor, no problem. Everyone has their own religion. But you try to implement the example we are creating now in C++ as an example. How much easier would it be to create it in C++? Implementation of websocket itself in C++ is a real mess.

It may sound like a pain in the ass, but there is a libwebsockets library out there.

I have a feeling, that often opinion about pluses is formed like this - person doesn't know how to connect ready-made libraries, saw classic example of C++ window on pure winapi, then sees Sharp with std-library for all occasions (which is bad in my opinion) and gets orgasm from it. And pluses in his view remain something very old and time consuming.

 
Put up