BMax to Monkey Converter
Community Forums/Monkey Talk/BMax to Monkey Converter
| ||
Anyone interested in making something like this? |
| ||
And also from Blitz3D! |
| ||
I thought Mark's blog said something about Monkey being able to do something like this? And, no, I didn't recheck. |
| ||
Monkey can do everything what BlitzMax can do, plus infinitely much more, since you can expand Monkey yourself. Monkey is not only a language, but it's the mother of all languages (even literally), since you can expand the Monkey language itself too, and you can add new target languages to which it translates. I've already added a few new commands to the Monkey language (as a module), which also translate to all target languages. Last edited 2011 |
| ||
Monkey can do everything what BlitzMax can do, plus infinitely much more, since you can expand Monkey yourself. Did you realise that you just said the exact same thing, worded slightly differently, three times? Monkey is not only a language, but it's the mother of all languages (even literally), since you can expand the Monkey language itself too, and you can add new target languages to which it translates. I've already added a few new commands to the Monkey language (as a module), which also translate to all target languages. |
| ||
It's called the top-down method, first the abstract overview, then more detailed descriptions, and finally some real examples. Last edited 2011 |
| ||
lol I spose a translator could be made, |
| ||
What, to translate from Lumooja into English? I already have one. |
| ||
you can expand the Monkey language itself too You can? This deserves another look. How does it work? (Unless you're referring to the open-sourced-ness, in which case... that hardly counts, almost every language has that.) |
| ||
There are different ways to expand the Monkey language itself: - making modules. Overriding existing functions and methods works! For example I made a Cls r,g,b,a function, which overrides the default Cls r,g,b, so you can use both, or just the overridden function which could call also the default Cls when a=1.0, but it's not really needed - patching the trans module, so you can basically alter all the semantics and parsing and everything. Today I patched the cpptranslator.monkey file to replace all float with double to get a huge speed and accuracy boost for C++ code targets When using the patching method, it's good to write a patcher to be able to use always the newest Monkey version. It's quite simple also: LoadString "filename" and SaveString "filename", and you just patch the string between those. Last edited 2011 |
| ||
Lumooja, let's say I wanted to create a command called Graphics that I call on the OnCreate() method that sets the resolution in the translated source code file. But like you say, is useable in all languages exported to by Monkey. How would you do that? ie.: Graphics(width:Int, height:Int, depth:Int=0, hertz:Int=60) Last edited 2011 |
| ||
I would first see how far you get when your Graphics command does a LoadString/SaveString of the config.h file in your build directory. Maybe for some targets you need to LoadString/SaveString the MonkeyGame.html file, like for HTML5 and WEBGL. When that is not enough, then you can look at the individual native solutions how the App class initialized the graphics window, and use those commands in your Graphics command also. |