Experiences?

BlitzMax Forums/BlitzMax Beginners Area/Experiences?

dmoc(Posted 2005) [#1]
Hello, I have decided to port a rather large PureBasic project to BM (win32 to mac osx). If anyone can comment on the following I'd appreciate it...

1) Editor: Just trying out TextWrangler but what I really need is code-completion, function-folding and side-panel reference. I'm using jaPBe for PB (on win32) at the moment but does anyone know of something similar for mac os x that can be customised for BM?

2) I'm a new Mac (Mini) user and don't expect the integrated ATI 9200 to blast through graphics but can anyone provide a rough comparison to a GeForce MX400 on a PIII-600? I don't expect detailed facts and figures just whether or not you were pleased/dissappointed. I'd hate to spend several days/weeks just to find lack of performance makes the exercise worthless.

3) While doing the conversion I'm hoping to improve things a bit (esp manageability) and make use of BM OO features. In PB my main (scenegraph) structure is an array of an amorphous type using "unions", which means none/little alloc/de-alloc once the array has been created. The requirements of my app allow me to get away with this but also means that my routines and the final app are pretty fast (70fps with a lot of geo, textures and other features). First thing I noticed with BM is there are no arrays-of-type, ie, only arrays-of-references, and no unions. I can easily(-ish) redesign my code to use BM's arrays and UDT's (derived from a commmon type) but do you have any hints/tips that may help maintain performance?

Suggestion for Mark: integrate BM with XCode, if possible? A good selling point since BM can be extended using Carbon/Cocoa?

Thanks for any/all comments.


dmoc(Posted 2005) [#2]
Re Mac editor: came across "SubEthaEdit" (http://www.codingmonkeys.de/subethaedit/index.html) - anyone know if this could be used as an alternative editor?


Beaker(Posted 2005) [#3]
BM does arrays of types. What did you mean here?


dmoc(Posted 2005) [#4]
Hi Beaker, unless I have got it wrong (possible) when you define an array of types you still need to "new" each array element, hence "references". So even though they can be accessed just like regular arrays they are not contiguous in memory. At the moment in PB when I declare the array a contiguous block memory is immediately reserved and kept for the lifetime of the program. As well as each node being generic (because of unions), the advantage is a lot of on-the-fly mem alloc/dealloc is avoided and hopefully contiguous memory is cache-able.

I'm pretty sure performance won't take a noticeable hit when converted to BM but I'm still trying to figure out the most efficient way to structure a scenegraph in BM. It's early days yet.


PowerPC603(Posted 2005) [#5]
It can still be possible that, when creating an array in PB, it creates the array and automatically fills it with references to new objects, which the array-declaration also creates behind your back.

In PB it could be (pseudo-code):
Dim MyArray:MyType[50]


Could do the same as in BMax:
Global MyArray:MyType[50]
For i = 0 to 49
MyArray[i] = New MyType
Next


So, in PB, you could end up also with an array of references, the programmer just doesn't realise it, because he didn't need to create the objects himself (the array-declaration did it already).

Still, I find it more useful that only the array is created, and not that the programming language automatically creates new objects and links them to all indexes of the array.
This provides more flexibility to the programmer, as you can do whatever you want with the indexes of the array (leave them empty, link them to previously created objects, link objects to the index that are a derived type-object from the type that was stated in the array-declaration, ...):
Type MyType1
End Type

Type MyType2 Extends MyType1
End Type

Global MyArray:MyType1[50]
MyArray[22] = New MyType2



LeisureSuitLurie(Posted 2005) [#6]
Well, our own Kamashin has made this:

http://www.versiontracker.com/dyn/moreinfo/macosx/25608


Robert(Posted 2005) [#7]
Hi dmoc,

I suggest that you just convert the code over to BM as-it-is. Optimisations to array handling can be done later.


dmoc(Posted 2005) [#8]
Hi Robert, that's what I intended to do but without unions I at least have to seperate-out my types, no big deal as they can be derived from a common type, but then I need to determine each "nodes" type on the fly, hmmm, still looking for a solution. BM certainly appears capable but the more I read/search the more lacking the documentation looks.

LeisureSuitLurie: looks promising but I get an error expanding the dl.