r/ProgrammingLanguages • u/Voxelman • Feb 29 '24
Are "mainstream" languages dead?
/r/functionalprogramming/comments/1b2udsy/are_mainstream_languages_dead/2
u/zefciu Feb 29 '24
But how you define “mainstream language”? Yes, there was a period in the history of PL design, where OOP was very hyped and thought as the “silver bullet” of programming. So you might find that a lot of languages designed in this certain period use OOP heavily. But what about those that were created before (and still thrive like C)?
0
u/Voxelman Feb 29 '24
With mainstream I mean the currently most used programming languages. In the top 10 (skipping declarative languages like SQL or HTML) are almost only imperative languages (including OOP). The only language that stands out a bit is Typescript.
1
u/zefciu Feb 29 '24
Then the answer is “why not”. Note that it takes time for a language to become mainstream. E.g. Python that is one of the most popular languages nowadays was created in 1991. And for the whole 90s and 00s it was considered a niche scripting language. If you looked at it then, you would probably think about it as you now think of these “all new languages”.
68
u/AdversarialPossum42 Feb 29 '24
"Any headline that ends in a question mark can be answered by the word no."
52
u/myringotomy Feb 29 '24
no.
Next question.
3
u/Middlewarian Mar 01 '24
Code generation and services are both important. I'm bringing them together with an on-line C++ code generator. Most "modern" languages don't have this.
40
u/BEisamotherhecker Feb 29 '24 edited Feb 29 '24
The omission of Kotlin and Swift in the "new languages" list despite including languages 99% of programmers never heard of like Gleam and Roc says all you need to know, it's a selective view, an argument looking for justifications.
4
u/ProgrammingLanguager Feb 29 '24
to be fair they still fulfill some of the requirements and are, sort of like rust, moving towards more functional approaches, though definitely not as strongly
3
u/BEisamotherhecker Feb 29 '24
I can't speak much about Swift but of the 6 properties listed Kotlin only has type inference and maybe immutability by default since function arguments are the equivalent of
valnotvar. I say 6 because the static typing point shouldn't even be there since statically typed languages have always been a thing since Fortran.Now does Kotlin take measures that address points 1 and 2? Sure, in Kotlin types have to be explicitly defined as nullable to be able to accept null and the language will not let you access properties from a nullable variable unless you explicitly tell it with the
!!operator, and OOP isn't forced on you like it is in Java with its "everything in global namespace must be a class" mentality.
18
u/Serpent7776 Feb 29 '24
Mainstream/traditional is not a fixed term. What's mainstream now, wasn't back in the days. What's niche now, can be mainstream in the future. The mainstream will just change it's meaning.
Do traditional languages have any future?
Depends how far you want to look. Currently mainstream languages aren't going anywhere any time soon, but everything dies eventually.
16
u/Lantua Feb 29 '24
Half of this is more of an “if the compiler can do it, just let them do it”:
Default vs explicit "null-ability"; the famous trillion-dollar mistake. It is easier to have the compiler remind you to do a null check.
Tagged Union vs Untagged Union as primary union type; both achieve the same thing, but one puts the burden of bookkeeping on the programmer, while the other does so on the compiler. (note: rust has
uniontype)Type inference or not; it is always possible to clarify the type as necessary. This is just a purely convenience unlocked by better compiler implementation.
That said, new languages are also designed with those decisions in mind, e.g., https://www.reddit.com/r/ProgrammingLanguages/s/V0DP3agGqW, but I'm not sure if that's what you have in mind.
3
3
u/redchomper Sophie Language Mar 01 '24
By definition, that which is mainstream is not dead. What is dead, is no longer mainstream.
3
u/oantolin Mar 01 '24
All newer languages I know have at least a subset of these properties
All languages, whether newer or older, have some subset of those properties!
1
1
u/Chaos_carolinensis Feb 29 '24
I don't think anyone is seriously considering replacing assembly languages any time soon.
1
u/ProgrammingLanguager Feb 29 '24
I mean, the goal is progress isn't it? There are definitely languages doing their own thing or trying to improve on the traditional without changing too much (Rust & Zig in the systems space would in my opinion fall in here)
0
Mar 01 '24
[deleted]
3
u/Head_Mix_7931 Mar 01 '24
And even saying that Rust doesn’t have inheritance is an overstatement. Traits can have default implementations. If you don’t provide your own implementation…. You just get the default. So effectively traits can be abstract or concrete, and methods / associated functions can be virtual or abstract. Traits can even specify super traits! In which case they’re inheriting from an interface which the programmer may or may not provide non-default implementations for.
3
Feb 29 '24
[removed] — view removed comment
2
u/SKRAMZ_OR_NOT Feb 29 '24
Honestly whenever I see people discussing OOP nowadays they either mean (1) inheritance specifically, or (2) (as it seems the OP meant here) Smalltalk-style dynamic message passing.
At this point I'd mostly just avoid the term
10
u/JMBourguet Feb 29 '24
Nothing has a future if you take a long enough time frame. What time frame are you interested in?
Since the 80's, I've seen about every new languages pretending to be a replacement for C. C++ has not totally replaced C. Neither C not C++ have totally been replaced by all the others, although some of them have carved out a more or less important niche were they are used. From where I stand, of the five languages you cite only Rust has succeeded to grow out of the circle of its designers.
IMHO, the tendency will continue, but I seriously doubt that C and C++ will be reduced to "legacy" languages, i.e. mostly restricted to maintenance of existing systems in the next 10 years. And when that will be the case, they still will have a long long live.
I've a specific opinion for each of your point about what should be. I won't pretend that I'm knowledgeable enough to answer your question about "new (serious) languages".
This seems to be a best known practice in a fundamental way. Compatibility is probably the only good reason not to comply.
This seems to be a best known practice in a fundamental way for statically typed language. Compatibility is then probably the only good reason not to comply.
For dynamic languages, the design space is more open.
I believe that there is a fundamental interest in having both statically and dynamically typed languages. Type inference may displace and increase the domain where both are applicable, but will not remove the interest of dynamically typed languages.
I think that, excepted for machine languages, untyped languages are a design mistake, at best lacking of foresight.
Not sure there is agreement on what OOP is, it has somewhat became a scapegoat after having been a buzz word.
I've argued in the 90's it was overused. I'd be arguing today that it is still useful in some domain if you go by a sane definition of OOP (I'd go by "the use of dynamic inclusion polymorphism" if you want mine and remind the principle that what a language prevent is as important as what it allows).
I agree but I'll note
that the absence of discriminated unions seems a quirk of C more than one of their language generation (see Pascal for instance).
that there is a relationship between discriminated union and class inheritance, they both are ways to provide dynamic inclusion polymorphism in a statically typed language, offering different trade-off, favorizing different axes of evolution (see the expression problem).
Like for OOP, I think the backslash against exception is too important. There was an overuse against which I've argued in the past, there seems to be now a "anything but exception" which doesn't seem wise.
There is a trade-off between various characteristic in error handling; exception is indeed close to an extreme in that trade-off, but still the best one known for some use cases, probably more relevant for dynamic language than for static languages.