[webkit-dev] Rename PLATFORM(MAC) to PLATFORM(COCOA)?

2014-01-11 Thread Darin Adler
Hi folks.

There is a lot of WebKit code that needs to be on for “the Mac and iOS ports”. 
Some of it is guarded be conditionals with a higher level concept. But most of 
it, now this is guarded by PLATFORM(MAC). I think that’s really confusing and 
we need to rename PLATFORM(MAC) to something else. Perhaps PLATFORM(COCOA)? Or 
maybe it’s SOMETHING_ELSE(COCOA)?

Then we can use PLATFORM(MAC) for “the Mac port” rather than PLATFORM(MAC)  
!PLATFORM(IOS).

Later we can start renaming file names as well, but for now I just want to fix 
the conditionals to be more readable. And of course, it’s even better in cases 
where we can move away from platform conditionals to more logical conditionals 
such as USE(CF) or USE(APPKIT).

So, is PLATFORM(COCOA) an acceptable new name for what is currently named 
PLATFORM(MAC)? If not, what’s a better choice?

Lets do this soon. It’s hard for me to remember that in WebKit, PLATFORM(MAC) 
means “the Mac and iOS ports”.

— Darin
___
webkit-dev mailing list
webkit-dev@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-dev


Re: [webkit-dev] Rename PLATFORM(MAC) to PLATFORM(COCOA)?

2014-01-11 Thread Dan Bernstein

On Jan 11, 2014, at 2:47 PM, Darin Adler da...@apple.com wrote:

 Hi folks.
 
 There is a lot of WebKit code that needs to be on for “the Mac and iOS 
 ports”. Some of it is guarded be conditionals with a higher level concept. 
 But most of it, now this is guarded by PLATFORM(MAC). I think that’s really 
 confusing and we need to rename PLATFORM(MAC) to something else. Perhaps 
 PLATFORM(COCOA)? Or maybe it’s SOMETHING_ELSE(COCOA)?
 
 Then we can use PLATFORM(MAC) for “the Mac port” rather than PLATFORM(MAC)  
 !PLATFORM(IOS).
 
 Later we can start renaming file names as well, but for now I just want to 
 fix the conditionals to be more readable. And of course, it’s even better in 
 cases where we can move away from platform conditionals to more logical 
 conditionals such as USE(CF) or USE(APPKIT).
 
 So, is PLATFORM(COCOA) an acceptable new name for what is currently named 
 PLATFORM(MAC)?

Yes.

 If not, what’s a better choice?
 
 Lets do this soon. It’s hard for me to remember that in WebKit, PLATFORM(MAC) 
 means “the Mac and iOS ports”.
 
 — Darin
 ___
 webkit-dev mailing list
 webkit-dev@lists.webkit.org
 https://lists.webkit.org/mailman/listinfo/webkit-dev

___
webkit-dev mailing list
webkit-dev@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-dev


Re: [webkit-dev] Rename PLATFORM(MAC) to PLATFORM(COCOA)?

2014-01-11 Thread Anders Carlsson

On Jan 11, 2014, at 2:47 PM, Darin Adler da...@apple.com wrote:

 So, is PLATFORM(COCOA) an acceptable new name for what is currently named 
 PLATFORM(MAC)? If not, what’s a better choice?

I agree with Dan, I think PLATFORM(COCOA) is acceptable.

 Lets do this soon. It’s hard for me to remember that in WebKit, PLATFORM(MAC) 
 means “the Mac and iOS ports”.

One downside is that we won’t be able to make PLATFORM(MAC) mean “the Mac port” 
before all the uses have been audited and converted to PLATFORM(COCOA). I don’t 
know a good solution to that problem.

- Anders

___
webkit-dev mailing list
webkit-dev@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-dev


Re: [webkit-dev] Rename PLATFORM(MAC) to PLATFORM(COCOA)?

2014-01-11 Thread Darin Adler

On Jan 11, 2014, at 3:12 PM, Anders Carlsson ander...@apple.com wrote:

 
 One downside is that we won’t be able to make PLATFORM(MAC) mean “the Mac 
 port” before all the uses have been audited and converted to PLATFORM(COCOA). 
 I don’t know a good solution to that problem.

