this post was submitted on 03 Nov 2026
22 points (95.8% liked)

Rust

8358 readers
1 users here now

Welcome to the Rust community! This is a place to discuss about the Rust programming language.

Wormhole

!performance@programming.dev

Credits

  • The icon is a modified version of the official rust logo (changing the colors to a gradient and black background)

founded 3 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
[โ€“] hallettj@leminal.space 3 points 3 days ago* (last edited 3 days ago) (1 children)

I really like how the Rust developers looked at prior art, and combined some of the best ideas from various sources into something new. Traits are basically Haskell type classes. They're modified a bit to allow fluent method chaining; but you can still call trait methods via the trait reference which is the Haskell style. Associated types in traits match up with one half of the functionality from GHC's Type Family language extension.

Enums, the Option and Result types, and pattern matching come directly from the ML language family. Hygienic macros also have roots in functional programming.

Iterators bear a passing resemblance to Haskell's lazily-evaluated lists. In both cases you can pile on transformations without intermediate allocations. But of course the implementations are very different.

[โ€“] SorteKanin@feddit.dk 5 points 3 days ago

And it even manages to take the good stuff from object oriented programming, like RAII and encapsulation and interfaces without getting in the weeds with inheritance!