Is Rust a Purely Functional Programming Language?

What is a purely functional programming language?

A purely functional programming language is any language that is directly defined in relation to the Lambda Calculus. Examples of languages that are 100% pure by this definition are ML or System F.

How closely does Rust relate to the Lambda Calculus

Rust has some functional features, however they are isolated and many people program without utilizing these features. This is maybe a little bit harsh because Rust is derived from something closely related to Lambda Calculus called Calculus of Constructions.

What is the Calculus of Constructions?

CoC was created by Thierry Coquand to help in research towards automatic theory proving and as a basis for mathematics. The popular Coq proof assistant is based on CoC theory.

What does CoC have to do with Rust

Rust relies heavily on something called linear types for checking certain consistency principles in Rust programs. All Rust code, not just the functional parts, is subject to this analysis. Linear Types are a cousin to CoC logic. This familiar relationship implies that all Rust code can be interpreted from the perspective of CoC constructions, which are purely functional.

So is Rust purely functional

No. However Rust can be readily adapted to interpretation through a purely functional lens.