Re: GSEncodingName

2006-10-17 Thread David Ayers
Richard Frith-Macdonald schrieb:
> 
> On 16 Oct 2006, at 18:12, David Ayers wrote:
> 
>> Richard Frith-Macdonald schrieb:
>>
>>>
>>> On 13 Oct 2006, at 07:25, David Ayers wrote:
>>>
 Richard Frith-Macdonald schrieb:

>
> As part of the public API, any removal/renaming will go through a
> deprecation process ... I have tried to do a two release cycle  in the
> past (ie if it's marked as deprecated in release N, then it  must  
> still
> be present in N+1 but we can remove it so that it is not inrelease
> N+2).
> I'd like to make that standing policy for public API removal  (and I'd
> like to get to a stage where private APIs really are private ...  not
> exposed at all beyond the technical minimum of a few external  symbols
> found in the binaries).
>>
>>
>> I'm a bit weary of the "technical minimum" approach since it seems  there
>> are at least some of us who started to rely on the documented API
>> (without necessarily consulting the headers), but I'll stick to the
>> sidelines until I have something more concrete.
>>
>> (I hope you're not considering removing md5Digest or
>> hexadecimalRepresentation.)
> 
> 
> What I want to get to is a situation where we are very clear what are 
> public extensions and what are internal APIs.
> With the public extensions in the additions library rather than in  the
> main base library.
> Extension macros/functions limited to a small number of well defined 
> groups (not random odd functions).
> Extension methods in clear categories/classes in the additions library.
> All clearly documented.

Well I guess it all depends on what you consider a random odd function
as opposed to a useful extension.  And in the case of GSEncodingName I
think it was filling in a missing feature and it  was part of the
additions API. ...but that's history now... :-)

> I'd only want to remove (after deprecation) stuff that practically 
> nobody uses ... on the theory that if hardly anyone uses it, it  should
> be in a separate library linked only by those people.
> I only asked about the GC classes because my impression is that they 
> are pretty much unused, and they could easily be put in their own 
> library (and other GC collections added to it if anyone was interested).

I have less of an issue with the request of removing GC collections.
Let's ignore the fact that removing the GC collections from GDL2 was
something I had in mind anyway.  I think there is nothing inherent about
them that they couldn't be part of a separate support library even if we
would have needed them in GDL2.  In the case of GSEncodingName, I do see
an inherent relation to the enum maintained in -base.  But like I said,
I currently do not have an outstanding concrete issue.

>> [snip]
>>
>>>
>>> However, I don't want to change anything here until/unless we are
>>> confident about doing the right thing.
>>
>>
>> Indeed!  So let me take a little more time to express myself more 
>> clearly.
>>
>> When I say "name space" I actually meant a reserved range.  But in  fact
>> that would mean we would already have to change the codes to achieve
>> that, which should be avoided.
>>
>> One concern is of course that we enumerate in range that Apple will  use
>> for different encodings.  Another concern is that we may introduce
>> encodings that Apple may introduce in the future with differing  values,
>> breaking compatibility in certain scenarios.
>>
>> So what I'm trying to say is that these new encodings shouldn't be
>> handled as GNUstep specific "extensions" /if/ we can avoid it, by
>> requesting Apple's Cocoa developers to reserve the new values in their
>> headers.  Now I realize that they may very well not care.  It just  seems
>> that we could simply ask.
> 
> 
> That sounds eminently sensible to me ... any idea who to ask?
> 

I would ask: [EMAIL PROTECTED] since this list was
created to coordinate Apple-GNU ObjC runtime coordination.  Even though
this is Cocoa issue I'm certain they can at least point to the right
place to ask.

Cheers,
David

[*]http://lists.apple.com/mailman/listinfo/objc-language


___
Gnustep-dev mailing list
Gnustep-dev@gnu.org
http://lists.gnu.org/mailman/listinfo/gnustep-dev


GNUstep Testfarm Results

2006-10-17 Thread Adam Fedor
Test results for GNUstep as of Tue Oct 17 06:34:15 EDT 2006
If a particular system failed compilation, the logs for that system will
be placed at ftp://ftp.gnustep.org/pub/testfarm

If you would like to be a part of this automated testfarm, see
http://wiki.gnustep.org/index.php/Developer_FAQ#How_can_I_take_part_with_a_GNUstep_autobuilder_for_the_testfarm.3F

