Search posts, tags, users, and pages
I've seen a lot of comparisons recently between Rust and Swift. How do the two compare, and do you view Swift more as competition or as a complement?
Rust and Swift are kindred spirits; fellow travelers who walk similar paths.
Both have constraints that inform their designs and decisions. Swift has strong constraints around Objective-C compatibility and being an Apple-first technology; Rust has a desire to give you access to every last bit of performance, and motivation to have good support for a wide variety of platforms.
I view the two languages as complimentary more than competition.
I see them as pretty complementary, at least right now.
Swift and Rust definitely have a lot of ideas in common, and Swift is even exploring some of the ownership tech from Rust. Where they most diverge, though, is their goals.
Swift's aim, as I understand it, is to be an awesome application-development language, first and foremost. Rust is more aimed as systems development, first and foremost. Each one wants to branch into the other space, but the deep difference in starting points already makes them quite different beasts.
In particular, there are some core aspects of Rust that I can't see us ever changing, nor can I see Swift ever adopting:
Rust intends to be usable in as many environments as possible. Thus, it has no runtime, no GC, speaks C natively, and generally speaking can be "just tossed in" as a lightweight component.
Similarly, Rust is unwilling to forcibly impose costs or abstractions on top of the underlying system. If you want to work at a higher level, you can do so, and we give you lots of great tools to do so. But we take as a constraint that it's always possible to drop down to "bare metal".
Put differently, Rust intends to be appropriate for writing an OS or database in.
Rust as much as possible avoids "legacy commitments"; at the libcore level, there are no assumptions about even the surrounding operating system.
That said, we often talk about Rust having three core goals which I think Swift shares: it should be fast, reliable, and productive. I think a lot of the differences between the two come down to a different choice of how to balance between those three goals.