nanomsg / nng

nanomsg-next-generation -- light-weight brokerless messaging
https://nng.nanomsg.org
MIT License
3.63k stars 472 forks source link

How to create a new language binding using a binary/dll? #1820

Open spliffli opened 2 months ago

spliffli commented 2 months ago

Hello,

I want to create an NNG binding for the mql4 language, which is the scripting language for the forex trading software MetaTrader.

I couldn't find any specific information on how to do this in the NNG docs, but according to the orginal NanoMsg docs, it recommends forking a ZeroMQ binding if that exists for the language, and converting it into a NanoMsg binding. I'm assuming this approach would work for NNG as well.

There is a ZeroMQ binding for mql4 and I will most likely use that as a starting point.

That ZMQ binding uses the functions exposed in libzmq.dll, so my question is how can I achieve the same thing with NNG?

Should I compile it to a dll maybe? I don't really know, I've never attempted anything like this, nor do I have any experience with NNG at all, so any help or guidance would be much appreciated.

alawn-wang commented 1 month ago

I'm a trading system developer just like you, but i am not familiar with mql language just heared of MT4. I look through mql-zmq, I think create binding for mql just like JNI. you should convert the data in C to mql, and use the proper function-signature in mql. if you want to create a nng binding for mql, the best way is to consulting the author of mql-zmq. If you just want to create a low-latency trading system other than communication, use shared-memory is better than nng(no matter IPC or TCP is badly)