BlitzMax to Monkey, or BlitzMax to JS ?

Monkey Targets Forums/User Targets/BlitzMax to Monkey, or BlitzMax to JS ?

vmars316(Posted 2013) [#1]
Is there such a thing as
BlitzMax to Monkey, or BlitzMax to JS ?
Thanks...vm


therevills(Posted 2013) [#2]
I recall someone doing a quick conversion from BlitzMax to Monkey... But because how the languages are different and that BlitzMax has more modules I don't think it could be done properly (at least not in the short term).


PhillipK(Posted 2013) [#3]
Depends on your Blitzmax project:

If you use the brl stuff only, it is a great chance to convert it by hand without much trouble. Lets say, it would take 30minutes for one file. Most can be simple copy/pasted, some stuff need a ReplaceAll searchfilter, minor bugs may happen.

Well, but if you use stuff like networking, theres a point when it becomes impossible yet to convert blitzmax->Monkey
Anyways, there is no tool that i know.


Paul - Taiphoz(Posted 2014) [#4]
I think a Max to Monkey core to core is deff doable, for sure Max has tons of additional modules that would not be valid or simply would not be workable with monkey however doing a straight up conversion from one to the other should be a fairly straight forward ordeal if not a little time consuming..

I think the main issue would be the lack of an entry point, but then a simply helper could handle this you could add some addition helper tags to your max code to make things easier on a parser, like surrounding your main entry point with a few hash tags so a parser knows thats where it should look when creating it's new monkey main function.

Other than that, is there really any major issues with a core to core conversion ?,


therevills(Posted 2014) [#5]
Other than that, is there really any major issues with a core to core conversion ?,

A lot of the core BMax functions are not in Monkey, so they would be empty functions in Monkey and therefore you couldn't really use the BMax in the first place.

For example BlitzMax commands / types not in Monkey or equivalent as far as I know:
* CreateAudioSample
* CreateStaticAudioSample
* Compress / Compress2 / Uncompress
* TBanks and functions
* Graphics Drivers setup
* Events
* MaxLua
* Threads
* MaxGUI (since it now comes with BMax you could call it core)
* More?

Just to name a few ;)


Paul - Taiphoz(Posted 2014) [#6]
From your list I think the only thing that may be in one of my max games is the Banks, just about all of the rest of it are things you might commonly find in an application or tool project not so much a game, or at the very least not that many games.

As for the Graphics setup whats the point in even converting it when its not needed in monkey the parser would simply ignore it.

I understand what your getting at and I agreed above it's not possible to do a 1:1 ratio conversion, max simply has to much behind it, however getting a conversion good enough that it would at best work on a lot of peoples games and at the very least take a massive chunk of time out porting the rest, with a parser doing the bulk of the conversion and then leaving just a handfull of things for the developer to tweak out or find another solution for.

I think for a lot of people a 1:1 is possible with their game code, for a lot of others any parser would still be able to do a massive bulk of the work leaving the dev to figure out ways around the remaining stuff.


therevills(Posted 2014) [#7]
My last Bmax game (LoS2) uses banks, XML, MaxGui, Events and the normal lot (i.e. Graphics / Sounds etc)...

What I am saying if you create a BlitzMax-to-Monkey program and tell everyone about it you will have to put a lot of caveats around it.

If you want to do it "correctly", you basically would need create a Monkey module for BMax and only have your game call those functions which inturn wraps the BMax functions - that way you know you will have a 1:1 translation when going between BMax and Monkey.

Or write a mini compiler / parser sort of thing which tells the user that x function isn't supported... so at the end of the day you might as well write it in pure Monkey.


Paul - Taiphoz(Posted 2014) [#8]
with me having code that would probably convert fine, and you having code that would not were both simply representing the wider Max community, there are bound to be tons of people who simply would have no use for a Translator but then the flip side of that would be also true, there would be people with code that like me does not pull in the more exotic modules and would be able to translate well enough to save time.

I think the much more important question is, would the BlitzMax community be encouraged to move to monkey if they had a Translator that could take some of the pain out of moving their work.

To be honest this is something I probably would only have use for two or three old projects, after that for me it would not be needed much at all, but as a marketing tool or a tool to encourage Max users over to monkey it could be far far more valuable.

I guess its all mute anyway until some one sets aside their spare time and gives it a shot.