First, I apologize for the long post. I asked a few questions about haxe and its suitability as a tool to solve the problem I am facing. I have very limited knowledge of haxe, but what I know is my ideal role for haxe in my project, this is not normal use of haxe. So I try to avoid wasting time, I do not learn this language (despite the fact that it looks very fun and powerful), only to understand that it is not suitable for the purpose. Therefore, I hope to receive recommendations from experienced veterinarians about whether this is suitable for the purpose. I really hope so.
Here is what I am trying to achieve:
I work in the gaming industry, and I need to create a game in both C ++ and JS. C ++ for the embedded system and JS for online and mobile devices. I am very experienced in both C ++ and JS.
The games that I develop, I only want to write once. Now I could use something like emscripten to migrate from C ++ to JS, but this will lead to compiled JS code that cannot be debugged using the chrome dev tools. I have converted that I will encounter errors as a last resort with compiled JS, which I cannot easily revert back to the original C ++. In addition, some platforms for the game will require equity labs to view the source code, which will be a problem for compiled JS.
I really need a source for the source compiler, which creates its own readable C ++ and JS code, which I can then process and modify in my native form, if necessary, therefore, haxe. I looked at the code created by haxe for C ++ and JS. JS looks very easy to understand and work. C ++ is not much, but still pretty much acceptable. I can even stop haxe from compiling and binding C ++, which I don't need. I only need the source code.
So far so good.
Now I have a game environment in C ++ that uses the 2d oxygen engine. It is capable of displaying sprites, etc., as well as the structure that I created for messages and state machines (it also loads more useful classes). I also have a similar structure in JS that uses Pixijs for its 2d engine and has its own message bus and so on, like the C ++ engine.
Now what I want to do is write the modules in haxe, which, when I pass both C ++ and JS, that the code can be included as part of the structure and work with its respected language engine. Every object that I create in haxe will be very encapsulated and you just need to subscribe to the message bus, process the messages and send messages back. In addition, you may need to know how to use your engine machine. Therefore, I have no idea whether this is possible with haxe, since the message bus (along with other objects) will not be written to haxe, but will be provided to the module after it is full and built in my own project. Maybe I can write my own haxe library that knows the syntax for my two game engines and can be broadcast depending on its target language? Not sure if this is possible.
Thank you for taking the time to read and any tips you can give.