Quora uses cookies to improve your experience. Read more
Tikhon Jelvis
Tikhon Jelvis, studied programming languages and did research on program synthesis

Not really. Rust is a novel language for systems programming with strong influences from functional languages like Haskell and OCaml (as well as an interesting type system), but functional programming is not its focus.

Rust’s goal is to be an efficient low-level language with manual memory management and compatibility with existing systems, which limits their design options on things like calling conventions¹. These things are not particularly conducive to functional programming and so, over time, Rust has gotten less and less functional. It still takes advantage of functional ideas, to be sure, and presents some functional features, but it is not a coherent introduction to functional programming as a whole.

Instead, if your main goal is to learn about functional programming, I highly recommend Haskell. It’s a higher-level language than Rust and you simply can’t get any more functional—Haskell pushes the functional paradigm and functional abstractions in a way that’s basically unique among common modern languages. Once you’ve got a handle on Haskell you’ll have a deep understanding of functional programming and you’ll be able to see in which ways languages like Rust reflect functional ideas—and in which ways they don’t!

footnotes
¹ A “calling convention” is how a language implements function calls in assembly—how stack frames work, how registers are suspended to memory and restored, which registers get the return value… etc. Rust’s design goals require a fast calling convention that works well with existing C tools, which means they had to give up proper tail calls—a feature that is quite important for practical functional programming.

About the Author

Tikhon Jelvis

Tikhon Jelvis

consistency is all I ask
Lead Data Scientist at Target2016-present
Studied Electrical Engineering and Computer Science at University of California, Berkeley
Lives in Berkeley, CA
Knows Russian
11m answer views108k this month
Top Writer2018, 2017, 2016, and 2015