is bmax a translator?

BlitzMax Forums/BlitzMax Programming/is bmax a translator?

Najdorf(Posted 2005) [#1]
does bmax just turn the code you write in C++ and then compile it through GCC?


Dreamora(Posted 2005) [#2]
No


Diordna(Posted 2005) [#3]
Really? That's not what I heard. In fact, I distinctly remember watching OS X's Activity Monitor during a compile, and gcc was, in fact, running.

Unless of course I'm remembering incorrectly, which is very possible. I can't check at the moment because I have to reinstall Xcode first. My installation went wacko.


RktMan(Posted 2005) [#4]
i think it generates assembly ... then uses GCC to compile that.

Tony


Tom(Posted 2005) [#5]
From Help:

You can use the Import command to add certain non-BlitzMax source files to your projects, and the Extern command to make the functions in those files available to BlitzMax applications.

The currently supported non-BlitzMax source file types are: .c (C); .cpp (C++); .cxx (C++); .m (ObjectiveC); and .s (Assembler).


BlitzSupport(Posted 2005) [#6]
I'm not involved in the low level side of things, so Mark or Simon would have to clarify/correct any minor misunderstandings I've picked up, but I believe it goes something like this...

· BlitzMax's bcc generates assembly source code from your BlitzMax source code; see the .s files inside the .bmx folder that's sitting in the same folder as your source code -- open the .s files in Notepad or similar to see the assembly source for your program. On the Mac (and possibly Linux, can't check right now), the .bmx folders are hidden so you have to use the command line and ls -a to find them;

· Blitz also uses gcc to compile the C-based modules if necessary, as well as any C includes you specify. The same goes for other variants of C code, using different compilers. I believe gcc and the other compilers just put out .s assembly source as bcc does;

· fasm is used to assemble the .s code on the PC (as replaces fasm on the Mac) into .o object files, I believe. Object files are basically just chunks of 'raw' assembled code waiting to be stuffed into a working executable;

· I'm a bit vague on this part, but in the case of pre-compiled modules, I think the .o files get turned into .a files (by ar?), effectively archived libraries of object code intended to be linked (roughly = imported) into your executable, again in the .bmx folder for your app. Someone correct me here if I'm wildly off-base;

· the .i files (which you can open in Notepad), found sitting alongside any .a files, are basically declarations of what's in the compiled/archived .a files;

· BlitzMax uses ld (the linker) to stitch all the .o and .a files for a project into a working executable;

· this process is all controlled by bmk, the Blitz 'make' program, which is what the IDE calls when you go to build your program.

Something like that, anyway... feel free to correct!


Yan(Posted 2005) [#7]
Grr...Must refresh page before posting... ;o)

...James beat me to it...With a more detailed description to boot...


FlameDuck(Posted 2005) [#8]
What they said.


BlitzSupport(Posted 2005) [#9]

James beat me to it


Yeah, sorry about that. I was dreading someone else doing the same...


Yan(Posted 2005) [#10]
Hehe...No problem. :o)

You'd probably already posted before I even started TBH.
I've got a terrible habit of getting distracted with other things and then posting without refreshing the page first. :o/

The main thing is, the question was answered. :o)


Sweenie(Posted 2005) [#11]
use bmk with the -v (verbose) option to see whats going on.