News for hackers. Stuff that matters.
Re:Apple is rewriting Foundation in Swift by lyu07282 on Sunday May 21, 2023 @11:00PM (#36026969)
If they just had a proper cross platform standard library and package manager it might be more successful, it is a pretty cool language. But the north Korean esque closed apple ecosystem makes that impossible, all of that is intentional.
Re:Apple is rewriting Foundation in Swift by pilif on Sunday May 21, 2023 @11:08PM (#36027015)
The package manager has been open source, cross platform and available since pretty much from the start.

The standard library is becoming cross-platform as we discuss it here.

Re:Apple is rewriting Foundation in Swift by realusername on Monday May 22, 2023 @03:42AM (#36028497)
> The standard library is becoming cross-platform as we discuss it here.

I'd argue that it's too late already, the ship has sailed, Swift is heading the same way as C#.

Re:Apple is rewriting Foundation in Swift by qaq on Monday May 22, 2023 @04:37AM (#36028818)
Is there an alternative with similar features and ergonomics? I am def. not aware of one.
Re:Apple is rewriting Foundation in Swift by realusername on Monday May 22, 2023 @05:26AM (#36029089)
For which purpose? It depends what you want to do with it.
Re:Apple is rewriting Foundation in Swift by qaq on Tuesday May 23, 2023 @09:04AM (#36043663)
Well lang features do not really depend on the purpose the 3d party libs do. Let's say the purpose is web services.
Re:Apple is rewriting Foundation in Swift by realusername on Tuesday May 23, 2023 @10:29AM (#36044849)
I doubt the web story in swift is that strong anyways, I'd pick python, ruby or php.
Re:Apple is rewriting Foundation in Swift by ohgodplsno on Monday May 22, 2023 @09:37AM (#36031313)
I'm having a hard time seeing Swift becoming a well-respected and easily considered language for your next project. The sheer lack of anything outside of what Apple has made already makes it a non starter. In comparison, .Net is absolutely amazing.
Re:Apple is rewriting Foundation in Swift by nequo on Sunday May 21, 2023 @11:16PM (#36027062)
Why is it not better for Apple to make Swift truly cross-platform?

Is it just that the maintenance cost is not worth it? Or would it threaten its ecosystem in a way that I don't understand?

It would seem that making Swift cross-platform would make Apple's ecosystem more accessible to developers. The barrier to entry would be lower if developers only needed to learn the APIs and not a whole new language and its tooling too. This would help the ecosystem stay healthy for a longer time.

Re:Apple is rewriting Foundation in Swift by w10-1 on Sunday May 21, 2023 @11:34PM (#36027165)
The Swift compiler and standard library are pretty tightly linked. The Swift type system is getting pretty complicated already, handling a whole range of lifetimes, async, the combination of protocols, generics, existentials, etc. with some magic handling for arrays and maps in the library. So the cost of cross-platform effort would be significant.

The greatest barrier to entry is XCode. It's archaic, impossible to extend, and has a very wide surface that would overwhelm any development team.

(Java works fine on macOS, but developers want to deploy to iOS.)

Re:Apple is rewriting Foundation in Swift by delta_p_delta_x on Monday May 22, 2023 @12:29AM (#36027466)
.NET MAUI[1] and AvaloniaUI[2] run on iOS pretty well, and one can use Rider/VS Code/other editors to develop apps.

[1]: https://learn.microsoft.com/en-us/dotnet/maui/ios/cli

[2]: https://docs.avaloniaui.net/tutorials/developing-for-mobile/...

Re:Apple is rewriting Foundation in Swift by scns on Monday May 22, 2023 @03:25AM (#36028409)
Hope this keeps getting investment and support by Microsoft. Choice and competition are very welcome, even though i code neither iPhone Apps nor C# ATM.
Re:Apple is rewriting Foundation in Swift by ohgodplsno on Monday May 22, 2023 @09:39AM (#36031327)
Kotlin/Native deploys and works on iOS, but due to Apple holding back on opening up Swift, it has to do everything through ObjC interop. But make no mistake, to Apple, that's a feature: if other languages have a hard time integrating in their ecosystem, they'll go away.
Re:Apple is rewriting Foundation in Swift by pca006132 on Sunday May 21, 2023 @11:26PM (#36027119)
I thought Apple just wants to be different, and making Switft not cross platform can make porting software on Apple ecosystem harder...
Re:Apple is rewriting Foundation in Swift by MattRix on Monday May 22, 2023 @12:27AM (#36027451)
Apple’s problem has never been the “barrier to entry”. They know developers will make apps for their platform no matter what. If Swift becomes more universal it makes it easier for Apple developers to also develop for Android (etc) which Apple would see as a bad thing.
Re:Apple is rewriting Foundation in Swift by worrycue on Monday May 22, 2023 @01:07AM (#36027670)
Wouldn't developers also develop for Android no matter what?
Re:Apple is rewriting Foundation in Swift by qwytw on Monday May 22, 2023 @02:11AM (#36028009)
There are still some iOS (and especially macOS) specific apps because the cost of porting a native app is not insignificant.
Re:Apple is rewriting Foundation in Swift by scns on Monday May 22, 2023 @03:26AM (#36028416)
Some Apps are exlusive to iOs and some start out there, because that is where the money is.
Re:Apple is rewriting Foundation in Swift by raydev on Monday May 22, 2023 @10:00PM (#36038928)
Not as long as iOS users spend more money on average.
Re:Apple is rewriting Foundation in Swift by saagarjha on Monday May 22, 2023 @02:24AM (#36028098)
That has only really been the case for iOS and even then it’s not necessarily a given.