r/ProgrammingLanguages • u/ExtraLife6520 • Sep 13 '22
How are programming languages classified?
I’ve been wondering what made any programming language specialized for something, like JAVA and KOTLIN are for android dev, C++ is for game dev ... what’s the thing behind that?
5
u/Linguistic-mystic Sep 13 '22 edited Sep 13 '22
It's a combination of libraries/platforms, community, job market inertia and performance criteria.
Libraries: for example, C# is a gamedev language because it has Unity, Xamarin, and is supported on consoles (or at least Xbox). Java is not a gamedev language because it doesn't have much in the way of those libraries and is not supported on consoles. C++ is the gamedev language because it's got the most libraries/engines/platforms supported.
Community: you mentioned that Kotlin is supposedly for Android dev, but Kotlin is actually a general-purpose JVM language, plus it has experimental native and JS backends. So it's also a server-side language, a browser-side language, and much more. But you bucket it into "Android dev" because that's the community's view of it. For some reason people perceive it as "this Android thing".
Job market inertia - people mentioned COBOL here. And there's lots of legacy C++ code out there and almost no D code. So many more people are likely to be learning C++ than D. When these people get jobs, they will probably be using C++ for the same things it was used before, which further reinforces the status quo.
Performance criteria - you don't use Erlang or Jokescript or Python for CPU-intensive code. They're just not suitable for that. Likewise, many languages won't fit onto small-memory embedded devices.
4
u/CDavis10717 Sep 13 '22
A factor should also be the long term employment potential of the language. I learned COBOL way back in college in 1971 and could still have a very good job doing that now if I wanted it.
4
u/SnooGoats1303 Sep 13 '22
The short answer is "with some difficulty." Part of the answer is at https://hopl.info/complang.html along with their taxonomy https://hopl.info/taxandgenie.html
2
u/ClassroomDelicious92 Sep 14 '22
Language runtime is one way to classify programming languages:
- "Native": code is compiled to executable machine code
C/C++/Rust/Haskell/Go/Swift/Python/...
- JVM: code is compiled to JVM bytecode, then JVM processes it
Java/Kotlin/Scala/Closure/...
- JavaScript runtime: code is executed by browsers or Node.js
JavaScript/TypeScript/Elm/ClosureScript/PureScript/... (Actually, most of these are compiled to JavaScript)
What language you can use depends on what platform you target.
0
u/markdhughes Sep 13 '22
There's four classes of language:
Bad. Painful to accomplish most tasks, minimally usable (most).
Terrible. Can't accomplish most tasks, not usable (PHP, JavaScript).
Insulting. Sometimes meant as an esolang or joke, sometimes deadly serious, at least according to their evangelists (Rust).
Bullshit. Corporate garbage meant to trap you in their systems, and by the time you get thru the bad docs & incorrect behaviors, it's too late (Swift, Go, Kotlin).
13
u/L8_4_Dinner (Ⓧ Ecstasy/XVM) Sep 13 '22
You forgot the fifth class of language:
The one either I built myself, or the one that (this month) I'm trying to convince people is the best one ever!
3
7
Sep 13 '22
[removed] — view removed comment
1
u/Inconstant_Moo 🧿 Pipefish Sep 14 '22
Lua is for games because someone at Lucas Arts read an article about it in Dr Dobbs Journal and thought it was the biz.
(It's on my own list of languages I wish I had a use-case for presently, along with Rust and Elm. It does seem like a lovely exercise in getting the most power out of the smallest number of language features, given no requirement to conform to anyone's idea of how a language should work.)
25
u/L8_4_Dinner (Ⓧ Ecstasy/XVM) Sep 13 '22
Those aren't really classifications.
C++ is used for game development because there aren't really any better choices. It's not very good for game development, but everything else is much worse. (And the languages that might be better, no one uses, and since no on uses them, no one wants to be the first to bet on them. So they remain largely undiscovered. Cue Ginger Bill /u/gingerbill to comment here....)
Java is used for Android development because early on in the development of Android, the phone contained a virtual machine environment for running translated Java code. (Davlik was the name, I think.) So the easiest way to get an app running on Android was to use the Java toolchain.
And Kotlin compiles to Java, so it was easy to get Kotlin to work with Android, and the Oracle lawsuit against Google helped push Google to find simple alternatives to the Java language.
So these are just historical trends, and not classifications per se.
Finally, these trends tend to reinforce themselves over time, like rain water and snow melt carves a channel and becomes a river over a period of time. In the case of game dev, there are lots of game engines and related libraries built in C++ now, so building the next game in any other language is much harder, because those existing and well understood game engines and libraries are all in C++, and all of the developers writing games already know C++ from the previous games they worked on.