BMax to Monkey Converter

Community Forums/Monkey Talk/BMax to Monkey Converter

Chroma(Posted 2011) [#1]
Anyone interested in making something like this?


Canardian(Posted 2011) [#2]
And also from Blitz3D!


Ked(Posted 2011) [#3]
I thought Mark's blog said something about Monkey being able to do something like this? And, no, I didn't recheck.


Canardian(Posted 2011) [#4]
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


GfK(Posted 2011) [#5]
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.
Did you realise that you just said the exact same thing, worded slightly differently, three times?


Canardian(Posted 2011) [#6]
It's called the top-down method, first the abstract overview, then more detailed descriptions, and finally some real examples.

Last edited 2011


slenkar(Posted 2011) [#7]
lol

I spose a translator could be made,


Gabriel(Posted 2011) [#8]
What, to translate from Lumooja into English? I already have one.


Yasha(Posted 2011) [#9]
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.)


Canardian(Posted 2011) [#10]
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


Chroma(Posted 2011) [#11]
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


Canardian(Posted 2011) [#12]
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.