Apple is rewriting Foundation in Swift
github.com
github.com
New in 2023 is instead NOT to match all of Foundation, but to make some core libraries that make Swift usable on many platforms. E.g., they broke out the very large internationalization/i18n tables required for unicode support into a separate module.
It's very unlikely Apple would move off their own Foundation, which is well-understood and well-tested. This strategy permits them to incrementally sidle over, but continue with both for some time. Aside from servers, it's likely to look promising for multiple tiny devices - trusted computing, watches, headsets, airpods, etc.
:(
Apple, like most companies, does not provide official mechanisms to patch bugs out of their software. They also keep most of their system frameworks closed-source. However, it just so happened that they write most of their software in programming languages are are highly dynamic and easy to reverse engineer, allowing third parties to dig into implementation details when they need to, understand how things work, and most importantly, change things as needed. It's risky and dangerous work, but every major app you've ever used on an Apple device ships with several fixes like these at any given time.
The Apple of today has very different goals from their frameworks. Shipping symbols that help people understand how the system frameworks function is "needless bloat" that "exposes implementation details". Indirection and patching functionality is seen as overhead that can be removed for improved performance. App review does not like it when people ship self-modifying code, and as a result patching system frameworks is also not permitted due to codesigning. Swift in particular removes a lot of dynamic dispatch functionality, gets stripped far more aggressively, and compiles to code that is far less readable that what we had before.
What this really means is that we are moving closer to a system where what Apple ships is what you get. Being able to make tradeoffs in this area is necessary, but the ones Apple have chosen mean that they have to be very confident that they don't ship bugs. If they aren't capable of doing this, well, it's not a good tradeoff.
Mostly at slowing down iOS runtime performance per clock cycle, and increasing compilation times.
Its also been hugely successful at punishing companies for using it, since it didnt really work for a few versions.
While there have been fewer crashes (sort of) due to the switch, as someone who worked for years in Objective C and years in Swift, I honestly never felt that Swift significantly improved much except allocation rituals and properties.
I do however enjoy Kotlin for the backend because it has some nicer semantics for object construction.
While I do admire the work that Apple has put into Swift, I really felt that Apple was trying to "impress everyone", with a whole lot of bikeshedding and sick amoutns of code generation to convince us it was the right thing to do.
Frankly, apps run over 10 times faster in obj C and xcode with Swift is probably my least favorite and sort of non-ergonomic experience close to DOS batch file dev in Windows Notepad.
I wonder if the current state of affairs is what Chris L had in mind?
I tried Swift for Linux, and soon realized it was a meh experience (NS this, NS that... NextStep is still there) and switched back to Rust.
It could have been a strong Rust alternative.
[0] https://arc.net/
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#.
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.
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.)
[1]: https://learn.microsoft.com/en-us/dotnet/maui/ios/cli
[2]: https://docs.avaloniaui.net/tutorials/developing-for-mobile/...
2016: https://9to5mac.com/2016/02/22/ibm-swift-cloud-kitura/
2016: https://www.infoq.com/presentations/swift-server/
2020: https://www.infoq.com/news/2020/01/ibm-stop-work-swift-serve...
You can run it in docker: https://hub.docker.com/_/swift
for now
just saw an article about IBM deleting most of their website because its a mess. It was some linkedin developer's post.
It's like Rust in that it offers memory safety by default without a big performance hit.
Apple has been writing OS components in Swift for a while now. It certainly doesn't seem to be producing the performance issues we saw when Google attempted to write components for Fuchsia in Go or Microsoft's effort to create new features for Longhorn in .NET.
My experience with Swift is somewhat limited, because every time I've tried to use it, I've run into glaring performance issues and had to switch language. It might be reasonably performant compared to Go or .NET, but it's nothing like Rust.
Do you have a reference somewhere I can read up?
Add a little bit of salt to insult you need it to be atomic if you want it to run on SMP. This means for each time you have create/release the lifetime of an object you will make a lot of memory barriers, and create a lot of cache contention.
But in practice the overhead is actually nought, and most of the time you rather deal with I/O bound problem more than an additional atomic increment operation. Modern processor is fast enough to deal with them in few cycles in around the order of 10 nanoseconds
Hopefully the upcoming ownership functional will help in those cases.
Most of the time it’s possible to avoid atomic instructions and still be thread-safe. https://dl.acm.org/doi/10.1145/3243176.3243195:
“BRC is based on the observation that most objects are only accessed by a single thread, which allows most RC operations to be performed non-atomically. BRC leverages this by biasing each object towards a specific thread, and keeping two counters for each object --- one updated by the owner thread and another updated by the other threads. This allows the owner thread to perform RC operations non-atomically, while the other threads update the second counter atomically. We implement BRC in the Swift programming language runtime, and evaluate it with client and server programs. We find that BRC makes each RC operation more than twice faster in the common case. As a result, BRC reduces the average execution time of client programs by 22.5%, and boosts the average throughput of server programs by 7.3%.”
I remember reading that this made it into Swift, but cannot find it, so I’m not sure anymore.
And of course, the Swift compiler tries to avoid unnecessary refcount updates.
According to information released when the M1 came out: retaining and releasing an NSObject takes ~30 nanoseconds on current gen Intel, and ~6.5 nanoseconds on an M1
(or if going with BRC, correspondingly there shouldn't be a advantages for this custom CPU feature)
So they went with plan B, having the compiler automate the retain/release messages used by the Cocoa framework.
Everywhere else in Objective-C, the memory is still manually managed, or via memory pools.
Chris Lattner (of LLVM fame) did design the language with the goal of hiding complexity until it is needed.
> The concept of progressive disclosure in Swift, where you can start with something very simple and then learn complexity as you go, was totally driven by making it teachable. I personally spent a lot of time trying to make sure that the introduction to Swift could just be print("Hello World"). No semicolons, no \ns, none of that public static void main stuff. Making it simple and approachable was a strong goal, and not in a weird way where in a teaching environment there is this “Swift Prime” language that’s similar but different.
https://oleb.net/blog/2017/06/chris-lattner-wwdc-swift-panel...
You might be surprised (I was). Most of the benchmarks I’ve seen place it more in the neighborhood of golang and v8, rather than the C, C++, rust neighborhood you might expect.
Another commenter in this thread highlighted that the ref-counting GC is what keeps it out of the C / Rust performance neighborhood.
So not even sure that GC has always a perf cost is always true.
Not saying it doesn't in some cases, just so that we are clear but the truth seems to be more nuanced.
(Also, it’s Xcode)
It is the most similar in terms of language features and style but it has access to Java's unparalleled library and tooling ecosystem.
And not at all compatible or easily bridgeable with obj-c, which was not optional.
Swift for example defaults to copyable value types and reference types that are refcounted because that is what is most often needed for evented application code, while Rust defaults to non-copyable objects (with wrappers for things like reference counting) because of its systems development focus.
Swift also had a hard requirement of a decade of co-existance with Objective-C. A significant number of Swift types toll-free bridge with objc (and corefoundation) alternatives, and that had a considerable impact on the standard library. Their base library would be different from Rust's "std" due to needing different implementations of strings, vectors, dicts and so on.
The two do take quite a bit of inspiration from one another, and will gradually grow to support an ever-larger overlapping set of use cases, but the design constraints of the existing language will still mean that one or the other is better for a specific task.
EDIT: wait, I'm reading that swift does not have a garbage collector. I guess I don't see how it differs from Rust then.
EDIT2: ah I see, everything's a smart pointer basically and memory's released at the end (RAII-style), whereas Rust has the borrow checker (but it's still RAII-style). I guess both implement RAII ideas, but Rust seems to do it at compile time and Swift at run time.
Apple had a bad experience with GC in ObjC with libauto and learned their lesson that C and GC just don’t mix. You can never have a truly modern GC in C, because C cannot provide any of the guarantees that a GC needs to move objects around.
Using a modern GC entails sealing the language off in a bubble. Since Swift is mostly used to interface with system frameworks, you would end up paying a cost when interfacing with the system frameworks written in ObjC, making your modern GC useless most of the time.
It's a modern statically compiled language with complex generics, that supports providing a generic interfaces in libraries with retaining ABI compatibility. Which no other modern "system" language supports. That's fairly technically interesting to me.
> We have so much more than that and you just went with reference counting
Like what?
The options for memory safe shared ownership are refcounting or GC.
Assuming you're talking about rust, that's just C++: object lifetime is lexical, and if you need it to last longer you have to use Arc/Rc/shared_ptr. The purpose of the lifetime and borrow checkers is to ensure exclusive access, and reduce the copy/destruction churn that you get from the C++ model (a hypothetical C++ that only allows the use of unique_ptr instead of raw pointers - obviously C++'s type system and approach to memory safety is not a Good Thing).
But it's important to realize rust did not create a new solution to object lifetime management for shared objects.
It's also important to realize that rust was designed in an environment where there was no existing code to interoperate with, whereas Swift was designed to work with the existing Darwin APIs and objective-c which are all refcounted. So even if no refcounting was the goal you'd end up with a new language, designed for a specific environment, and the default behaviour would not be correct.
Now that the language is more established, and it's less critical for every part of the language to have objc interop they are working on pure ownership semantics, for the same reason as rust: it saves copies without requiring a refcount[1]
[1] https://github.com/apple/swift/blob/main/docs/OwnershipManif...
Hence why Kotlin only really matters on Android.
i think kotlin has more use outside compared to swift.
But a language has to start somewhere, so i wouldn't hold it against swift. It's a fairly well done language regardless, and nothing apple specific about it tbh (which are all just libraries).
It was JetBrains pet project to fix archaic stuff in Java without making a Scala. It was designed from the get go for a wide base (as wide as java).
I'm not sure how it became Android's main target, but I doubt it was the original purpose.
Honestly the only times I've evaluated Kotlin for personal projects was bc of that flexibility.
If that was the case, they would have adopted Dart instead of keeping an high dependency on the Java ecosystem for Android.
Android Studio, Gradle, Kotlin compiler, the libraries that Android depends on from Maven Central, all Java.
Try to use Kotlin without the Android ecosystem, it is just syntax sugar for the JVM.
I agree and would go so far as to say that Dart is a better comparison to Swift than Kotlin is.
It helped a lot that I think Jetbrains took advantage of all they could to make development in Kotlin very smooth, I remember back then people joked how Kotlin worked so flawlessly on Android Studio almost like it was the main language while on Xcode Swift was slow, the highlight would stop working constantly, refactoring was not supported, often indexing the project would hang forever etc.
“No one”
Yet The Browser Company (The one that is hyping the Arc Browser) is writing their browser in Swift to support Windows. [0] which that is their main product.
The Browser Company is not “No one”.
[0] https://m.youtube.com/watch?v=Xa_fNuaSE_I
EDIT: So this video doesn't show someone choosing Swift outside of Apple and using on a different platform (Windows) and doesn't disprove the claim of "No one outside Apple chooses Swift"?
Surely you can do better than some of the very low effort replies below.
Brave (VC funded) is also a Chromium wrapper and Edge (Microsoft owned) is also one as well and both of the somehow managed to beat Firefox in usage. So what is you point?
Chrome and its derivatives is the reason why browsers like Firefox is failing to keep up and continues to lose users.
Using anything other than Chrome for a modern web browser is a losing battle. (Brave already tried that with Firefox and quickly switched to Chrome)
I was answering a question asking what it was. Are you saying my answer was wrong?
> Brave (VC funded) is also a Chromium wrapper and Edge (Microsoft owned) is also one as well and both of the somehow managed to beat Firefox in usage.
Well that's just false.
Firefox has 7.7% marketshare.
Brave comes in at less than 1 tenth of a percent.
Edge, does better after all it is the _default_ browser on the most popular desktop OS by a massive margin. It gets <6% of the market.
So Firefox has greater market share than both of those combined.
> Chrome and its derivatives is the reason why browsers like Firefox is failing to keep up and continues to lose users.
You mean Chrome. None of the "derivatives" other than Edge (due to default browser syndrome) and Opera (which gets 2%) have any marketshare, and neither does anything to prevent Google from doing whatever it wants.
> Using anything other than Chrome for a modern web browser is a losing battle.
The reason is very very simple: Chrome is the modern IE, and making content that only works in Chrome (or wrappers) is considered acceptable by the same mediocre developers that made IE only sites a decade ago.
On the other hand, I get where you are coming from: people also said the same thing about using anything other than IE.
No. That's an exciting fictional world in which you live, and was not the case. Even in the last years preceding Google's chrome release and massive marketing push, when Firefox and Safari were taking "significant" marketshare, it was assumed IE would be forever, and IE-only sites were still common (and the norm in "enterprise" software).
There is literally no difference between a developer that says everyone uses/should use chrome, and a developer a decade ago saying the same thing about IE.
[0] https://arc.net
Sorry for the joke, know it is frowned upon, did it anyway.
iOS/macOS devs use Swift on other platforms because it's the only language they know, yeepidodadey. Ignore the fact that 99% of their project is cinterop with Chromium
It's valuable to Apple to have a language perfectly tuned to their stack, as the official entrypoint to all their APIs. If you need to use those APIs, you're excited about Swift. If you don't, you aren't
That's like...Apple's whole deal. Proprietary everything top-to-bottom.
The fact that Apple provides all these incredible platform specific frameworks and libraries for graphics, audio, games, GPU kernel programming, and more, it’s just the icing.
How exactly are protocols a Swift "upgrade" to OO programming? They were in Objective-C since the mid 90s, adopted by Java as interfaces, copied by C# etc.
Also, protocols in Swift have a huge performance downside, because they decided to have them work across structs and classes: if you use a protocol in a function argument, the compiler doesn't even know the size of the argument at compile time, so copying the arguments has to be dynamically dispatched unless the compiler can figure it out in an extra optimisation pass...that's not possible when doing separate compilation.
> Runs reasonably fast, on par with Go or Java.
A downgrade...particularly considering the epic compile times.
> named parameters
Also there since the 80s, in a less weird way.
https://blog.metaobject.com/2020/06/the-curious-case-of-swif...
> ...professionally used about half a dozen languages ...
What languages were those, if I may ask?
Never had a problem with long compile times -- once you have your initial build, 90% of the time or more the incremental build process is very fast.
The languages I used for about 15 years were ObjC, C, C++, Clojure (and other langs before that). I find Swift to be a thoughtful blend of the key features of these four languages -- each of the things I like most about those langauges are in Swift, but it's the syntax in particular that I like most.
Hmm...not sure how else to interpret "upgrade to OO programming with use of protocols" other than that there was an upgrade to OO, and that upgrade was with the use of protocols. Now it looks like you meant an upgrade of the way protocols are used in OO, but you won't say how they Swift's protocols actually constitute an upgrade.
OK. ¯\_(ツ)_/¯
Typically you would write more protocol-oriented code - rather than using inheritance (which is mostly there for Objective-C compatibility) you define protocols and implement them for types.
This is a lot closer to traits in Rust than interfaces in Java. Among other things, a developer can define how a third party type implements a protocol they control, without subclassing or wrapping, as long as it does not require additional data.
No need for Google, as mentioned, I know both languages.
As for protocols not being encouraged in Objective-C, I migth own the wrong NeXTSTEP manuals.
(as a sibling comment pointed out, swift protocols are typically used for things that in objc you would use inheritance)
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
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 only performs as well as Java is quite the hard sell.
For that price, you could also get Kotlin which fixes most of Java's problems and provides access to all the JVM as well as Kotlin/Native, with top tier DSL abilities and a really well thought out stdlib, coroutines, reified funs and much more.
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/
Many people are more than happy to do all their career on a specific platform.
It took real effort from Microsoft into the Open Source space to make it more widely popular. Far away from Java or JavaScript, but I see many similarities between the development and evolution of Swift and C#.
Almost everything starts as a domain specific language. Same goes for JavaScript. First browser only, then through Node, suddenly JavaScript everywhere.
Python gained massive traction through Jupyter. Before that, I found Python a clumsy alternative to JavaScript. Since then I have changed my mind. ;)
I do quite like Swift overall -- it’s usually terser than Obj-C and I like the much stricter and more expressive type system. But you pay for that with much longer compile times, and the tooling feels much the same (Xcode is still Xcode).
The decline in the docs is due to a number of factors, but I would say mainly it's (1) the relentless annual major OS update schedule, (2) the proliferation of OS (macOS, iOS, watchOS, tvOS, xrOS?), (3) the dual language stack, (4) Apple personnel turnover.
I think that Foundation being a Obj-C library effectively forced Apple into eating their own dog food (for the sorely needed Swift/Obj-C interop), so I don’t think rewriting Foundation in Swift would have been a good strategy for Apple.
As for Foundation, core frameworks almost never get rewritten and for good reason. It's almost never worth it. Best case? You get functional equivalence. Worst case? You introduce bugs into something that millions or even billions of devices depend on. Those bugfixes may take many years. Every now and again we see bugfixes that are 10-20+ years old in things like GCC or the Linux kernel.
Rewrites should never be undertaken lightly, particularly with less mature languages. Apple is (IMHO) being relatively aggressive with this.
9 years is not that long for a programming language. PG's (in)famous eassy on Python Paradox [1] was written in 2004. By the time Python was 13 years old and it was still a "cool kid's language".
And all the money in world can't make it any faster.
Also, this project's been going for a few years I think, since it's used for Swift on Linux.
That doesn't seem accurate:
"The Foundation package is an independent project in its early incubation stages."
"In the future, we will explore how to sunset the existing swift-corelibs-foundation and migrate to using the new version of Foundation created by this project."
I'd love to see a comparison of how the functions work within their own realm, e.g.:
- Speed of a date function in pure ObjC, tested in ObjC realm with no Swift bridge
- Speed of the same date function in pure Swift, tested in Swift realm with no ObjC bridge.
Otherwise, introducing an extra bridge with the language, then getting rid of it isn't a performance improvement, it's getting back to the baseline.
This is a strange comment, because Swift would have been Dead On Arrival in 2014 without that Objective-C bridging, an Apple-created language that doesn't work with Apple application frameworks.
The bridge should have obviously existed (and should still exist for a very long foreseeable future if not forever). I was refering to having a benchmark with and without bridge and telling Swift is faster is a bit off, as that performance decrease was what Swift had to bring in the first place.
I don't think Apple is interested in having that argument in 2023. There's no point. Swift has won the "language war", politically within Apple and in developer mindshare outside Apple. (I say this as someone who continues to write Objective-C.)
I think the metrics in their current form don't really mean much if it's only measuring the performance "gain" by getting rid of the ObjC/Swift bridge.
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 easily write a C (or C++) method (or class) but also include existing C/C++ libraries.
I also find some of the improvements Swift brings to actually make developers more reckless and dependent on the language/compiler (yes, I liked to manually manage memory).
And a bit of a personal frustration: I find a swift package/project that I want to use, download it and ...start fixing/updating the code, so that it compiles with the latest Swift version. I still have Objective-C code I wrote more than 10 years ago that compiles and runs with minimal or no change.
I think you are in the minority there, even among Objective-C programmers.
In any case, Objective-C ARC is there for those who want it.
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 judgement.
Which Apple acquired years ago and then released it open source.
I believe Swift takes the switch farther than match in Rust, because it tries to deal with API stability (e.g. a system library adding new possible cases)
Current Apple and Swift felt somewhat like Apple and Dylan in the 90s.
May be time could tell. A lot of people hate Objective-C, and was cheering for Swift in 2014. Now nearly a decade later, it seems time and resources could have been spent somewhere else.
How about going forward to an alternative that actually isn't a step back.
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.
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?
Metal is the only green field framework that was still being built with Objective-C, and yet most just use the Swift bindings.
Maybe Swift isn't Objective-C without C, as originally announced, but something else isn't coming to replace it either.
Seriously if you're going to take the cost of rewriting massive amounts of code, why would you not rewrite it in a language that offers actual improvements to the language that's being rewritten?
Apple already has (and uses) objective-c++, and the majority of objc I've ever interacted with is objc++ once you're outside of headers (just look for .mm extensions).
Its not like I dislike the language either but I think compile times matter so languages should not pretend like that doesn't exist. I can forgive Rust its giving you more than just type checking but Swift does not offer the same things yet it takes just as long or longer to compile.
Though Swift concurrency is mostly about "concurrency" not "parallelism", which is the one that has data races.
I sure hope the author learned the right lesson from the failure that is Swift and Mojo turns out to be better. I do not want a language with a complicated type system and long compile times. I want a 'good enough' type system and fast compile times.
Unless I'm thinking of something different, doesn't OCaml have type inference on polymorphic types and fast(ish?) compile times?
I was under the impression that the breakdown of causes for Rust projects compiling slowly is very project-dependent as well. From what I can remember common culprits were monomorphization and/or LLVM, though I'm not sure if that has changed recently.
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 polymorphic way).
As a consequence, typechecking for OCaml programs tend to take from 10% to 60% of the whole compilation time for typical programs. However, for OCaml programs that make heavy use of GADTs typechecking can dominate the compilation time (probably due to the exhaustiveness check but I have yet to empirically check that).
Infamously, Swift made the choice to introduce a typechecking algorithm with an exponential complexity in the size of expression (to support function overloading and literals) even for simple types.
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.
How big is Foundation anyway? Or are we talking about the movie they released?
This makes a lot of sense considering swift's primary target: app developers that build end-user facing software, as opposed to core system developers for rust.
Gross. The whole appeal of Foundation was having this incredibly convenient, beautiful, high-level object-oriented API ontop of low-level, statically compiled performant C...
The true path forward for computing is clearly an alliance among the holy trinity of god's C languages: C, C++, and Objective-C.
Yes, the future is in Objective-C++'s hands.
Objective-C got good enough that all processes on Apple platforms have the objc runtime in their address space whether they want it or not and many pure C or CF-like frameworks are built on ObjC under the covers.
https://groups.google.com/g/comp.sys.next.advocacy/c/uOQnC1x...
The objections to Objective-C at Apple were always political, not technical, with a very entrenched "no Objective-C, ever" faction. Took a quarter of a century, but it looks like they finally won.
Dude, clicked your profile links, and wtf? Objective-S looks awesome! I had never even heard of it, but creating a more easy-to-use language ontop of the Obj-C runtime is epic!
I actually wrote my own C-based meta type system for giving my core library and applications that use it a language-independent object-oriented C layer for interop. That's actually how I discovered the magic that is Objective-C and how powerful the C runtime actually is... that's why I'm sad to see it slowly disappear, and anything like this that keeps it alive and uses it is really cool to me. :)
I just wrote unit tests for making sure the Objective-C runtime is working and doesn't accidentally get broken in the indie SDK, KallistiOS, for the Sega Dreamcast: https://github.com/KallistiOS/KallistiOS/pull/202, haha.
But hey, maybe having a core, foundational framework written in the most performant language out there with the most hardware support should've been a priority. ;)
Very soon it will not be possible to publish an app on iOS not built with the house language.
For those who don’t know, using C/C++ and opengl was easily done on iOS for many years, as llvm/clang was the official compiler.
I have a bad feeling about this.
Swift heavily relies on LLVM. As long as you have LLVM IR, your support isn’t going anywhere. Not to mention Apple continues to be an outsized contributor to LLVM and clang (largely because they started and open sourced the projects)
"The LLVM project started in 2000 at the University of Illinois at Urbana–Champaign, under the direction of Vikram Adve and Chris Lattner. LLVM was originally developed as a research infrastructure to investigate dynamic compilation techniques for static and dynamic programming languages. LLVM was released under the University of Illinois/NCSA Open Source License,[3] a permissive free software licence. In 2005, Apple Inc. hired Lattner and formed a team to work on the LLVM system for various uses within Apple's development systems."
It existed, but certainly wasn't yet ready for prime time. You can watch Chris give a Tech Talk at Google introducing Clang and LLVM and going over the features added in LLVM 2.0 while he was at Apple.
He joined Apple in 2005. and this talk was in 2007.
The question is very simple: Swift is meant to be a safe language, how feasible is that if a large chunk of the core types and runtime are implemented in C, C++, and Objective-C/C++? Migrating to Swift is the obvious and sensible step, unless you propose re-implementing them in yet another language?
[1] https://github.com/apple/swift/blob/main/docs/CppInteroperab...