My proposal is:

1) Add PLATFORM(COCOA).
2) Change PLATFORM(MAC) to PLATFORM(COCOA) quickly and mechanically before 
making other changes.
3) Add a PLATFORM(MAC) that is false for iOS.

Then we can change various PLATFORM(COCOA) back to PLATFORM(MAC) if they really 
meant PLATFORM(MAC), but that can be done gradually over time.

— Darin
___
webkit-dev mailing list
webkit-dev@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-dev


Re: [webkit-dev] Rename PLATFORM(MAC) to PLATFORM(COCOA)?

2014-01-11 Thread Anders Carlsson

On Jan 11, 2014, at 3:19 PM, Darin Adler da...@apple.com wrote:

 
 On Jan 11, 2014, at 3:12 PM, Anders Carlsson ander...@apple.com wrote:
 
 
 One downside is that we won’t be able to make PLATFORM(MAC) mean “the Mac 
 port” before all the uses have been audited and converted to 
 PLATFORM(COCOA). I don’t know a good solution to that problem.
 
 My proposal is:
 
 1) Add PLATFORM(COCOA).
 2) Change PLATFORM(MAC) to PLATFORM(COCOA) quickly and mechanically before 
 making other changes.
 3) Add a PLATFORM(MAC) that is false for iOS.
 
 Then we can change various PLATFORM(COCOA) back to PLATFORM(MAC) if they 
 really meant PLATFORM(MAC), but that can be done gradually over time.

Sounds good!

- Anders

___
webkit-dev mailing list
webkit-dev@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-dev


Re: [webkit-dev] Rename PLATFORM(MAC) to PLATFORM(COCOA)?

2014-01-11 Thread Dan Bernstein

On Jan 11, 2014, at 3:19 PM, Darin Adler da...@apple.com wrote:

 
 On Jan 11, 2014, at 3:12 PM, Anders Carlsson ander...@apple.com wrote:
 
 
 One downside is that we won’t be able to make PLATFORM(MAC) mean “the Mac 
 port” before all the uses have been audited and converted to 
 PLATFORM(COCOA). I don’t know a good solution to that problem.
 
 My proposal is:
 
 1) Add PLATFORM(COCOA).
 2) Change PLATFORM(MAC) to PLATFORM(COCOA) quickly and mechanically before 
 making other changes.
 3) Add a PLATFORM(MAC) that is false for iOS.
 
 Then we can change various PLATFORM(COCOA) back to PLATFORM(MAC) if they 
 really meant PLATFORM(MAC), but that can be done gradually over time.

How about this plan instead?

1) Add PLATFORM(COCOA)
2) Change all instances of PLATFORM(MAC) that are not in !PLATFORM(IOS) 
sections or combined with !PLATFORM(IOS) into PLATFORM(COCOA)
3) Make PLATFORM(MAC) be false in iOS.
___
webkit-dev mailing list
webkit-dev@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-dev


Re: [webkit-dev] Rename PLATFORM(MAC) to PLATFORM(COCOA)?

2014-01-11 Thread Maciej Stachowiak

Ideally it should be USE(THE_SPECIFIC_FRAMEWORK_IN_QUESTION). I would guess 
that much of PLATFORM(MAC) that is valid for both Mac and iOS should actually 
be USE(FOUNDATION). PLATFORM really shouldn't be used for things other than 
terminal platform names. USE(COCOA) would be an ok stopgap if sorting down to 
more specific conditionals delays this cleanup too much.

Regards,
Maciej

