Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2009-02

PasCocoa design

14 messages · 6 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

OCTAGRAM

Where are discussions about it occuring? I'd like to follow your progress. Maybe we could share some thoughts.

In AdaStep (aka gnat-cocoa) there is a problem with GC. Turning GC on is probably not an option at the moment. Classes created by Objective-C compiler are binary-documented by compiler, but Ada ancestors are not going to be unless someone write ASIS utility to parse Ada sources.

Personally, I am all against GC. People complain loudly when discover that their new 500Gb HDD is detected as 418Gb or so. Decimal/hexadecimal Gbs, FS structures, 10% reserved for root -- this all adds to storage losses. People complain when they lose 8-30%. How happy can such a man be knowing that GC program can effectivelly use just 20%-40% out of his operative memory (loosing 60-80%)?

I can think of solution like having two internal arrays of strong and weak references. To mark an array is simpler than arbitrary Ada object layout. And there still probably remain bounded errors. Boehm's heuristic behaviour on untyped objects doesn't sound good to me.

Life would be much easier if one did not have to overlay non-GC PLs on top of GC ones.

In .NET doing this is a bit simpler: .NET objects can be accessed through a COM. .NET wrappers correctly respond to AddRef and Release methods. Apple website states that retain and release do nothing in GC environment:

http://developer.apple.com/leopard/overview/objectivec2.html

With garbage collection enabled, the older reference count memory management methods of retain, release, and autorelease have no effect.

I'm asking those who has Leopard, how much does programmer lose denying GC? May be GC is not worth bothering about.

View this message in context: http://www.nabble.com/PasCocoa-design-tp21975675p21975675.html Sent from the Free Pascal - General mailing list .
Travis Siegel
to OCTAGRAM

Actually, it's not just the file system that eats space that leads to a 500GB disk being shown at just over 400GB.
It's also determined by how the manufacturer measures 1K of data. Some manufacturers in order to inflate their drive values, treat a K as 1,000 bytes. This is not accurate. 1K is actually 1024 bytes. When you're talking about GB size ranges, this leads to huge descrepincies in rated vs actual sizes. Thats why I like the Lasie drives, they rate according to a 1024 byte K, and so their drives are always very close to the rated size, whereas 1 500GB drive I bought (manufacturer will remain nameless) was actually a 435GB drive, which made me *very* angry.
If they want to claim 1000 bytes is 1K, then they should be required to say so somewhere on their packaging. I happily would have paid the extra 20 bucks, and got something that was closer to the actual 500GB mark if I had known.

OCTAGRAM wrote 60 lines
Where are discussions about it occuring? I'd like to follow your progress. Maybe we could share some thoughts. In AdaStep (aka gnat-cocoa) there is a problem with GC. Turning GC on is probably not an option at the moment. Classes created by Objective-C compiler are binary-documented by compiler, but Ada ancestors are not going to be unless someone write ASIS utility to parse Ada sources. Personally, I am all against GC. People complain loudly when discover that their new 500Gb HDD is detected as 418Gb or so. Decimal/hexadecimal Gbs, FS structures, 10% reserved for root -- this all adds to storage losses. People complain when they lose 8-30%. How happy can such a man be knowing that GC program can effectivelly use just 20%-40% out of his operative memory (loosing 60-80%)? I can think of solution like having two internal arrays of strong and weak references. To mark an array is simpler than arbitrary Ada object layout. And there still probably remain bounded errors. Boehm's heuristic behaviour on untyped objects doesn't sound good to me. Life would be much easier if one did not have to overlay non-GC PLs on top of GC ones. In .NET doing this is a bit simpler: .NET objects can be accessed through a COM. .NET wrappers correctly respond to AddRef and Release methods. Apple website states that retain and release do nothing in GC environment: http://developer.apple.com/leopard/overview/objectivec2.html With garbage collection enabled, the older reference count memory management methods of retain, release, and autorelease have no effect. I'm asking those who has Leopard, how much does programmer lose denying GC? May be GC is not worth bothering about. -- View this message in context: http://www.nabble.com/PasCocoa-design-tp21975675p21975675.html Sent from the Free Pascal - General mailing list archive at Nabble.com. _______________________________________________ fpc-pascal maillist - http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Felipe Monteiro de Carvalho
to OCTAGRAM: Where are discussions about it occuring? I'd like to follow your progress. Maybe we could…
OCTAGRAM wrote
Where are discussions about it occuring? I'd like to follow your progress. Maybe we could share some thoughts.

My only Mac computer has a 10.4 operating system. Garbage collector was introduced in ObjC 2.0 in 10.5, so I simply ignore the subject, as I would be unable to test it anyway.

As for the progess you can check here, but I don't update that often: http://wiki.lazarus.freepascal.org/PasCocoa

To have a better idea of the state just download the latest subversion and test the example applications, or try to develop your own apps.

