Live data from Hacker News

Swift Ported to Android

github.com

21–30 of 153 posts

Re: Swift Ported to Android

#21
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!

Swift 3 is expected later this year with a fixed ABI. Once that happens we will start to see Swift-only APIs being made available for iOS frameworks.

Most of the existing apps aren't written in Swift because they predate Swift's creation. The balance will change over time.

Re: Swift Ported to Android

#22
post #10

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

Android uses Bionic libc which has its quirks. The Android kernel also has several patches that were at one time quite controversial, though many have moved upstream to the mainline.

Re: Swift Ported to Android

#23
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?

This was my thought. What is Microsoft's answer to Swift?

Re: Swift Ported to Android

#24
post #12

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).

> 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

Re: Swift Ported to Android

#25
post #10

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

Android uses Bionic libc which has its quirks. The Android kernel also has several patches that were at one time quite controversial, though many have moved upstream to the mainline.

Its not just quirks, but bionic doesn't support all the libc apis. For example, bionic does not support pthread_cancel.

Re: Swift Ported to Android

#26
post #2

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

I would expect this just to be basic Swift support including -perhaps- the Foundation library (String, Array and other "low level" functionality). I don't think this Swift port has currently any easy way to create apps with a graphical user interface using some sort of Java bridge. So compared to Xamarin, using Swift for Android apps would be pretty limited.

But please correct me if I'm wrong.

Re: Swift Ported to Android

#27
post #2

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

People focus far too much on different languages. The fact that Android and iOS have very different UI libraries is usually a much bigger problem.

Xamarin's big selling point is a cross platform ui library.

Re: Swift Ported to Android

#28
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…

You are correct but part of the work being done to get .NET native working is the aot compilation. https://blog.rendle.io/what-ive-learned-about-dotnet-native/

Re: Swift Ported to Android

#29
post #26
post #2

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

I would expect this just to be basic Swift support including -perhaps- the Foundation library (String, Array and other "low level" functionality). I don't think this Swift port has currently any easy way to create apps with a graphical user interface using some sort of Java bridge. So compared to Xamarin, using Swift for Android apps would be pretty limited. But please correct me if I'm wrong.

Swift String, Array, etc. are not part of Foundation, they are part of the swift runtime library. They have mechanisms for converting to and from NSArray/NSString representations, though (and because of that, their internal structure is quite similar). But that mechanism is disabled in Linux (and obviously I assume Android).

Re: Swift Ported to Android

#30
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?

it's worth also asking:

How much does licensing a set of Windows keys run?

How does the .NET GC impact me versus Swift's ARC?

How much RAM does Visual Studio eat up after you've been coding for a while?

How slow, unresponsive or buggy is it these days?

of course there's "ecosystem creep"... If I'm going C# on mobile, I'll naturally be influenced to consider C# on the server... how much do Windows servers cost? and since they're a "first class citizen" on windows, what about SQL Server?

Post reply on HN