On Jan 11, 2014, at 2:47 PM, Darin Adler da...@apple.com wrote:

 Hi folks.
 
 There is a lot of WebKit code that needs to be on for “the Mac and iOS 
 ports”. Some of it is guarded be conditionals with a higher level concept. 
 But most of it, now this is guarded by PLATFORM(MAC). I think that’s really 
 confusing and we need to rename PLATFORM(MAC) to something else. Perhaps 
 PLATFORM(COCOA)? Or maybe it’s SOMETHING_ELSE(COCOA)?
 
 Then we can use PLATFORM(MAC) for “the Mac port” rather than PLATFORM(MAC)  
 !PLATFORM(IOS).
 
 Later we can start renaming file names as well, but for now I just want to 
 fix the conditionals to be more readable. And of course, it’s even better in 
 cases where we can move away from platform conditionals to more logical 
 conditionals such as USE(CF) or USE(APPKIT).
 
 So, is PLATFORM(COCOA) an acceptable new name for what is currently named 
 PLATFORM(MAC)? If not, what’s a better choice?
 
 Lets do this soon. It’s hard for me to remember that in WebKit, PLATFORM(MAC) 
 means “the Mac and iOS ports”.
 
 — Darin
 ___
 webkit-dev mailing list
 webkit-dev@lists.webkit.org
 https://lists.webkit.org/mailman/listinfo/webkit-dev

___
webkit-dev mailing list
webkit-dev@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-dev


Re: [webkit-dev] Rename PLATFORM(MAC) to PLATFORM(COCOA)?

2014-01-11 Thread Darin Adler

On Jan 11, 2014, at 3:36 PM, Maciej Stachowiak m...@apple.com wrote:

 
 Ideally it should be USE(THE_SPECIFIC_FRAMEWORK_IN_QUESTION). I would guess 
 that much of PLATFORM(MAC) that is valid for both Mac and iOS should actually 
 be USE(FOUNDATION). PLATFORM really shouldn't be used for things other than 
 terminal platform names. USE(COCOA) would be an ok stopgap if sorting down to 
 more specific conditionals delays this cleanup too much.

Sorting down to specific conditionals will definitely delay the cleanup too 
much!

Thinking about USE(FOUNDATION) and looking at code it’s clear that the Mac and 
iOS ports have a lot more in common than Foundation. I saw that looking at 
PLATFORM(MAC) code snippets.

But as long as we’re going to have something incorrect as a first 
approximation, I don’t think that incorrect uses of USE(FOUNDATION) are 
significantly worse than incorrect uses of USE(COCOA). If long term there is 
not supposed to be such a thing as USE(COCOA), then I would hate to add it and 
then have to remove it later.

It remains clear to me that a valuable and quick first step is to mechanically 
change PLATFORM(MAC) to BAR, and I am OK with BAR being USE(FOUNDATION), 
USE(COCOA), or PLATFORM(COCOA).

I am sure there is a lot of easy refinement we can do immediately after. For 
example, we can change BAR  !PLATFORM(IOS) back to PLATFORM(MAC), if we can’t 
find an even better conditional. Maybe our first step can even be clever and 
not ever change such things to BAR, as suggested by Dan.

I’d like to play the numbers game, so if our best guess is that most 
PLATFORM(MAC) should be USE(FOUNDATION), I would choose that for BAR.

— Darin
___
webkit-dev mailing list
webkit-dev@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-dev


Re: [webkit-dev] Rename PLATFORM(MAC) to PLATFORM(COCOA)?

2014-01-11 Thread Maciej Stachowiak

On Jan 11, 2014, at 3:50 PM, Darin Adler da...@apple.com wrote:

 
 On Jan 11, 2014, at 3:36 PM, Maciej Stachowiak m...@apple.com wrote:
 
 
 Ideally it should be USE(THE_SPECIFIC_FRAMEWORK_IN_QUESTION). I would guess 
 that much of PLATFORM(MAC) that is valid for both Mac and iOS should 
 actually be USE(FOUNDATION). PLATFORM really shouldn't be used for things 
 other than terminal platform names. USE(COCOA) would be an ok stopgap if 
 sorting down to more specific conditionals delays this cleanup too much.
 
 Sorting down to specific conditionals will definitely delay the cleanup too 
 much!
 
 Thinking about USE(FOUNDATION) and looking at code it’s clear that the Mac 
 and iOS ports have a lot more in common than Foundation. I saw that looking 
 at PLATFORM(MAC) code snippets.

