Functional programming gets a bad rap for performance and clarity (of the generated assembly) because most of them have gigantic runtimes like the JVM or Haskell but the way it is implemented in Rust is quite a bit different.
Functional programming gets a bad rap for performance and clarity (of the generated assembly) because most of them have gigantic runtimes like the JVM or Haskell but the way it is implemented in Rust is quite a bit different.
Because I want a simple to read language?
It's not all about performance. C++ doesn't have bad performance and is safe, yet isn't used in Linux, nginx, or OpenBSD.
Why?
I've heard here how every team has their "subset" of the language that they use.
So you're trying to unseat C from it's perch. Fine. I understand, it's too easy in C to have memory errors and pwn computers.
But if you want to fix that by forcing people to switch to a different paradigm, it aint gonna happen.
Out of the top 10 programming languages on GitHub, most (by far) are imperative.
If someone would make a safe C, there can be hope in convincing Linus to slowly switch.
Now? There's 0 chance of that happening.
>Why?
Because those communities, logically due to the UNIX influence, are biased towards C.
C++ is heavily used on Android and ChromeOS native subsystems, Mac OS X drivers, Windows, Genode. Symbian and BeOS were written in C++.
Not Linux (Warning: Typical Linus rant - http://harmful.cat-v.org/software/c++/linus).
So you want to make a language simpler to read by removing a paradigm that produces much more readable and less error prone code for a wide variety of very common use cases? I'm sorry but that makes no sense. You're saying that imperative code is always more readable, no matter what the problem is, and that is fundamentally untrue. Otherwise we wouldn't have a bazillion programming languages, paradigms, and syntax styles.
C++ doesn't have bad performance, it has worse performance. Linus has made some very public comments about why he doesn't want C++ in the Linux kernel and it isn't because it's hard to read or slow, but because it's too complicated especially when some of the more advanced features interact. Rust was built to avoid many of these downsides.
Rust doesn't force you to switch to a functional paradigm and I have no idea where you got that from. I explicitly said "remove functional programming from a low level language like Rust" not "switch to a functional programming language altogether."