Cross-Compiler

BlitzMax Forums/BlitzMax Programming/Cross-Compiler

Stenley(Posted 2008) [#1]
Have a look at
http://www.glbasic.com/
there is a Basic, which have cross-compiler for different platforms. So you can write a single program and can compile it on one platform (Windows) for a lot of platforms (Windows, WinCE, Linux, MacOSX. XBOX, etc.)
Possible BlitzMax can learn there, to create also nice cross-compiler.
So that you don`t need the platform, for which you create your programs.
Currently you can "only" create Windows-programs on Windows, Linux-programs on Linux and MacOSX-programs on MacOSX. And if a Game-Developer, who used BlitzMax not have all three platforms he can not support all three.

So, a cross-compiler would be nice.


Brucey(Posted 2008) [#2]
If glbasic does all this for you already, why would you want to use BlitzMax ?


popcade(Posted 2008) [#3]
Technically you still need the platform to test your game, sorta.

GLBasic is pretty cool tho.


Stenley(Posted 2008) [#4]
@Brucey: Because GLBasic and BlitzMax havbe different language features.

@yoko: Java-developer also not testing its programs on different platforms. I have run lot of applications and browser-applets on Winsows and Linux, which was created by Mac-people, who have never tested its program on other systems.


ImaginaryHuman(Posted 2008) [#5]
The thing that struck me more is suggesting that game developers would want to release software on platforms they have no access to. Especially if you are even half serious about being professional and you have consideration for your customers, you'd want to make sure your software works and is tested properly on all target platforms.

I don't think I would release any software for a platform that I can't get access to for testing and development. Not only would you leave the customers dangling when you can't answer or solve a single bug-related question, but you also leave yourself dangling. Cross compilation would be a nice feature perhaps for a final product release when you've previously tested it on the native platforms, but I would think that even then you'd want to run the final exe on the target platform and test it at length to make really sure it is solidly stable.

I'm not so sure overall that cross compilation is really going to help anyone unless you are just releasing some small thrown-together game/tool. Like if I release something to linux people that I only ever compiled on windows I know they're going to be in for some surprises. BlitzMax is good for cross-platform compatibility and not having to change *much* to make all platforms give the same results, but it's not always 100%. Each platform has different kinds of bugs and issues. For example I ported a small game from Mac to Windows and everything worked after recompilation except the sound didn't work. I had to add a line to switch to the directsound driver. I might not have known that or discovered it at all if I just made a Windows exe from the Mac. Without a Vista PC I could not have discovered the flaw and then all Vista users would be rightly complaining, and I wouldn't be able to fix it or test the fix.

Cross compilation would be a great idea IF:

a) The language and the performance of the application is 100% exactly identical on all platforms requiring no customization at all, and

b) The developmnet platform includes a 100%-compatible supporting-all-features-exactly-as-they-are-on-the-real-platform emulator, for each platform.

c) All issues/bugs/problems local to each platform were 100% known ahead of time and integrated into the language behind the scenes.

Otherwise I think you're just taking a shot in the dark.

Take the iPhone as an example. You do not develop on the iPhone itself, you develop on a Mac in xCode and then you test it in a fully supported 100% accurate iPhone emulator. That means you can be pretty darn sure that when you actually run the app on a real iPhone it will work how it did in the emulator. Without the exact emulation and exact transfer of functionality from Mac to iPhone platforms it just wouldn't work. Also Apple owns and controls both of the platforms - Mac and iPhone and has access to the code for the xCode IDE/language support, and the entire operating system, and the o/s for the iPhone. Without that kind of control an app in the development environment might not work when it gets to the hardware. You don't have that control between Windows, Mac, Linux and other platforms. There are too many variables to make it reliable. If you're really serious about supporting customers and making your application stable you should invest in the platform you are targetting.


Gabriel(Posted 2008) [#6]
The thing that struck me more is suggesting that game developers would want to release software on platforms they have no access to. Especially if you are even half serious about being professional and you have consideration for your customers, you'd want to make sure your software works and is tested properly on all target platforms.

That was precisely what struck me too. I would immediately lose respect for a developer who was selling me a game on a platform he didn't even own to compile on. I mean if he can't compile on it, he sure as hell can't test on it, so he's selling me a game which he says works based on what? A few kind beta testers who helped him out? No thanks.

Cross-compilation is a nice gimmick for freeware developers, but not for anyone wanting to be taken seriously. Besides, given BlitzMax's dependencies, it seems extremely improbable.


GaryV(Posted 2008) [#7]
I agree with Gabriel and IH.

I think the best scenario in cases like that where you can't test on the target OS is to make those releases "unofficial" and not "officially supported" and FREE. It would be unfair to your customers to do otherwise.


therevills(Posted 2008) [#8]
It would be cool to compile on one platform though...

Ive got a Windows PC and Mac, it would be great to compile in Windows for the Mac, then move the app over to the Mac to test on (as long as it is 100% identical as IH stated)...

But I do agree that if you havent got the released platform, you shouldnt be releasing anything for it!


MGE(Posted 2008) [#9]
Ofcourse you need to test on the target platform, but the ability to select a compile target: "Windows, Mac, Linux" etc, from a single IDE would be incredibly useful.

BTW: I've been eye balling this for a while. The demos I have seen didn't impress me a while back. But it's getting very, very interesting.


slenkar(Posted 2008) [#10]
cross-compilation is great, you can distribute a game to people and have them test it out for you.
They can report problems back to you.

If you dont have cross-compilation you have to get them to compile your sourcecode which no-one is going to do.


ImaginaryHuman(Posted 2008) [#11]
It would be nice to be able to compile for multiple platforms from a single platform, like push one button and create 3 executables, because that would save transferring files across platforms and opening up the IDE's and compiling individually etc. Would be nice to be able to manage all projects on all platforms from a single `command center`, manage all the files in one central place, not have to switch operating systems or reboot to handle the distribution of the other versions, etc.

But I would want to especially make sure that if it did that then the resulting applications are thoroughly tested on the platform they are meant to run on, or at least in a competent emulator (which isn't likely since even the best windows/mac emulators do not usually support all features - parallels desktop for example does not aero in vista).

I recommend getting a Mac and either double or triple booting it to run OSX, Windows and Linux. They all run on an intel cpu natively, then you only buy one piece of hardware.


popcade(Posted 2008) [#12]
If you're a (half) serious developer.... how couldn't you buy another PC/platform.

No money? Don't know how to use it?


Koriolis(Posted 2008) [#13]
Even if you have one, cross compiling is immensely useful.
I would pay for this to happen.