I saw that too after looking at more.

 But as long as we’re going to have something incorrect as a first 
 approximation, I don’t think that incorrect uses of USE(FOUNDATION) are 
 significantly worse than incorrect uses of USE(COCOA). If long term there is 
 not supposed to be such a thing as USE(COCOA), then I would hate to add it 
 and then have to remove it later.
 
 It remains clear to me that a valuable and quick first step is to 
 mechanically change PLATFORM(MAC) to BAR, and I am OK with BAR being 
 USE(FOUNDATION), USE(COCOA), or PLATFORM(COCOA).
 
 I am sure there is a lot of easy refinement we can do immediately after. For 
 example, we can change BAR  !PLATFORM(IOS) back to PLATFORM(MAC), if we 
 can’t find an even better conditional. Maybe our first step can even be 
 clever and not ever change such things to BAR, as suggested by Dan.
 
 I’d like to play the numbers game, so if our best guess is that most 
 PLATFORM(MAC) should be USE(FOUNDATION), I would choose that for BAR.

After thinking about it a bit - USE(COCOA) (or for that matter even 
PLATFORM(COCOA)) might be better as a first cut. Since it's not supposed to 
exist at all long term, it makes for an easy number to drive to zero. 
USE(FOUNDATION) will mix both correct and incorrect uses so it will be harder 
to drive the mistaken applications to zero.

Regards,
Maciej

___
webkit-dev mailing list
webkit-dev@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-dev


Re: [webkit-dev] Rename PLATFORM(MAC) to PLATFORM(COCOA)?

2014-01-11 Thread Eric Wing
On 1/11/14, Maciej Stachowiak m...@apple.com wrote:

 On Jan 11, 2014, at 3:50 PM, Darin Adler da...@apple.com wrote:


 On Jan 11, 2014, at 3:36 PM, Maciej Stachowiak m...@apple.com wrote:


 Ideally it should be USE(THE_SPECIFIC_FRAMEWORK_IN_QUESTION). I would
 guess that much of PLATFORM(MAC) that is valid for both Mac and iOS
 should actually be USE(FOUNDATION). PLATFORM really shouldn't be used for
 things other than terminal platform names. USE(COCOA) would be an ok
 stopgap if sorting down to more specific conditionals delays this cleanup
 too much.

 Sorting down to specific conditionals will definitely delay the cleanup
 too much!

 Thinking about USE(FOUNDATION) and looking at code it’s clear that the Mac
 and iOS ports have a lot more in common than Foundation. I saw that
 looking at PLATFORM(MAC) code snippets.

 I saw that too after looking at more.

 But as long as we’re going to have something incorrect as a first
 approximation, I don’t think that incorrect uses of USE(FOUNDATION) are
 significantly worse than incorrect uses of USE(COCOA). If long term there
 is not supposed to be such a thing as USE(COCOA), then I would hate to add
 it and then have to remove it later.

 It remains clear to me that a valuable and quick first step is to
 mechanically change PLATFORM(MAC) to BAR, and I am OK with BAR being
 USE(FOUNDATION), USE(COCOA), or PLATFORM(COCOA).

 I am sure there is a lot of easy refinement we can do immediately after.
 For example, we can change BAR  !PLATFORM(IOS) back to PLATFORM(MAC), if
 we can’t find an even better conditional. Maybe our first step can even be
 clever and not ever change such things to BAR, as suggested by Dan.

 I’d like to play the numbers game, so if our best guess is that most
 PLATFORM(MAC) should be USE(FOUNDATION), I would choose that for BAR.

 After thinking about it a bit - USE(COCOA) (or for that matter even
 PLATFORM(COCOA)) might be better as a first cut. Since it's not supposed to
 exist at all long term, it makes for an easy number to drive to zero.
 USE(FOUNDATION) will mix both correct and incorrect uses so it will be
 harder to drive the mistaken applications to zero.

 Regards,
 Maciej

 ___
 webkit-dev mailing list
 webkit-dev@lists.webkit.org
 https://lists.webkit.org/mailman/listinfo/webkit-dev


I'm new here, so sorry if I’m intruding since I don’t have much of a
stake in this outcome, but USE(COCOA) then seems to imply to me that
you need to also have a USE(COCOATOUCH). It so, then maybe it should
be AppKit vs. UIKit instead for more clarity.

There is another potential case where you have an Obj-C framework
environment that is not Apple’s. I’ll cite GNUStep and Apportable as
two cases. The former provides a Cocoa (AppKit) compatible
implementation but tends to run on Linux or Windows. The latter
provides a UIKit compatible implementation and tends to run on
Android.

