Re: Thoughts on ARC
Re: Thoughts on ARC
- Subject: Re: Thoughts on ARC
- From: Robert Walsh via Cocoa-dev <email@hidden>
- Date: Mon, 30 Sep 2019 15:16:00 +0000
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=envisionware.com; dmarc=pass action=none header.from=envisionware.com; dkim=pass header.d=envisionware.com; arc=none
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=tm/ORUuC/ivfmUfWlzED7Jc0q88ypd2yYgic5lmvmaE=; b=XT3CglgfKOzcGPcsvJfzWoy0Wv/2QInxdbNgwgME4yTgqY/LsFBdzt8dLiIVk5A71+n6DAwMhTWROD5IX1U7U4UDrn6yawdLdXxsSwBCfB1oWJuobfdi6v7aDpVHhznVLDrtL/BL8PYE/9yfOOPsX/viiAjMWc5w9YlID2elbUvt+jBJ+eDL76mSWOLOwkEeaX8b55Cod2d/1x7+36qUN3n69zYLCam4WBbT4LQVcPBzEAgEuGMdmgj6uLxWtct5wtSIaRS1CA6hiR1g+F5wKvrqPbpgCwvpKv37F9YdF0YzjZNFVVLCFcg+UEgAw5Geidn6lu+1oB67+TC1600EhA==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JHzgN8d9IbA/id4deFO5yesuStb8wdv5sz2jRhRGBJbMB6wBLaXr+tO8nvSEjna9jV930OvPFj8Fj6aJuwO2TkXRrx6USFKC8UG1nUiieeVkuDm3qNzsJ27DLKkKcjM1+CltPd64p2k69GBGj7gCveIfq9vbyFWxWb1OMMH2QG2gXEFErQJbAh2ZZDlfQcZIKhY9L2CgZ4OfucajeLeoKlX38mws052enWYJ+Gtg2bwPGu5Ksk173Q08F8hXXeksEIJzV5orR1peZ1HwDPNQNf8A8UpxUrPQQE8+4yytuNcORZa3kofsWBjIhUdLt+UQOr4zRMlylFu7zA64ZLDu0Q==
- Thread-topic: Thoughts on ARC
Swift may be the solution, but it's built on a weak foundation. It makes
cross-platform development almost impossible. The TIOBE index shows Swift
declining (and Objective-C increasing). So, maybe it isn't.
I don't yet have a lot of experience with Swift, but I would already argue that
Swift is not the solution. Swift is cool and has some really neat features
that make for good presentations and blog posts (where the real-world issues
and constraints associated with interfacing to other systems, particularly
older ones that do not use HTTP, can be minimized or eliminated entirely);
however, to use it to do anything other than building a desktop or IOS GUI
application seems to result in code with messy syntax and what seem to me to be
hacks in order to bridge between NS* and CG* code. (Lots of casts and strange
machinations for massaging pointers.) I'm in the process of converting an
application written in C++ using an older version of Qt because the Qt code
relies on Carbon (which has been removed from Catalina). The new code is in
Swift. I've written and maintained code that uses UNIX-style C sockets for
many years, but finding a native approach for plain sockets in Swift was very
difficult. There appears to be good support for async HTTP communication, but
not much for socket-based TCP. I found some examples on the web that were
built around Grand Dispatch, but that feels clunky in a command-line
application. Further, the many versions of Swift complicate the examples; if
the example code was written in Swift 2 or Swift 3, it may require non-trivial
modification to work in Swift 5 without compiler errors and warnings. I've
settled on using a library from IBM called BlueSocket with a thin wrapper
around it, and that seems to be working for me for now. However, even using
the command line tools (swift package) for creating and managing an XCode
project with external library dependencies has been for me a challenge. XCode
and the packaging framework seem to be fighting over control of the project's
structure, and going back and forth between them (and regenerating the XCode
project each time) is tedious. But then maybe I'm just not using the tools
correctly.
Also, as you've said Swift makes cross-platform development nearly impossible
because, even though Swift itself is available on other platforms, the
pre-built components that prevent the developer from having to reinvent every
wheel from scratch are not. This app I am rewriting _was_ cross-platform when
it was built with Qt, but it will no longer be when we rework it for Swift.
(And we are motivated to use Apple's "approved" language and tools in order to
be eligible for developer support in the event that we need it. Our experience
has been that they will not help, even with an Apple Developer subscription, if
the app is in pure C/C++ or Java or anything but Swift or Objective-C.)
It could simply be that Swift is the wrong tool for my current task. However,
I'm not sure what would be. This could be done in Java or Python or Javascript
with Node or any number of other mature, cross-platform options, but those
aren't really welcome as first-class citizens in the Mac app space (or at least
result in solutions that potentially require a lot of manual intervention on
the part of the user). It could also be done in pure C, but that seems like a
step backwards.
I'm not down on Swift; as I said, I think it has some really neat features and
constructs, and I'm sure that making a desktop or IOS GUI application is its
sweet spot. I just wish there was a solid option for those applications (or
application components) that are outside that sweet spot.
Rob Walsh
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
References: | |
| >Thoughts on ARC (From: Turtle Creek Software via Cocoa-dev <email@hidden>) |