If it’s any help: Microsoft Visual Studio now offers C++/winrt, a pure C++ 
environment that works great. Doesn’t seem to be well-known yet but it’s 
efficient for Windows Store apps. So all our C++ code goes straight into the 
Win version.
No need for C# or C++/CX, etc.
On the Mac I use C++ too except for the UI elements in Objective-C (I don’t see 
a reason to adopt yet another platform-specific language that would require 
extensive rewriting, so I’m ignoring Swift).

Jeff

On Aug 27, 2019, at 12:03 PM, Pier Bover via Cocoa-dev 
<cocoa-dev@lists.apple.com> wrote:

Writing that logic in C seems very intimidating to be honest, but thanks
for the suggestion.

A priori I think it would be less painful to maintain two codebases in
Swift and C#.

On Tue, Aug 27, 2019 at 1:44 PM Robert Tillyard <r...@atvetsystems.com>
wrote:

> I had a UNIX project that was already in C that I ported to OS X that
> sounds similar.
> 
> It mainly consisted of a small amount of UI and some networking logic. As
> the networking was already in C I just copied the .c and .h file into my
> project and compiled it as part of the project. If the UNIX side gets
> updated I just copy the file back to OS X. I guess it depends on how
> complicated your network logic is.
> 
> The Windows guys also did the same with the Windows version.
> 
> 
> If you have to write a C bridge to Go you might find doing it all in C
> works.
> 
> Regards, Rob.
> 
>> On 27 Aug 2019, at 00:41, Pier Bover via Cocoa-dev <
> cocoa-dev@lists.apple.com> wrote:
>> 
>> Hi all
>> 
>> In a couple of months I'll be starting a macOS Swift 5 project and if
>> possible I'd like to separate as the business networking logic so that it
>> can be reused in a Windows app in the future.
>> 
>> Ideally I'd want to statically link the library but I've also considered
>> using dynamic libraries, or even include binaries in my app and execute
>> them via Process().
>> 
>> I've considered a multitude of corssplatform options (JVM, QT, Xamarin,
>> etc) but quite frankly I'd rather maintain one codebase per platform than
>> use one of those which could introduce more problems than they solve.
>> 
>> I'd prefer avoiding C++ if possible. My first choice would have been
> using
>> Go which can compile to .so shared objects but Xcode cannot use those
>> without some bridge written in C. I've read Rust can compile to a dylib
> for
>> Xcode.
>> 
>> Has anyone any recommendations or tips to share?
>> 
>> Thanks in advance.
>> 
>> Pier
> 
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/jevans%40ars-nova.com

This email sent to jev...@ars-nova.com


_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to