Earlier quoted context omitted.
It does indeed sound like you have some very old documentation. (as a sibling comment pointed out, swift protocols are typically used for things that in objc you would use inheritance)
Old enough to have enough Objective-C protocols and categories in action. The kind of documentation that inspired Java authors. https://cs.gmu.edu/~sean/stuff/java-objc.html https://en.wikipedia.org/wiki/Portable_Distributed_Objects https://en.wikipedia.org/wiki/Distributed_Objects_Everywhere
Apple is rewriting Foundation in Swift
251–260 of 263 posts
Re: Apple is rewriting Foundation in Swift
#252Earlier quoted context omitted.
Fast (and principled) inference for not-too-complicated polymorphic types is an explicit design goal for OCaml and Haskell languages. And this design goal constraint quite a lot the type system. Typically, there are many type system features that break this property and where OCaml and Haskell requires type annotations (for instance polymorphic functions that takes polymorphic functions as arguments and use them in a…
Fascinating! Thanks for the insight! Does the up to 60% figure include programs that make heavy use of GADTs, or are those even worse in terms of the proportion of compilation time spent type checking? I had no idea Swift's type checking algorithm is exponential. How easy is it to run into those conditions?
I have no first-hand experience with Swift but the previous discussion at https://news.ycombinator.com/item?id=12108876 and the description of the problematic algorithm seems to indicate that numerical or mathematical code can run quite easily into the issue.
However, I must add that type inference algorithms being exponential in the source code size is nothing new: OCaml and Haskell inference are also exponential in the source code size. But that is because the size of types can be exponential in the source code size. Moreover, type inference complexity in OCaml and Haskell is linear in the size of types. And since in practice, no one ever uses exponentially growing types, type inference stays well behaved.
The specific issue with Swift is really more that even for simple result types, the inference may still have to do an exponential amount of guess work.
Re: Apple is rewriting Foundation in Swift
#253Earlier quoted context omitted.
Not sure why the only alternative to Swift is "going back", particularly when Swift is already going back in many ways. How about going forward to an alternative that actually isn't a step back.
Swift is an amazing improvement over objective c and I don’t think there are any languages out there that are obviously superior for the use case. The only people i ever hear complain are objc diehards and general apple haters.
I can't think of many use cases where Swift is actually better, though I do understand people believe it is. Why is...an interesting phenomenon.
In fact, it is difficult to conceive of a language less suited for the use cases Swift is touted for. See Swift playgrounds. See also: Mojo.
I think Objective-C seriously needs a replacement. Though it got a few fundamental ideas right, the details are almost all in dire need of improvement. Which is why it it is such a shame that the replacement is so unsuitable.
I really don't hate Apple. And my portfolio doesn't hate Apple either.
Re: Apple is rewriting Foundation in Swift
#254Earlier quoted context omitted.
Is there an alternative with similar features and ergonomics? I am def. not aware of one.
For which purpose? It depends what you want to do with it.
Re: Apple is rewriting Foundation in Swift
#255Earlier quoted context omitted.
For which purpose? It depends what you want to do with it.
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
#256Earlier quoted context omitted.
Given karismatic a prize. I wonder if the current state of affairs is what Chris L had in mind?
I don't know, but Chris L was always a C++ guy, he never really understood Objective-C in my opinion, which is why Swift ended up the way it did. I doubt he ever used it very much, or had a deep understanding of it.
Re: Apple is rewriting Foundation in Swift
#257I might be in the minority here (though, reading the comments, it seems others have the same opinion), but I find Swift to be a step back compared to Objective-C. I really like the verbosity of Objective-C - this makes the code more readable and easier to understand, even (or especially) when reading a program the first time. Being a superset of C (and C++ with Objective-C++) means that, when necessary, one can easil…
>I might be in the minority here I think for sure you're in the minority here. Swift was really a breath of fresh air for my iOS dev work -- it's just so modern and easy to read. That said -- I'm still reluctant on SwiftUI though. Seems like one of those technologies that works great for small apps and tutorials but falls apart at scale but admittedly have little experience with it so perhaps I'd be wise to reserve j…
Re: Apple is rewriting Foundation in Swift
#258Earlier quoted context omitted.
Swift is an amazing improvement over objective c and I don’t think there are any languages out there that are obviously superior for the use case. The only people i ever hear complain are objc diehards and general apple haters.
Wrong on all counts. I can't think of many use cases where Swift is actually better, though I do understand people believe it is. Why is...an interesting phenomenon. In fact, it is difficult to conceive of a language less suited for the use cases Swift is touted for. See Swift playgrounds. See also: Mojo. I think Objective-C seriously needs a replacement. Though it got a few fundamental ideas right, the details are a…
I assure you that swift is a huge improvement for iOS and mac development, and the statistics shoe pretty clearly that this is also the consensus.
Some older developers might be wedded to objc because of old habit, but if you ask 100 developers that are new to apple platforms to choose between the languages, I’d be surprised if even 1 picked objective c.
It would of course be strange if a modern language, developed specifically for use on apple platforms and heavily supported on the framework side, would not be more suitable than an old fashioned language from the 80s.
Not sure what you mean by playgrounds, they are simply amazing and keep getting more powerful. And how does mojo even enter the discussion?
Re: Apple is rewriting Foundation in Swift
#259Earlier quoted context omitted.
While it’s true that the language is really only useful on just Apple platforms, it is still quite an amazing language. I have professionally used about half a dozen languages over the last many years, written hundreds of thousands of lines each in all those languages, and swift is a true breath of fresh air. It checks all the boxes for me, very concise and elegant to write, yet very strictly statically typed. A nice…
>Runs reasonably fast, on par with Go or Java. Having to deal with weakself, no reference cycles, very limited closures, having to deal with Xcode, no integration with any other IDE because Apple Apples, debatable generics, SPM, debatable cross platform abilities, fucking Tasks and Actors, SwiftUI being locked to versions of Swift, extremely limited community, few high quality open source libraries for something that…
Swift has LSP integration, and has an official extension for VSCode, which works very well. They even have a blog post about it https://www.swift.org/blog/vscode-extension/
Re: Apple is rewriting Foundation in Swift
#260Earlier quoted context omitted.
Same, I find swift so much more ergonomic and beautiful than rust, but the development story outside (and inside) of xcode is just ugly
AppCode being sunsetted by Jetbrains made me a little sad. Not coding in the Apple ecosystem anymore. Out of IntelliJ, Visual Studio and XCode, it made the worst impression on me
(Also, it’s Xcode)