Jump to content
  • Advertisement
Awoken

different language servers talking via zeroMQ

Recommended Posts

Posted (edited)

Is it possible?
For instance, could I write my path-finding functions in a more powerful language than JavaScript and use it as a back-end server and then have my Node.js server request 'path' info from it and then the front-end Node.js server would use that data.  I guess like multiple concurrent servers written in languages that are better suited for the specifics of the server's task?

Edited by Awoken

Share this post


Link to post
Share on other sites
Advertisement

ZeroMQ is a messaging protocol and a network library. If you have a ZeroMQ library for JavaScript, and a ZeroMQ library for some other language, then yes, those systems can send messages to each other.

Is this a good idea? In my experience, no. You'll want as much of your code as possible in a single language (or at least "single environment") because otherwise you have to keep two copies of all the important data structures, and keep them in sync, Plus you end up with two vector math libraries, two collision testing implementations, two database client libraries, and so on, and they will differ in implementation in ways that will cause ongoing confusion.

This is why Microsoft built the CLR as a "runtime for many lanaugages" -- you can use the same data structures defined in C# for a program written in F#, or Visual Basic.NET, or C++/CLR. Oracle was late to the party with JVM languages; most of the languages that "target the JVM" are third-party languages (Scala, Kotlin, Clojure) but they do have some of the same benefits where you can import functions and data structures across languages.

Anyway: Yes, the benefit of network protocols, is that you don't need to know what the specific implementation is on the other side of the protocol. The draw-back of network protocols is that all involved parties need to implement them the same, or subtle (or not-so-subtle) bugs will ensue.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!