This asks the question, do you really mean Mac vs. iOS, or AppKit vs.
UIKit, or something else?

Thanks,
Eric
-- 
Beginning iPhone Games Development
http://playcontrol.net/iphonegamebook/
___
webkit-dev mailing list
webkit-dev@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-dev


Re: [webkit-dev] Rename PLATFORM(MAC) to PLATFORM(COCOA)?

2014-01-11 Thread Benjamin Poulain
On 1/11/14, 8:49 PM, Eric Wing wrote:
 On 1/11/14, Maciej Stachowiak m...@apple.com wrote:

 On Jan 11, 2014, at 3:50 PM, Darin Adler da...@apple.com wrote:


 On Jan 11, 2014, at 3:36 PM, Maciej Stachowiak m...@apple.com wrote:


 Ideally it should be USE(THE_SPECIFIC_FRAMEWORK_IN_QUESTION). I would
 guess that much of PLATFORM(MAC) that is valid for both Mac and iOS
 should actually be USE(FOUNDATION). PLATFORM really shouldn't be used for
 things other than terminal platform names. USE(COCOA) would be an ok
 stopgap if sorting down to more specific conditionals delays this cleanup
 too much.

 Sorting down to specific conditionals will definitely delay the cleanup
 too much!

 Thinking about USE(FOUNDATION) and looking at code it’s clear that the Mac
 and iOS ports have a lot more in common than Foundation. I saw that
 looking at PLATFORM(MAC) code snippets.

 I saw that too after looking at more.

 But as long as we’re going to have something incorrect as a first
 approximation, I don’t think that incorrect uses of USE(FOUNDATION) are
 significantly worse than incorrect uses of USE(COCOA). If long term there
 is not supposed to be such a thing as USE(COCOA), then I would hate to add
 it and then have to remove it later.

 It remains clear to me that a valuable and quick first step is to
 mechanically change PLATFORM(MAC) to BAR, and I am OK with BAR being
 USE(FOUNDATION), USE(COCOA), or PLATFORM(COCOA).

 I am sure there is a lot of easy refinement we can do immediately after.
 For example, we can change BAR  !PLATFORM(IOS) back to PLATFORM(MAC), if
 we can’t find an even better conditional. Maybe our first step can even be
 clever and not ever change such things to BAR, as suggested by Dan.

 I’d like to play the numbers game, so if our best guess is that most
 PLATFORM(MAC) should be USE(FOUNDATION), I would choose that for BAR.

 After thinking about it a bit - USE(COCOA) (or for that matter even
 PLATFORM(COCOA)) might be better as a first cut. Since it's not supposed to
 exist at all long term, it makes for an easy number to drive to zero.
 USE(FOUNDATION) will mix both correct and incorrect uses so it will be
 harder to drive the mistaken applications to zero.

 Regards,
 Maciej

 ___
 webkit-dev mailing list
 webkit-dev@lists.webkit.org
 https://lists.webkit.org/mailman/listinfo/webkit-dev

 
 I'm new here, so sorry if I’m intruding since I don’t have much of a
 stake in this outcome, but USE(COCOA) then seems to imply to me that
 you need to also have a USE(COCOATOUCH). It so, then maybe it should
 be AppKit vs. UIKit instead for more clarity.

Here Cocoa implies both Cocoa and Cocoa Touch.

 There is another potential case where you have an Obj-C framework
 environment that is not Apple’s. I’ll cite GNUStep and Apportable as
 two cases. The former provides a Cocoa (AppKit) compatible
 implementation but tends to run on Linux or Windows. The latter
 provides a UIKit compatible implementation and tends to run on
 Android.

There is not port of WebKit for GNUStep. Consequently, it does not
impact design decisions.

 This asks the question, do you really mean Mac vs. iOS, or AppKit vs.
 UIKit, or something else?

Something else :)

The name suggested here is for all the code that is common between OS X
and iOS, but not related to the Darwin Kernel.

IMHO, COCOA is an improvement over PLATFORM(MAC).

Benjamin



signature.asc
Description: OpenPGP digital signature
___
webkit-dev mailing list
webkit-dev@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-dev