Hacker News new | ask | show | jobs
by 0815test 2528 days ago
I'm not going to defend the article's writing style, but Rust is effectively a functional language with controlled use of procedural-programming features. Not that much different from how Haskell places safeguards on the very same things. (No, I'm not saying Rust today is just as safe or just as elegant as Haskell - far from it! But it can get there with some work.) Even FP is not what it was back in the 1980s and 1990s!
2 comments

What does functional language mean here?

Rust is not referentially transparent, does not model effects (any function can rm -Rf your drive), permits shared mutable state (RefCell, etc) includes statements not just expressions (break, return). Its most important safeguard is its affine type system, which is absent from Haskell.

Break and return are both expressions in Rust.

Item declarations, let statements, expression statements, and macro invocation statements are the four kinds of statements in Rust.

Can’t you make the argument that that part of Rust is OOP even though the rest of the language isn’t?

Java has added more & more FP style constructs, does it make Java a FP language?