4 ms·
This article definitely strokes a chord in me, although in my case for for Swift, not Rust. After I retired a couple of years ago, I decided to develop a Mac an
by 2sk21 4y ago
This article definitely strokes a chord in me, although in my case for for Swift, not Rust. After I retired a couple of years ago, I decided to develop a Mac and iOS app in Swift using SwiftUI. In most of my career, I used Java, C or Python.
Swift, like Rust, is a very complex language. Even six months after I started, I keep learning new language features. In some cases, I had to watch WWDC talks and read the language spec to understand why some features were included in Swift. And even then it left me wondering why they could not tolerate a slightly more ugly syntax, in favor of readability.
I should mention that I have been programming for forty years and and I have written several compilers and language run time systems in my career.
- gary17the 4y ago> And even then [Swift] left me wondering why they could not tolerate a slightly more ugly syntax, in favor of readability. Well said. I've also been coding for a couple of decades (mostly in C++) and I also found advanced, real-world Swift unbearably... "irritating", for the lack of a better term. Surprisingly, I do not have that problem with Rust, even though Rust can be quite complex in order to be able to express ideas that Swift cannot handle at all (lifetime, ownership, immutability of reference types, mutable reference exclusivity, dynamic trait types, etc.) Somehow my brain is happy to consume complex Rust, while it's often "irritated" about consuming complex Swift. I think the reason why Rust is so overwhelmingly better than Swift (for me, at least) is the fact that a lot of (ingenious) effort must have been put by the Rust Gods into Rust language >>consistency<< and >>predictability<<. My proverbial "sh*t, I like Rust..." moment came after I noticed a few things: 1.) Rust did not allow me to force-implement the Copy trait for a type that was not actually simply bitwise-clonable, 2.) Rust was expecting the "await" keyword after an expression, like a function call, yet uniquely without parenthesis, and 3.) Rust closures turned out to be based on the very easily noticeable double-pipe syntax. My plea to the Rust Gods That Be: do not ever allow Rust to lose that unique "explicitness" and "predictability". It is one of the language's greatest assets.
- cobbal 4y agoI agree with you on swift. The evolution process seems to favor adding more "features" instead of unifying, simplifying concepts. For instance, we have special syntax for optionals, exceptions, asynchrony, coroutines (mostly hidden), and any other effects they decide to add in the future. Whereas in haskell, all you get is `do` syntax for describing these things. The trade off is that in haskell it's harder to learn the first thing, but then easy to pick up the rest. In swift, you have to learn how all these special effects interact.