2 ms·
Rust and Swift are my two go-to languages when I have free choice for a given task. I love both, and I miss things about Swift when writing code in Rust and vi
by skohan 6y ago
Rust and Swift are my two go-to languages when I have free choice for a given task. I love both, and I miss things about Swift when writing code in Rust and vice versa.
What I love about Swift is that it's an incredibly expressive language which is easy to write, so it's possible to be incredibly productive in it. The type system is awesome, the syntax is super clean and consistent, and thanks to a lot of well-thought-out syntactic sugar it often feels like I'm almost working in a DSL for the problem I'm working on.
What I miss from Rust when working with Swift is the level of specificity. Swift makes some assumptions about how values and references are handled, which makes things easy to code, but can often result in unnecessary copying and reference counting which can only be avoided by bending over backwards in the implementation or resorting to the unsafe API. I like how Rust gives me precise tools for specifying exactly how memory should be handled.
To be honest, I think my perfect language would have something like Swift's front-end, and something like Rust's memory model.