Success Compile i386-unknown-netbsdelf3.0 Tue Oct 17 03:56:27 CEST 2006
Success Compile powerpc-apple-darwin7.9.0 Tue Oct 17 03:10:40 MDT 2006
Success Compile x86_64-unknown-linux-gnu Tue Oct 17 04:10:02 BST 2006


___
Gnustep-dev mailing list
Gnustep-dev@gnu.org
http://lists.gnu.org/mailman/listinfo/gnustep-dev


Re: Private library symbols...

2006-10-17 Thread Sheldon Gill

Richard Frith-Macdonald wrote:


On 16 Oct 2006, at 04:13, Sheldon Gill wrote:


Hi Richard,

You've made some recent changes to base with the idea of making 
private functions in base more obviously private and less accessible.


Yes ... as obviously private as possible.


It seems to be that there is really only one goal with these changes:

  applications/tools shouldn't be using private functions in base

Is there any other objective that I'm missing?


Well, that's the main tactical objective ... the strategic objective is 
to improve maintainability ... so centralisation and clarification 
internally is almost as much of a goal as simply trying to ensure that 
external apps/tools don't use private stuff.


Okay.

If this is the case, I think the approach being taken here isn't the 
one which we should be pursuing.


The original situation is we have functions like these:

NSString  *GSLastError(int);
BOOL   GSEnvironmentFlag( const char *, BOOL );

which make these functions seem like GNUstep API additions but really 
they are private.


What has been done is create an "artificial" object

@interface _GSPrivate : NSObject
+ (NSString*) error;
@end

@interface _GSPrivate (ProcessInfo)
+ (BOOL) environmentFlag: (const char *)name defaultValue: (BOOL)def;
@end


Yes, the idea is to collect everything together as much as possible, 
making it easier to find these things and making it clear that the 
various mechanisms are used internally.


Now I say artificial because it doesn't conform to an object design. 
There never is an actual instantiation, for example, so you're always 
sending messages to the class. There are many other things which make 
this not really an object.


This is a work in progress ... I'm not sure yet whether it would be good 
to have an instance and use instance methods rather than just a class 
and use class methods.  The main reason for using a class is to use 
language features to support encapsulation and maintainability rather 
than depending solely on conventions.


Well, you  actually are relying on conventions anyway. You've called the class 
_GSPrivate using the underscore convention to indicate privacy.


Also, these are private function calls within the library. Encapsulation 
doesn't really apply here.



Doing this adds many more bytes to the library.
It also makes these method lookups rather than function calls so they 
are slower.


True, but these are very minor overheads and I think clarity and 
maintainability come first before looking at optimisation (obviously we 
can optimise by caching method IMPs or by using a struct as a dispatch 
table rather than using a class).


I'm quite aware of how we can optimise method calls but this isn't really 
optimisation.


I also find this inconsistent with your previous statements about avoiding 
'bloat', as you put it. Surely more size and less speed for no functional 
changes is the very essence of 'bloat'?


I don't agree that these changes make anything more maintainable or easier than 
simply decorating the function calls with an underscore in the conventional way.


So we've added an artificial/strange object, increased the library 
size and slowed down those function calls all in an effort to prevent 
applications using our private functions. Is this right?


As you can tell from my answers above, it's only partially right.

Now its long been idomatic to use the underscore to mark private 
symbols. In fact, this is precisely what you've done with the class name.


Yes, I've tried to use every signal I could think of  ... the leading 
underscore, the word 'Private' the exclusion from any external headers 
and reduced linker symbols, and the inclusion of comments.


Further, I think this makes navigating the source harder. Quick, tell 
me without searching where you're going to find the implementation for 
the above two functions?


I'm very surprised at this comment ... since a big part of the intent is 
to make navigating the source *easier* and I believe this is achieved.
I certainly think it's not obvious where the old functions were ... but 
the new methods are clear since the category names tell you where the 
individual method implementations in each group are, the declarations 
are all in a single place, and you can find all the private methods 
implementations easily using a search for @implementation _GSPrivate.  


Making sure all declarations are in GSPrivate.h is good but a matter of 
programmer discipline and has no bearing on the function call vs class method 
issue.


> That's a big improvement over the older code.

Conventional layout has private functions near the top of the source file, just 
after header includes. They aren't that hard to find. Especially if you keep to 
convention with the underscores.


Sure, the category names help you find where the particular function is 
located. I've an equivalent way which adds precisely 0 bytes to the libnrary 
and makes no impact on the runtime:


// f