Earlier quoted context omitted.
Reading the super majority of Rust code is equally easy or easier than reading Python, or Typescript, or even Ruby. Writing Rust applications is also very ergonomic. The Rust web server frameworks are approaching the ergonomics of Typescript web server frameworks. The only Rudy lacking ergonomics is writing net new frameworks or missing framework pieces, or when std is not available. 95%+ of all new Rust code will fa…
This isn't really the case. Rust code is almost as complex as C or C++ for any non-trivial application.
Apple announces full Swift rewrite of the Foundation framework (2022)
311–320 of 402 posts
Re: Apple announces full Swift rewrite of the Foundation framework (2022)
#312Does it mean Objective C is going to be second-class language? It would be a pity, I prefer Objective C to Swift.
I still rely on some stuff like GCD that isn't very swift like, there still isn't anything as fine grained in Swift, but I'm liking combine in some cases.
Re: Apple announces full Swift rewrite of the Foundation framework (2022)
#313Really looking forward to OOP being phased out.
Re: Apple announces full Swift rewrite of the Foundation framework (2022)
#314Earlier quoted context omitted.
I watched a Rust intro video recently that provided a perspective I liked, so I’ll share that here: MS, Apple, Google (and more) all relied heavily on C for low level code that needed to be as performant as possible. It turned out though that C‘s memory management is so problematic that many/most security issues are caused by it. To address that, Google invented Go, Apple made Swift, Mozilla gave us Rust etc. MS is i…
If it was just a matter of avoiding memory safety Java and ML were right there, and these languages are pretty different from each other. It's not just memory safety. Go gets motivated by highly concurrent systems with large numbers of programmers and prioritized simplicity and developer experience. Rust was aiming at very high performance at the extended of complexity and compile times, and Swift wanted to build UI…
Had Java been like Modula-3 or Eiffel since version 1.0, Go might never have happened at all.
Thankfully they are on the right path to fix those issues.
Re: Apple announces full Swift rewrite of the Foundation framework (2022)
#315Earlier quoted context omitted.
I watched a Rust intro video recently that provided a perspective I liked, so I’ll share that here: MS, Apple, Google (and more) all relied heavily on C for low level code that needed to be as performant as possible. It turned out though that C‘s memory management is so problematic that many/most security issues are caused by it. To address that, Google invented Go, Apple made Swift, Mozilla gave us Rust etc. MS is i…
Note that Apple is known er use Rust for some of its infrastructure and Google is adopting Rust in a big way in Android and Fuchsia.
Re: Apple announces full Swift rewrite of the Foundation framework (2022)
#316It looks like an important step in progressively retiring ObjC. Swift is built from the start with a ObC compatibility in mind, which is a source of much ugliness and inefficiency in the language. With the Swift team working in a value semantic first language (Val), I can kind of see where this is going. Really looking forward to OOP being phased out.
All the higher level macOS APIs are still object oriented, and I don't see that changing TBH. And macOS application source code is essentially just minimal glue code to tie those system APIs together, in the end, the programming language used for this glue code doesn't matter all that much, since the code is completely dominated by API calls.
Re: Apple announces full Swift rewrite of the Foundation framework (2022)
#317Earlier quoted context omitted.
Swift will never win against Rust for a much simpler reason: performance. Invariably, rust is chosen where performance is critical, and Swift’s reference counting GC ensures it will never compete with Rust in those scenarios.
Slight correction: Swift‘s ARC is not a GC (the compiler just inserts retain/release calls where it’s necessary), and one can write very performant code by steering clear of reference counted types, and Objective-C types (dynamic dispatch is really slow). Value types with copy-on-write shouldn’t impose much overhead. Automatic inlining is progressing nicely AFAIK, and recently introduced concurrency can collapse call…
Compiler optimizations are exactly that, optimizations that any automatic memory mangement implementation usually takes advantage of.
Re: Apple announces full Swift rewrite of the Foundation framework (2022)
#318Who else remembers when they re-implemented the (at the time version of) the Foundation framework in Java for WebObjects? That was, what, 1998? Right around when NeXT got re-absorbed by Apple, not sure if the rewrite was started before or after. https://developer.apple.com/library/archive/documentation/Le... https://en.wikibooks.org/wiki/WebObjects/Overview/Objective-... Those were the days! Actually kind of amazing…
I thought it was NeXTSTEP/Sun, but it seems disputed. https://stackoverflow.com/questions/473758/what-does-the-ns-...
https://en.wikipedia.org/wiki/Distributed_Objects_Everywhere
Their collaboration is also one of the reasons why Java is basically Objective-C semantics with C++ like syntax.
https://cs.gmu.edu/~sean/stuff/java-objc.html
Interfaces (protocols), dynamic class loading (plugins), RMI (distributed objects), jars (bundles), dynamic dispatch by default, object root class,...
Re: Apple announces full Swift rewrite of the Foundation framework (2022)
#319Earlier quoted context omitted.
You don't need ultra performant memory management for most of your code. Swift compiles to machine code and ARC is fine for most use cases and you can use unsafe raw pointers etc for your occasional hot code path where you want to optimize memory management.
I would love to see what this looks like in practice if you can point me to a link. (I’m now curious if the unowned keyword would have similar performance characteristics)
Re: Apple announces full Swift rewrite of the Foundation framework (2022)
#320It looks like an important step in progressively retiring ObjC. Swift is built from the start with a ObC compatibility in mind, which is a source of much ugliness and inefficiency in the language. With the Swift team working in a value semantic first language (Val), I can kind of see where this is going. Really looking forward to OOP being phased out.