akavel's digital garden

Rust vs. Go

I started to understand why Rust authors made other design decision than Go authors when I found a thought that they assign different priorities to three “ideals”: readability (or, “simple API”), security, and performance.

security read- ability perfor- mance Rust Go

In case of Go, I’d say readability (“simple API”) is top, security comes after, and performance is a third priority. I claim this shows up in allowing nil in the language (compromise against security), and in allowing a garbage collector in the language (compromise against performance).

In case of Rust, I see it as security and performance playing top-priority duo; with readability being cared for, but only as long as it doesn’t interfere with those.

I think this fact alone, of enabling a shared success of both of such seemingly at-odds ideals as security and performance in Rust, is a mind-blowing accomplishment already. I now understand and respect exceptionality of that achievement, and through that accept that there’s not enough magic to be able to achieve flawless readability as well — grudgingly forcing it to occupy a back-seat.

Interestingly, the security plus performance duo seems to be already balancing a sharp edge, with their relation being a rough if loving and respectful friendship. I interpret this as the source of occasional tensions showing up in the community, e.g. most visibly around the use of unsafe.

🌱 seedling — contents of this article got classified among young, unrefined ideas that I’ve just planted—or old, unrefined ideas that need watering. If I am a diligent, caring gardener, they’ll grow into budding and maybe even ripe.
© Mateusz Czapliński 🐘 Mastodon 🐙 GitHub 🎮 Itch.io ♟️ BGG 🧶 Ravelry