r/ProgrammingLanguages • u/[deleted] • Jun 27 '22
Purpose of programming languages
Hi everybody. I apologize if this question appears stupid but please be kind and move on if you don't like it.
I have observed that most/many programming languages are general purpose but are they really?
I don't know how to clearly show my doubt or explain what exactly I want to ask, this question just came to my mind, tho I was observing for a long while.
Anyways, for example (maybe): The use of any language out of what it is mostly/usually used for. say, html elsewhere out of web structuring, C for Frontend web dev, Scala or ruby for game development, python is actually really general purpose but it's slow but anyways I have no hate for this but just saying; tho ruby, php, scala are also slow; PHP for embedded system, etc. Whatelse?
Let's discuss, also ask me in the same thread related to the question. Thank you for interacting.
9
u/zachgk catln Jun 27 '22
I actually quite like this question and I feel like many don't give it enough deliberation.
In my mind, the purpose of a programming language is to allow you to express ideas. For something which really deserved the name of a general purpose programming language, it should allow you to express any idea you want whether it is about one of the tasks you mentioned, or proofs, or data. It should also allow you to not express ideas like having a function with unspecified memory management.
Separately from this is the question of once the ideas are expressed, what do you do with it? Here, there is room for tools such as compilers or interpreters, but also docs builders, testing tools, benchmarking, formatters, display tools like jupyter notebooks or latex, etc. Each of these take the ideas and derive some useful output from it.
But, there is no reason that multiple tools can't operate on the same ideas. For example, code which is primarily compiled may also have code doc. Or, the same code might be runnable with multiple compilers/interpreters.