18 ms·
Apple’s use of Swift in iOS 12
- flocial 8y agoWould be nice to know what share of total binaries that represents. On a side note, iOS 12 was great but seems riddled with memory leaks that eventually require a reboot every few days.
- greatquux 8y agoI haven't rebooted in the week I've been running it. Probably a specific app.
- saagarjha 8y agoThere are thousands of binaries in iOS 12, so this is at most a couple percent.
- alphabettsy 8y agoI’ve been running iOS 12 since the early betas and only rebooted for OS updates. Sure it’s not an app or something?
- flocial 8y agoThere's one particular mobile game that is suspicious... However, this issue was nonexistent with iOS 11. The memory diagnostic app shows the "Other" section constantly growing and not being released.
- saagarjha 8y ago> The memory diagnostic app shows the "Other" section constantly growing and not being released. Are you sure you're not talking about storage space? I don't know what memory diagnostic app you're talking about.
- peter_tonoli 8y ago> The memory diagnostic app shows the "Other" section constantly growing and not being released. Sure it's not 'the memory diagnostic app' that's wrong?
- aaaaaaaaaab 8y ago>memory diagnostic app Don’t forget to update your anti-virus too!
- RyanZAG 8y agoIf an app (even badly coded) causes memory leaks in the OS, that's a fault of the OS still. Of course fast moving OSes like Android or iOS are always going to have these kinds of bugs and it's probably not related to Swift as Swift isn't used in the kernel internals.
- coldtea 8y ago>If an app (even badly coded) causes memory leaks in the OS, that's a fault of the OS still. How's that so? An app doesn't have to leak OS memory, just leak its own memory.
- saagarjha 8y agoWell, leaking kernel memory is very different than leaking application memory, because one can be paged out while the other is wired permanently.
- vardump 8y agoWired? All memory is always physically wired to the motherboard. It's unsafe for the kernel to swap the memory out, because paging doesn't (usually) work while running kernel code.
- saagarjha 8y agoWired as in not swappable.
- vardump 8y agoI write kernel mode drivers as my day job, and this is certainly the first time I've ever heard of non-swappable being called "wired". It might be called "non-pageable", "pinned", "non-swappable", etc. Out of those, I'd prefer "non-pageable", because it's the most descriptive term for it. Non-standard terminology is not great for communication.
- ninjakeyboard 8y agoWhether related to an app or solely to the OS, as well tested internally as new releases may be, it's still a new major release. Things'll iron out soon enough I'm sure. Love, - guy who writes software and knows that all software is terrible
- xab9 8y agoAll software is terrible and not all bugs will be (or can be) ironed out. It really amazes me how people are always forming ideological groups - C vitamin is the best cure for everything. C vitamin is useless, just forget it. iOS has memory leaks. No, you are holding it wrong, iOS 12 is good. And here at least we are a techy bunch, but outside the tech circle, how people treat software is just astonishing. Like the guy who made photographs sitting on the passenger seat, because his Tesla is a full autonomous car and it is perfectly capable of driving by itself.
- dpkonofa 8y agoHave had it since release and iOS 12 is faster for me than iOS 11. Nothing but good things to say about this release. I'll jump on the "are you sure it's not an app" train.
- stiGGG 8y agoI've only noticed some UI glitches in some of the apps i am using including ones i personally developed. I can only speak for the later, but it was due to scruffy code which never should have worked as expected.
- dpkonofa 8y agoI saw a small glitch where Apple Pay was offered as an auto-complete on the predictions bar in the 3rd slot but the actual auto-complete prediction was also in the same slot so the two things were on top of each other. Not sure if that was in the app or what but that's the only issue that I've personally seen so far since release.
- jtbayly 8y agoI haven’t noticed memory leaks, but I haven’t been checking. What I’ve noticed is that everything is faster. Until it suddenly isn’t. And then swiping between home screen pages takes approximately one full second and only shows one intermediate animation frame. In other words, it suddenly is unusable. Background app chewing up resources? No idea. I just know it didn’t do it in iOS 11. Oh, and this was throughout the beta. It’s been decreasing as time goes on though.
- thelastidiot 8y agoA bit useless. Are they using it in the top ten (mail, web, cal, clock, etc.)? How much of Swift compared to ObjC code? Those are the real answers I would expect to read in your article.
- coldtea 8y agoAnd all those answers are IN the article. >Are they using it in the top ten (mail, web, cal, clock, etc.)? No. >How much of Swift compared to ObjC code? Much less. It makes sense too. You don't rewrite perfectly good programs in a new language just for the fun of it.
- sigjuice 8y agoApps that predate Swift will likely contain little to no Swift. There is no good reason for it to be otherwise.
- ericlewis 8y agodock is one of the oldest apps on macOS, was rewritten in swift when it was announced.
- jernfrost 8y agoI rewrote a commerical app to Swift and saw a lot of advantages. The rewrite uncovered a number of bugs due to the stricter type checking, and general strictness (no unitialized variables e.g). It also allowed us to get more people involved in development. People new to apple development found Objective-C to be a bigger barrier. Odd syntax and a bit old fashion. Mind you I quite liked Objective-C. But it seems a bit pointless when you got Swift.
- raverbashing 8y agoGlad to see Apple moving away from ObjC (when it makes sense to). This seems to contrast MS when they released .NET but shied from using it in their own systems (though I might be wrong)
- qalmakka 8y agoBecause especially in its infancy .NET was quite slow for the machines of the time (they somewhat fixed that up in later releases); it also meant a full rewrite most of the time (COM interop is well supported, but still rather nightmarish at times). Given the paramount importance Microsoft gives to back compatibility, I understand why they took their choices.
- ComputerGuru 8y agoApples and oranges. .NET is a higher-level framework for JIT languages (mainly C#). Only last two years (almost 20 years after its inception) has .NET Native come into the picture. The performance difference between the garbage collected runtime and its C predecessor was too much and initial attempts at the rewrite in C# with Longhorn were a major fail.
- sitepodmatt 8y agoThere was Paint.net, and they did use god awful WPF in Vs 2010 iirc
- ptman 8y agoIt doesn't seem to be by microsoft: https://en.wikipedia.org/wiki/Paint.net https://en.wikipedia.org/wiki/Paint.net
- imandride 8y agoYeah if your are referring to paint.net in the app store the developer is not Microsoft.
- sitepodmatt 8y agoI stand corrected, thanks
- bunnycorn 8y agoA perfectly good rooster, considering that Swift only became usable at v3.0, two years ago. I've developed since for version 1, small utilities, and even for those projects, it was not enough. Version 4 and it's my favorite language to develop for.
- jonplackett 8y agoTotally agree with this. I tried v1 and then v2 and nearly never came back because all my code broke going 1-2 and it was just generally awful. V4 is lovely though. Some people with common sense must have joined the party
- AsyncAwait 8y ago> Some people with common sense must have joined the party More likely the language just matured. I'm glad they were not afraid to iterate as it is hard to get everything right on the first try and being stuck with a suboptimal design for the next 20 years would have been much worse.
- kylnew 8y agoAgree with this comment. If you’ve watched the community work at this language it’s been a very clear and well documented process. I’ve learned a lot just by watching Swift evolve through proposals.
- pdpi 8y agoIt's funny to bring this comparison up (since Graydon is now on the Swift team), but Rust _also_ iterated like mad and took a while to mature — however, they waited until some degree of maturity before they called it 1.0, and have since been incredibly cautious about breaking changes. And they did this all of this iterating while building Servo in-house at Mozilla on the unstable version. This is, in many ways, the diametric opposite of what this thread is discussing: pushing out nominally "stable" versions to the outside world, breaking things, but not committing internally.
- elcritch 8y agoI wonder if there is a way to correlate the number of bug / issues related to binaries with Swift. It’d be interesting to see if Swift correlates positively with bugs/crashes.
- LeoNatan25 8y agoIf anything, since a lot of stuff is being rewritten from scratch, a lot of new bugs appear that were not there. At least that's my experience on the Mac with software that has been rewritten in Swift. Obviously, it's not Swift's fault for that, but even if people at Apple make rookie mistakes such as using force unwrap operator, it tells something about the language.
- the_clarence 8y agoCan you explain force unwrap? Actually I was wondering with Swift had a lot of these things I don't see much in other languages. Optionals for example. Is it because it us focused on coding highly responsive UIs where different states might not yet be available?
- saagarjha 8y agoForce unwrapping is what it sounds like: you take an optional, and forcefully convert it to a nonoptional. Obviously there must be a valid value at this point in the program, or it will crash. Optionals are useful not only for UIs, but for handling any sort of state where it's possible for something to not have a valid value at any point in time. It just hoists such a state into the type system rather than checking this at runtime.
- jernfrost 8y agoIt is not much in other languages because those languages are old. A lot of the Swift features have been in more academic functional languages for a long time. However it has taken time for the mainstream languages to adopt these ideas. The industry moves much slower than academic niche languages. But most new languages has some variant of this stuff: kotlin, scala, rust. I program a lot in Julia which is a script language and it does not have allow you to use null freely either. May seem odd for a language that does not type check at compile time. But it actually makes sense.
- nsmith14 8y agoWhat's the solitary binary that used Swift in iOS 9?
- masklinn 8y agoCalculator: https://twitter.com/jckarter/status/650142048444526593 https://twitter.com/jckarter/status/650142048444526593
- amirmasoudabdol 8y agoI assume we'll see it being more used by Apple at the system level a year or two after they got the ABI stable. Somewhere around iOS 14 or 15 maybe.
- dep_b 8y agoGiven the maturity of iOS it's not unexpected to see the uptake of Swift so slow. Though it's lacking a "total binaries" number. Swift is a great language to work in.
- sgt 8y agoI have to comment on this. Swift is one of those languages that make me look forward to opening up Xcode in order to start writing code. It's just such a fantastic language, and it's hard to explain why until you've actually started writing code in it.
- kapuru 8y agoHonestly curious: What makes it such a fantastic language?
- AsyncAwait 8y agoNot OP, but if you look at Rust, take out the borrow checker and you basically have Swift. It's a nice combination of modern OO and functional language constructs that make it easy to write elegant abstractions.
- sgt 8y agoI think optionals are my favorite feature. That may be due to me coming from a Java background (which also has optionals since 8, but I feel it's rather clumsy compared to Swift and other modern native languages). By doing optional chaining you can do something like: if let name = result.person?.firstName { ... } which only evaluates firstName if person is not nil, and then stores the result in name which is immutable. It's easier to avoid mutable code in Swift than in many other languages. For this reason I would love to start working with Swift on the backend at some point in the future. I like extensions, being able to extend any class I want by just typing it into any file I want. This helps with iterative development and trying something out. Speaking of iteratively, if I want to try something quick, I can also drop down to a shell and start the Swift REPL to experiment. I like how built-in functions like zip and mapValues are available, so it in some ways has a Pythonic feel. I like the syntax of building strings by just taking a variable name and going let s = "Hi there \(name)!". There are lots of other things I enjoy, such as subscripts (see why here: https://docs.swift.org/swift-book/LanguageGuide/Subscripts.html https://docs.swift.org/swift-book/LanguageGuide/Subscripts.h...) and Some things I would like to see improved is Xcode itself and also Swift's capabilities in the backend.
- ppeetteerr 8y agoI have been writing code for over 10 years and I can comfortably say that Swift is one of the best languages today than many other languages at a much later stage in their life (hey there Java!). I'm not talking about the standard lib, I'm talking primarily about the language and how well one can express their ideas with it without shooting oneself in the foot. The only reason I suspect that Apple is not all over Swift is that many of their programmers are the type of coders who like falling back to C when they feel they need a performance boost. Perhaps they like the message-like nature of ObjC. Dunno. I can say that I've been able to get apps to 0 fixable crashes with Swift (some crashes are system level), not something I've ever done with ObjC, let alone Java for Android.
- dieterrams 8y agoIt was a couple years ago, but I spoke with one of their engineering managers about Swift adoption within the company. His response was that it was being used for new apps/projects, but not so much for existing codebases. Having worked on a large Obj-C codebase that began adopting Swift, there are definitely some headaches involved in Obj-C/Swift interop, and you often aren't getting many benefits of Swift unless your new code has few to no dependencies on / is not depended on by Obj-C code, unless you can refactor it into Swift. Given how quickly it seems they've been forced to ship, I can understand not wanting to deal with these issues, or not having the time to address them.
- ppeetteerr 8y agoThere are three advantages that I saw immediately upon switching to Swift: - It was easier to hire developers - Code was less prone to null pointer exceptions - There were fewer assumptions when deserializing JSON into a struct/object
- mgoblu3 8y agoWe moved a very large iOS app over to Swift, and the first two benefits are really huge. I know people have opinions on these things, and both sides are right, but the really strong typing and enforced nullability have been hugely important to getting junior engineers contributing to the codebase. Not saying that it's an unsolvable problem elsewhere, it's just an anecdotal benefit we got
- mamcx 8y agoFor me, to make swift a total contender it need good support for non-apple platforms: https://www.reddit.com/r/swift/comments/8zb9y1/state_of_swift_for_androidlinuxwindows_on_2018/ https://www.reddit.com/r/swift/comments/8zb9y1/state_of_swif... For that, I'm exploring with rust now, but certainly is far harder than use swift. I also look at nim, yet I think is too inmature for use in ios/android?
- dom96 8y agoI don't think it's too immature. People have successfully targeted iOS/Android with games in Nim.
- mamcx 8y agoI judge from what little I can find. Exist a good reference in how do it? Even if a keep rust I think nim cover a nice spot to add to the toolbet.
- Larrikin 8y agoThe Kotlin team is making a real effort to make the language truly multiplatform. It's still not production ready in my opinion for anything you wouldn't use Java for but they keep improving their JavaScript and native support. The iOS app for their official conference is written in Kotlin for example
- whitten 8y agoWhile I think dyld is probably short for "dynamic load", I initially read it as 'Dylan Language Deamon" when I read the phrase 'shared dyld cache'. I know Apple was heavily involved in the Dylan language several years ago. Does anyone know if Swift was influenced by Dylan ?
- dwaite 8y agodynamic libraries on macOS are dylibs. There is a debate whether 'ld' is short for load/loader, or link editor. So you can either read it as the dynamic library load tool or the dynamic link editor. A shared dyld cache would be a cache of metadata used for linking, but not sure if that is for link-time or runtime.
- pier25 8y agoWhat about macOS?
- catoc 8y ago66 binaries out of how many in total?
- flashgordon 8y agoHas there been widespread adoption (or migration to Swift) in "large" companies for their flagship products outside apple?