6 ms·
Swift was not given the chance to prove itself as a language
- Someone 3y ago> “Do the benefits you intend to add outweigh these downsides.” Or does there exist some other language that gets it close enough, plus has decades of work and stability going for it? The fact that Apple kept this thing to such a small number of people before announcing it leads me to believe they never even considered this sort of analysis. I don’t see how that follows, and think it isn’t true. They wanted [1] a) a modern safe approachable [2] language b) with excellent interoperability with their Objective-C code, so that it could gradually replace it. c) that’s at least as time and space efficient as the Objective-C/C/C++ combo. d) that they have control over. d) alone implies they needed a new language, but even ignoring d), what were their options? The ‘approachable’ in a) (IMO) rules out languages like rust (which also didn’t exist yet), b) implies they needed reference counting and strong typing, c) rules out anything interpreted or JVM-based. [1] https://www.swift.org/about https://www.swift.org/about doesn’t mention most of these, but I don’t think that makes it untrue. [2] I think they got that only partially. Swift looks like a simple language, but is not one (anymore)
- dangus 3y agoYeah, I don’t really know what the author expected Apple to do with the options they had. They couldn’t have used an existing language without some serious compromises. The solution didn’t exist. The only choice was to go into uncharted territory. > Swift didn't have to "earn" its place, prove that its benefits outweighed its downsides. The writing was on the wall, Apple was saying this is the future, which threw the entire community in to chaos Italicized emphasis mine…I think that saying that the community was thrown into chaos is a bit of a stretch and a dramatization. There was no rug pull, you can still make Objective-C apps if you want to.
- paulddraper 3y agoWhat would be the serious compromise with using Go?
- randomdata 3y agoThe serious compromise every other language had is no great way to send Objective-C messages. You can monkey around with objc_msgSend in pretty much any language, but that’s not exactly ergonomic for developers. You would struggle to convince developers that is an improvement over simply using Objective-C. Is there something about Go that improves on that problem?
- randomdata 3y agoThe author was involved in the creation of Objective-J. It would be interesting to hear about how he saw it meeting his criteria.
- troupo 3y ago> There was no rug pull, you can still make Objective-C apps if you want to. This was an exaggeration, for sure, but there was uncertainty: it wasn't a given that Apple would keep spending time on Objective-C and related libraries. Apple is well known for killing things, even long-established ones.
- paulddraper 3y agoJVM based is clearly possible, as the most popular mobile OS the world uses it, and on far less capable devices. But even if you ignore that, there were plenty of choices: Go, D, Nim. The key criteria was control.
- adrianmsmith 3y agoBut JVM, Go, D and Nim don't have > b) with excellent interoperability with their Objective-C code, so that it could gradually replace it.
- Someone 3y ago> JVM based is clearly possible, as the most popular mobile OS the world uses it, and on far less capable devices. The gap seems to have been closed somewhat, but RAM-wise I don’t think top of the line Android devices ever were far less capable, likely not even less capable. For example: Apple still sells the iPhone 13 with 4Gb of RAM, the iPhone 15 has 6GB, the top of the line iPhone 15 Pro Max 8GB. The Google pixel 8 has 8GB, the Pixel 8 Pro 12GB RAM, and those aren’t the devices with the highest amount of RAM you can buy. Having less RAM translates into having better standby time for the same battery size, or smaller batteries for the same standby time. I think that was and is important to Apple. > But even if you ignore that, there were plenty of choices: Go, D, Nim. I don’t see any of those qualify for the criterion “Or does there exist some other language that gets it close enough, plus has decades of work and stability going for it” Go is from 2009, D technically from 2001, but in practice from 2007, when the standard library was replaced (https://en.wikipedia.org/wiki/D_(programming_language)#History https://en.wikipedia.org/wiki/D_(programming_language)#Histo...), NIM from 2008.
- paulddraper 3y ago> I don’t think top of the line Android devices ever were far less capable I emphasized the relevant part of your statement. It's the bottom of the line Android devices that fall into the "far less capable" category > decades of work and stability Swift doesn't satisfy that criterion either. That's a no true scotsman.
- steeve 3y agoAll I’ll say is: “Expression too complex to be evaluated in reasonable time” Those who know, know.
- mathgeek 3y agoCare to explain it for the sake of discussion?
- bigyikes 3y agoSwift static analysis can be painfully slow, sometimes to the point where the analyzer literally just gives up.
- jwells89 3y agoThis was much more of a problem early on though, and while it’s still possible to encounter it’s relatively infrequent and can usually be avoided.
- steeve 3y agoI just got it on an infix expression with 5 elements and 2 casts (center an image in a rectangle type of thing, height/2 blahblah). Unfrequent is not how I would describe it.
- karmakaze 3y agoHere's what Wikipedia says about the creator of the language. > Christopher Arthur Lattner (born 1978) is an American computer scientist, former Google and Tesla employee and co-founder of LLVM, Clang compiler, MLIR compiler infrastructure and the Swift programming language. I have the sense that he and Apple knew exactly what they were doing. Using something established comes with it's own baggage and risks. It's times like this I wish HN had 'fact-check' flagging for posts.
- AtlasBarfed 3y agoDid I miss something? Is swift being moved away from by Apple?
- CharlesW 3y agoYou didn’t miss anything, and Apple continues to be committed to Swift for development on Apple platforms for the foreseeable future
- troupo 3y agoJust the fact that Lattner to create the language doesn't mean that the language had the chance to prove its worth. It was mandated from above. > It's times like this I wish HN had 'fact-check' flagging for posts. What exactly is not factual about the post?
- randomdata 3y agoThe idea that he follows the litmus test is of questionable factuality given that the author’s own Objective-J language would have failed it. It is likely that the litmus test came from his experience creating Objective-J. However, the Swift project began in the same timeframe, so even if we understand these things now, Objective-J shows that we didn’t back then.
- troupo 3y ago> given that the author’s own Objective-J language would have failed it. Did the author mention Objective-J? > It is likely that the litmus test came from his experience creating Objective-J. So, your "fact check" is "it is likely"?
- deleted 3y ago[deleted]