Code Distribution

Monkey Forums/Monkey Programming/Code Distribution

blabz(Posted 2013) [#1]
I've had this thought for awhile and would love input and perspective on the topic.

One of the potential strengths monkey has is the ability to code once and port to various languages. Mark's intent was allow games to be deployed across various platforms.

The other *potential* strength it has is the ability to write code and utilities for game developers of various other languages. This is what I would like to do with monkey, but there's an issue that really stands out.

The code you write is tightly coupled into Monkey's architecture for your game.

Lets say I want to create a particle system with OpenGL ES and want to expose the command "CreateParticleSystem," I would first have to Convert it to the language I want to distribute it to, then create a command set within that language that exposes the commands in a more usable manner.

What are your thoughts on doing this with monkey? Are there workarounds? How would you suggest distributing your code for use in other languages?

DISCLAIMER: I've only explored monkey and haven't used it for a project yet as I'm finishing my current project with BlitzMAX.

All input appreciated!
Thanks!


AdamRedwoods(Posted 2013) [#2]
You can do this, but my opinion is that it is easier to stay in the original language.

The easy way in Monkey is to not import mojo, and just create a Main() function which calls your addon function, otherwise monkey will cull your unused code.
Then when you build, turn off debug mode. find the created code file and copy-paste.

It gets complicated when you need to leverage existing classes and libraries that the target uses. You'd have to essentially create bindings for that.


Gerry Quinn(Posted 2013) [#3]
I think Mark has made some effort to make Monkey output decent code in the targets. You probably should generate some code and see how it looks.