Target addition, some thoughts

Monkey Forums/Monkey Programming/Target addition, some thoughts

ziggy(Posted 2012) [#1]
Am I the only one wishing to have some improvements on the way targets can be added to Monkey? It feels very unpractical to be forced to create your own compiled version of trans for each new target you want to add. Maybe this can be improved when (if ever) an interpreted version of Monkey is implemented. I wish we could add targets as a sort of library, sort of download them and being able to attach them to current compiler. I wish I could play with the Monkey max and also with the Python target if it ever gets published. I was also going to add a .net based console target, for my own purposes, but that would mean having three different versions of the compiler, or mix them all in another Trans compilation.
It's great how it works now, as you can tweak everything and I'm ejoying it a lot, but maybe there could be some improvements to the way compilation targets are related to the compiler, so they can be added at runtime and not only at compile time.

Just my two cents. If it does not make sense, just ignore this...


dopeyrulz(Posted 2012) [#2]
No, absolutely right ziggy. Being able to plugin a target would be awesome.


therevills(Posted 2012) [#3]
Am I the only one wishing to have some improvements on the way targets can be added to Monkey?


+1 Million!!!

I dont mind compiling trans, but hate that I have to alter trans's source code to add a target:

* src\trans\trans.monkey
* src\trans\target.monkey
* src\trans\targets\targets.monkey
* modules\trans\trans.monkey

Couldnt this lot be done in a config file or scanning the folders or something?


Skn3(Posted 2012) [#4]
What if each target had a separate command line executable and then calling trans just acts a signal director and sub-call the appropriate target executable. The console output would be piped from the target back through trans.

That way at least you could have magical targets that can operate independently. If you wanted, each target could have a completely different code base but they would all accessed through the trans executable.

It would be good if there was some official support for this but even if not it would be pretty straightforward to make a wrapper trans that will just fall back to the official trans if a target specific executable is not found.


Aman(Posted 2012) [#5]
+1
The most important feature of Monkey for me is how flexible it is. The more flexible it is the more I like it :)


Tibit(Posted 2012) [#6]
+1 Making it simpler to add targets is an excellent idea. It sounds very simple, but I assume this is far from trivial. Anyone who knows what it would take? What the real problem is?


Paul - Taiphoz(Posted 2012) [#7]
What if the targets well in the form of dll's and Trans just called and pulled in the dll it needed, adding new targets would then be as simple as dropping in the dll to the targets folder, where trans could auto detect it and make it available as a target option.

TBH its not something I mess with at all, leaving it to those with a bit more gray matter than me, but I have to agree with the above, making this easier would help a lot of people out.


AdamRedwoods(Posted 2012) [#8]
I like what Skn3 said, since it wouldn't take much. So each target would be basically the way it is now except separated out of trans, whereas the main trans would call each target's "trans exe". Probably would need a config file , too.

I'd put this under 'nice to have' for now, but on the other hand, massively-multi platform is a big seller these days.