If you need any class not yet wrapped, just drop an e-mail and I will add it.

Felipe Monteiro de Carvalho
dmitry boyarintsev
to Felipe Monteiro de Carvalho

Felipe,

i've found that ObjCRuntime unit is introduced with FPC package (objc1.0). So now, there're 2 versions of objc runtimes available for FPC. And I have also converted objc2.0 version, but have not published it yet (just want to make it more cross-pascal).

What do you think, if PasCocoa should switch to ObjCRunTime unit?

Thanks,
Dmitry

p.s. Sorry there's not word about GC. but i just don't want to start another thread :)

Felipe Monteiro de Carvalho
to dmitry boyarintsev
dmitry boyarintsev wrote 6 lines
i've found that ObjCRuntime unit is introduced with FPC package (objc1.0). So now, there're 2 versions of objc runtimes available for FPC. And I have also converted objc2.0 version, but have not published it yet (just want to make it more cross-pascal). What do you think, if PasCocoa should switch to ObjCRunTime unit?

No, never. I kindly posted our unit in the Mac-Pascal mailling list so that it could be included in all Pascal compilers and yet some people there decided to ignore it and duplicate our efforts by launching a different translation of the headers. So they have proven that it's impossible to colaborate with them, and if we need to change anything in their unit I would bet it will be a huge problem.

They even created a unit with the same name as my original, which generates a namespace conflict, but Jonas kindly renamed their unit in the FPC copy of it.

Felipe Monteiro de Carvalho
dmitry boyarintsev
to Felipe Monteiro de Carvalho
. So they have proven that it's impossible to colaborate with them, and if we need to change anything in their unit I would bet it will be a huge problem.

Thanks for the comments, Felipe. The only thing i like about their version, is that it's single unit, rather than C-style includes. But since, C-include works fine, i see no reasones to change it :)

Anyway, i'm attaching converted objc20 unit. I'm not sure if it's of any use for you, because you might have troubles using it on OSX 10.4.x. How about adding it to PasCocoa?

They even created a unit with the same name as my original, which generates a namespace conflict, but Jonas kindly renamed their unit in the FPC copy of it.

Thank you, Jonas :)

dmitry boyarintsev
to Vincent Snijders
Why? Copyright reasons?

nope. no problems with license.

the problem might be with PasCocoa design.

currently objc2.0 is a stand-alone unit, that can (and should!) be used without objc.
The unit links objc2.0 routines, so application compiled with objc20 would never run with objc 1.0 (so Tiger is not supported - so that's bad).

imo, objc-runtime should be loaded at the application start (depending on the OSX version, just like opengl extensions loaded depending on the gl-driver). This would also allow to avoid great number of $IFDEFs.

dmitry boyarintsev
to dmitry boyarintsev
This would also allow to avoid great number of $IFDEFs.

as well as increasing application's portability.
For example, if Apple releases next version of OSX without objc1.0 support it would be not necessary to recompile the application for the new os and objc2.0.

Travis Siegel
to dmitry boyarintsev: Thanks for the comments, Felipe. The only thing i like about their version, is that it's…

I've actually downloaded the pascocoa code, but I have no idea what to do with it.
How do I integrate it into the Xtools so I can compile a pascocoa program?
Just dumping the headers into the fpc incoudes didn't seem to work for me
Did I do something wrong?
Where are these source pieces supposed to go?
(I don't use lazarius, because I've not tested it to see if it works with voiceover, but my guess is, it won't, though I've been leasantly surprised before)

dmitry boyarintsev wrote 19 lines
> . So they have proven that it's > impossible to colaborate with them, and if we need to change anything > in their unit I would bet it will be a huge problem. Thanks for the comments, Felipe. The only thing i like about their version, is that it's single unit, rather than C-style includes. But since, C-include works fine, i see no reasones to change it :) Anyway, i'm attaching converted objc20 unit. I'm not sure if it's of any use for you, because you might have troubles using it on OSX 10.4.x. How about adding it to PasCocoa? > They even created a unit with the same name as my original, which > generates a namespace conflict, but Jonas kindly renamed their unit > in > the FPC copy of it. Thank you, Jonas :) <objc20.pas.zip>_______________________________________________ fpc-pascal maillist - http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Felipe Monteiro de Carvalho
to Travis Siegel
Travis Siegel wrote
I've actually downloaded the pascocoa code, but I have no idea what to do with it.

You should start by compiling one of the example projects to check if everything is ok, and also use them as a start point to your projects.

I compile them by opening the respective Lazarus project, which sets the appropriate paths. You can also built them from the command line. Should be something similar to:

fpc -Fu../ (insert other necessary -Fu and -Fi here) -k-framework -kCocoa -k-lobjc statusitem.pas

Where are these source pieces supposed to go?

Anywhere you want. Usually somewhere in your user directory. Then you add -Fu when calling FPC so that it can find the units

Felipe Monteiro de Carvalho