[swift-corelibs-dev] [swift-evolution] Proposal: Swift Open Source Project and Foundation replacements
Maxthon Chan
xcvista at me.com
Thu Dec 3 14:51:44 CST 2015
David
Given the fact that there are two active Foundation reimplementations out there means your Swift-only reimplementation of Foundation is reinventing wheels, in an incompatible way. (Cocoatron can at least take a few libraries from GNUstep if compiled correctly, but not this)
The silliest way of doing this is just “endorse” someone* as the official Objective-C backend for Swift anywhere outside OS X and iOS and scratch this swift-corelibs-foundation entirely. Since both GNUstep and Cocotron runs under Linux, Windows and BSD instead of just Linux outside OS X and iOS, you get extra compatibility for free, from removing instead of adding code.
* preferably GNUstep in my own opinion, since they have better library coverage and they are the team that ships libobjc2 which fully supports ARC and every single modern Objective-C feature in a code-compatible way although not ABI-compatible, and the platform barrier rendered ABI compatibility pointless anyway
> On Dec 4, 2015, at 04:37, Gregory Casamento <greg.casamento at gmail.com> wrote:
>
> David,
>
> There wouldn't be any need to do it for every platform. There is one objective-C runtime GNUstep uses for every platform it runs on. So there is no need for it to be different.
>
> Reimplementing everything in pure swift is silly because it would not allow re-use of all of the objective-c that is out there which is one of the advantages of swift in the first place.
>
>
> GC
>
> On Thu, Dec 3, 2015 at 3:32 PM, David Hart <david at hartbit.com <mailto:david at hartbit.com>> wrote:
> I also agree with Adrian. I would much prefer to see efforts put towards implementing a pure Swift foundation API than supporting a Cocoa implementation and bridge on every platform Swift will run on.
>
> On 03 Dec 2015, at 21:01, Gregory Casamento <greg.casamento at gmail.com <mailto:greg.casamento at gmail.com>> wrote:
>
>> Way ahead of you
>> On Thu, Dec 3, 2015 at 15:01 Maxthon Chan <xcvista at me.com <mailto:xcvista at me.com>> wrote:
>> Dear Swift developers:
>>
>> Maybe you have never heard of it, but there have been several ongoing efforts, like GNUstep and Cocotron, at maintaining an open source Foundation reimplementation for alternative operating systems like Linux. It seemed to me that the current release of Swift did not put such efforts into consideration and brutally broke compatibility between Swift and Objective-C on Linux. I understand the fact that Apple is unwilling to release source code of Foundation, and this is usually where those alternative implementations comes into play.
>>
>> Some of such projects, like GNUstep, are mature enough to allow existing AppKit applications written in Objective-C, like TextEdit and Chess, to be ported from OS X to Linux and Windows without changing too much, if any, code, taking all modern Objective-C features like ARC and object subscripting with stride, with a compatible version of LLVM compiler. Meanwhile, with the current version of Swift, even if the Swift code is written with calls to Objective-C runtime assuming the case on OS X, it is broken under Linux even with libobjc linked in.
>>
>> I am here suggesting keeping the Objective-C bridge intact at least when built with a compatible version of libobjc (and GNUstep project have one already.) This will allow users of such alternative Foundation reimplementations to use their favourite Foundation distribution in place of the version provided by the Swift project, retaining the code compatibility already established between OS X and Linux by those Swift reimplementations.
>>
>> In such an environment the alternative Foundation implementation will provide their own version of CoreFoundation and Foundation, implemented using C and Objective-C, as well as a libobjc that supports ARC. The Swift environment would be built without its own CoreFoundation and Foundation, but linking against the provided version instead, bridging calls just like OS X version of Swift does. This will also allow the new Swift platform to take full advantage of the AppKit came with the alternative Foundation, allow porting full OS X apps to Linux a lot easier. The above also applies for porting iOS apps, if the alternative Foundation implementation also comes with their own UIKit.
>>
>> Max_______________________________________________
>> Gnustep-dev mailing list
>> Gnustep-dev at gnu.org <mailto:Gnustep-dev at gnu.org>
>> https://lists.gnu.org/mailman/listinfo/gnustep-dev <https://lists.gnu.org/mailman/listinfo/gnustep-dev>
>>
>> _______________________________________________
>> swift-evolution mailing list
>> swift-evolution at swift.org <mailto:swift-evolution at swift.org>
>> https://lists.swift.org/mailman/listinfo/swift-evolution <https://lists.swift.org/mailman/listinfo/swift-evolution>
>
>
>
> --
> Gregory Casamento
> GNUstep Lead Developer / OLC, Principal Consultant
> http://www.gnustep.org <http://www.gnustep.org/> - http://heronsperch.blogspot.com <http://heronsperch.blogspot.com/>
> http://ind.ie/phoenix/ <http://ind.ie/phoenix/>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-corelibs-dev/attachments/20151204/adc5b570/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4097 bytes
Desc: not available
URL: <https://lists.swift.org/pipermail/swift-corelibs-dev/attachments/20151204/adc5b570/attachment.p7s>
More information about the swift-corelibs-dev
mailing list