One of the questions from the FAQ section.

Blitz3D Forums/Blitz3D Programming/One of the questions from the FAQ section.

SopiSoft(Posted 2006) [#1]

Program flow, variable handling and the like are compiled into pure machine code, whereas the high-level commands are implemented as C++ library functions (which are called from the runtime library compiled into every Blitz-generated executable). Mark puts it best:

"... a section of code that doesn't call any 'command' functions, eg:


For k=1 To 1000
b(k)=k + MyFunc( t(k) )
MyFunc()
Next

Function MyFunc( t )
Return t*2
End Function


... will be 100% pure machine code. However, throw in a DrawImage, and it'll generate a call to DrawImage in the library."


I was wondering, is this the same for whenever you write a game in C++ and use the DirectX SDK?

I just read this FAQ and i always thought that everything was compiled into 100% pure machine code by Mister blitzcc.exe.


H&K(Posted 2006) [#2]
What is saying is that any command that doesnt use an external dll/libary will be compiled to machine code, as it also would in C++.

If though you start you use an sdk/libary of any sort you start to make machine code that "Calls" other things. Not really code, just a postal service.

Mark (or whoever), is saying that the "core" commands of the languge will create a linear code that does not "Jump" to some other libary. (Obviously it loops if you need a loop ;)

I think this was probably a statment against claims/ideas that B3D was just wrapping commands. (Ie not createing "REAL" machine code, just calling real machine code)

Its more and more a worry that when you write somthing. The thing you write doesnt do anything, except call somthingelse which calls somthing else which calls somthingelse, which does somthing. The statment in your post was saying that the core commands dont do that.


SopiSoft(Posted 2006) [#3]
Ok...I see, thanks for the info! :-)