Live data from Hacker News

Swift Ported to Android

github.com

31–40 of 153 posts

Re: Swift Ported to Android

#31
post #24
post #12

Earlier quoted context omitted.

> C# benefits from the whole Microsoft ecosystem, which includes Visual Studio. Both good and bad. Visual Studio isn't cross-platform, for example.

Well, Visual Studio Code[1] is, so it may be coming in the future. 1: https://www.visualstudio.com/en-us/products/code-vs.aspx

They're entirely different products, Code is built from the ground up. So I'm not sure it makes a cross-platform Visual Studio more likely.

Re: Swift Ported to Android

#32
post #2

Interesting, in the context of Xamarin acquisition by Microsoft. Swift can very well spoil C#'s steam.

Swift isn't a significant improvement over C#. Also, keep in mind that C# benefits from the whole Microsoft ecosystem, which includes Visual Studio. Beyond the language, what's even more important is the application model. That's where frameworks like React Native have the edge. This might change if Microsoft upgrades Xamarin.Forms into full-blown Universal Windows App support (think WPF on iOS and Android).

React Native is not even on the horizon.

Re: Swift Ported to Android

#33
post #18

Earlier quoted context omitted.

Swift isn't a significant improvement over C#. Also, keep in mind that C# benefits from the whole Microsoft ecosystem, which includes Visual Studio. Beyond the language, what's even more important is the application model. That's where frameworks like React Native have the edge. This might change if Microsoft upgrades Xamarin.Forms into full-blown Universal Windows App support (think WPF on iOS and Android).

You might just be looking at the language from a syntax perspective. However the two are very different in the way that you compile and run them. In C# the code is translated into a custom bytecode (IR) and then the CLR is used to execute that and manage the memory through GC. In Swift's case it compiles down to native processor code instructions and can have optimisations applied ahead of time. This allows the app t…

C# has always had support to AOT to native code since the early days via ngen. The only issue was that more effort was spent in the JIT compiler and ngen requires dynamic linking.

C# is compiled to native code on Windows Phone since version 8.

The C# extensions for Singularity (Sing#) and Midori (System C#) generate static binaries. Work which served as starting point to MDIL on WP 8.x and .NET Native.

The new .NET Native compiler even exposes SIMD.

Mono also supports AOT compilation since a long time.

As always language != implementation.

Re: Swift Ported to Android

#35
post #10

Why Android requires special support? Isn't it just linux with quite standard libc and ABI to interact with Java counterpart?

No, for example UNIX IPC isn't available.

Google has ripped most of the stuff they see as fluff for Android.

Edit: Any C and C++ API not listed as stable and public on the NDK docs is not guaranteed to exist in all devices.

Re: Swift Ported to Android

#37
post #9
post #6

Earlier quoted context omitted.

What?

Wasn't a very useful comment, but what I think he/she meant was that Apple doesn't actually use Swift much in its own apps: http://appleinsider.com/articles/16/01/18/apple-making-spars... A lot of devs take this to mean Swift should be avoided for now. Edit: To be clear, I don't agree with this sentiment! Swift is awesome. Just trying to clear up the parent comment's confusion!

WWDC app was done in Swift, IIRC. Not the core app by any means, but still.

Re: Swift Ported to Android

#38
post #14

Earlier quoted context omitted.

Swift isn't a significant improvement over C#. Also, keep in mind that C# benefits from the whole Microsoft ecosystem, which includes Visual Studio. Beyond the language, what's even more important is the application model. That's where frameworks like React Native have the edge. This might change if Microsoft upgrades Xamarin.Forms into full-blown Universal Windows App support (think WPF on iOS and Android).

How much RAM does a single hello world take in C#? How much time does it take to create a thread in mono on my Linux VM? How much does it cost a license for Visual Studio?

> How much does it cost a license for Visual Studio?

Free if your revenue is under $1m, then $40/month including CI, source hosting and issue tracker.

Re: Swift Ported to Android

#39

UI in Swift is heavily tied to Cocoa, right? What tools exist to draw UI in Swift on another platform?

Swift doesn't have the slightest concept of UI. If you want to do UI work in Swift, you use whatever UI frameworks are available on your target platform. Since Swift interoperates very nicely with C and Objective-C, those frameworks can be written in those languages and still be usable from Swift. On OS X the framework happens to be Cocoa, but Swift isn't in any way tied to it.

On Android, Swift will likely be in the same position as the NDK, which isn't a great place to be for UI, but it's doable. You'll be able to make the same UI calls you'd make from C code.

Re: Swift Ported to Android

#40
post #2

Interesting, in the context of Xamarin acquisition by Microsoft. Swift can very well spoil C#'s steam.

Why? Microsoft will likely offer Swift support in the UWA platform soon, they already support Objective C. I suspect they will announce Swift is now supported under project Islandwood at Build.
Post reply on HN