Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

True. I wouldn’t want to think about the borrow checker writing UI code, and I don’t need the performance or ultra-optimized machine code of Rust when I write Swift.

I moreso meant in terms of the high-level features of Rust and how they integrate FP-style patterns into a C-style imperative language. Like tuple-based structs as discussed above, or control flow as expressions, like if and match.

The alternatives to the latter in Swift are

A) defining a dedicated function for the control flow, using return statements

B) defining but not initializing a let constant before the control flow statement

C) using the ternary operator, which is concise but doesn’t really allow for destructuring complex types

all of which are more verbose, less clear in intent, and IMO don’t embody’s Swift’s mantra of “clarity at the site of use” as well as Rust’s approach.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: