News for hackers. Stuff that matters.
Re:Apple’s use of Swift and SwiftUI in iOS 15 by auggierose on Monday December 20, 2021 @07:07AM (#29623943)
Swift is designed to be a lock-in to Apple development for Apple. If it was otherwise, why WOULDN'T you also provide compilation to Wasm and Javascript, etc., if you are a company with the resources of Apple? Don't get me wrong, Swift is great, but it is a big lock-in.

I have programmed for the last 4 years or so almost exclusively in Swift, but I am now switching to TypeScript in general. Writing my libraries in TypeScript, I will still be able to access them from Swift and other languages via embedded browser engines.

Re:Apple’s use of Swift and SwiftUI in iOS 15 by tasogare on Monday December 20, 2021 @10:37AM (#29626061)
> why WOULDN'T you also provide compilation to Wasm and Javascript

Because it's useless save for a single kind of development (websites) and the main issue is not even in spitting out WASM but making the language runtime and libraries work in the browser. Most languages have no first-party WASM or Typescript support either.

Re:Apple’s use of Swift and SwiftUI in iOS 15 by auggierose on Monday December 20, 2021 @10:57AM (#29626284)
Yes, because those other languages are made by other companies with equally vested lock-in aspirations.

You are right, Apple has no interest in supporting Javascript, what good would it do them except more work and hassle?

It would help many programmers though, to make their code more portable and available on more platforms. It would not be that easy to do, but also not that difficult. Rust is supporting WASM, Scala is supporting Javascript. Kotlin as well. Apple can't do it? Come on.

Just stating the obvious: The interests of Apple and programmers are aligned in some aspects, and opposed in others.