r/functionalprogramming • u/Voxelman • Feb 29 '24
Question Are "mainstream" languages dead?
I want to know what new languages are currently developed in the last few years, that have the potential to become at least some importance.
Because all new languages from the last years I know of have lots of things in common:
- No "Null"
- No OOP (or at least just a tiny subset)
- Immutability by default
- Discriminated Unions (or similar concept)
- Statically typed
- Type inference
- No exceptions for error handling
All newer languages I know have at least a subset of these properties like:
Rust Gleam Roc Nim Zig
Just to name a few I have in mind
In my opinion programming languages, both mainstream and new, are moving more and more towards more declarative/functional style. Even mainstream languages like C++, C# or Java add more and more functional features (but it's ugly and not really useful). Do traditional languages have any future?
In my opinion: no. Even Rust is just an intermediate step to functional first languages.
Are there any new (serious) languages that don't follow this trend?
View all comments
Show parent comment
5
u/Voxelman Feb 29 '24 edited Feb 29 '24
C++ is originally an object-oriented language. Over time, people have realized that some features from functional programming are actually not that bad and have tried to integrate them into the language without losing backwards compatibility.
The problem is that (in my opinion) it is very cumbersome and unpleasant to program functionally in C++, even if it is possible. But this applies to any imperative or object-oriented language.
Conversely, it is unpleasant to program imperatively or object-oriented in a functional language, even if the language supports it.
This is simply due to the opposing concepts. Imperative programming requires the mutability of variables, whereas in functional programming, mutability is more than undesirable.
The question now is what will prevail in the near future. Mutability first or immutability first. In my opinion, the only sensible way is immutability first with mutability as an opt in.