Why are there so many programming languages? And why are there still being so many made? I would think you would try to perfect what you have instead of making new ones all the time. I understand you need new languages sometimes like quantumcomputing or some newer tech like that. But for pc you would think there would be some kind of universal language. I’m learning java btw. I like programming languages. But was just wondering.

    • jeffhykin@lemm.ee
      link
      fedilink
      arrow-up
      1
      ·
      1 year ago

      JavaScript (is the universal language) (is also the answer of why there are so many languages)

    • Mic_Check_One_Two@reddthat.com
      link
      fedilink
      English
      arrow-up
      1
      ·
      1 year ago

      You got to it before I did. Programming languages are like vehicles. You wouldn’t take a sports car off-roading, and you wouldn’t expect a tractor to win a drag race. There is a lot you can do with an all-purpose vehicle, but it’s not going to be as good as something that is purpose-built for a single task.

    • Zalack@startrek.website
      link
      fedilink
      arrow-up
      0
      ·
      1 year ago

      I actually don’t think that’s the case for languages. Most languages start out from a desire to do some specific thing better than other languages rather than do everything.

  • noodle@feddit.uk
    link
    fedilink
    arrow-up
    2
    ·
    1 year ago

    New languages deal with challenges the old languages faced differently, with hindsight of how those languages dealt with those challenges and how they could have done things better.

    We don’t even have a universal language for communication. That may not be a bad thing, either. There’s a theory that the language you speak changes the way you perceive the world - I believe that’s true with programming as well. If we only had Java, we’d only get Java-style solutions.

  • glad_cat@lemmy.sdf.org
    link
    fedilink
    English
    arrow-up
    2
    ·
    edit-2
    1 year ago

    You can’t easily improve a language and stay compatible with the previous versions. C++ does it but they are crazy.

    you would think there would be some kind of universal language

    It does not exist, but anyone is free to try and invent it. It should be low-level like assembly and high-level like BASIC, functional, object-oriented, and have weird stuff like traits, concepts, and alien features from Haskell. It must also have both the pointers/references of C++, and the borrow checker of Rust. And don’t forget to make it as secure as Ada with pre and post conditions. But it must still be easy to use. Also you will have to write a compiler for every operating system ever (mainframe, server, desktop, iOS, Android, every phone, every tablet), and contain a universal GUI that pleases everyone. It’s literally impossible to do right now.

    Last but not least, Java was supposed to be this universal language that you can run everywhere. It failed and it cannot be run everywhere. It also had to be improved a lot, and it’s missing a fuckton of features from every other language.

    • OmnipotentEntity@beehaw.org
      link
      fedilink
      English
      arrow-up
      1
      ·
      1 year ago

      easily improve … C++

      I assure you that there is absolutely nothing easy about the C++ standardization process, lol.

  • CodeBlooded@programming.dev
    link
    fedilink
    arrow-up
    1
    ·
    edit-2
    1 year ago

    Think about this: Why are there so many automobiles? And why are so many new models still being made? I would think you would try to perfect what you have instead of making new ones all the time. I understand you need new automobiles sometimes, like construction equipment trucks or some treaded military tanks. But for average daily driver you would think there would be some kind of universal automobile. I drive a Corolla btw. I like automobiles. But was just wondering.

    I’m not here to mock you, just providing an analogy. You can deliver just about anything in one language that you can with another. However, like the car, you might need a different type if you want more performance. Maybe you want a fast car. High performance cars often need a lot of attention, they need that premium gas, the mechanics demand higher pay! What if you only care about getting from point A to point B, and you’re more concerned with driving a car that’s cheaper to maintain, maybe there are just more car mechanics for that type of car, and the cost to pay them is cheaper.

    A C application that is very well tuned to manage memory and threads in the name of perfect performance will require more time and computer science knowledge to create when compared to a Python script that does the same thing, but in the most basic possible way running on a single CPU, running hundreds of time slower.

    Sometimes you need the performance, and often you don’t. Sometimes you need a treaded tank, sometimes you need a NASCAR, and most days the Corolla does just fine, it’ll even let you miss a few oil changes before things get bad.

    As to why we don’t perfect what we have now instead of creating more: technology changes, easier to work with abstractions come about, some people enjoy the hobby of creating a language, or maybe a niche language comes about with very specific trade offs for a very specific purpose, no one wants to break backwards compatibility by adding new features and syntax to their language - I’m sure there’s tons more reasons to list.

  • hascat@programming.dev
    link
    fedilink
    English
    arrow-up
    1
    ·
    1 year ago

    Sometimes it’s easier to try a new idea in a new language (e.g. the borrow checker in Rust) rather than trying to shoehorn it into an existing language.

  • mspencer712@programming.dev
    link
    fedilink
    English
    arrow-up
    1
    ·
    1 year ago

    Think of a programming language as a crutch for the human brain. Processors don’t need it: they don’t have to think about the code, they just execute it. Our mushy human brains need a lot of help, however.

    We need to think about things on our own terms. Different programming languages, different APIs that do the same thing, different object models, these all help people tackle new problems, or even just implement solutions in new ways.

    Some new languages have a completely different model of execution you may not be familiar with. Imperative languages are what we traditionally think of, because they work most similarly to how processors execute code: the major pattern used to make progress, do work, is to create variables and assign values to them. C, COBOL, BASIC, Pascal, C# (my personal favorite), Javascript, even Rust, are all imperative languages.

    But there are also functional languages, like ML or F#. (The latter, I keep installing with Visual Studio but never ever use) The main pattern there is function application. Functions themselves are first order data, and not in a hacky implementation-specific way like you’re passing machine code around. (I’ve only ever used this for grad school homework, never professionally, sadly.)

    And declarative languages like Prolog helped give IBM’s Watson its legendary open question answering ability on national TV. When you need a system to be really, actually smart, not just create smart-sounding text convincingly like a generative AI, why not use a language that lets you declare fact tables? (Again, only grad school homework use for me here)

    Programming is all about solving problems, and there are so many kinds of problems and so many ways to think about them. I know my own personal pile of gray mush needs all the help it can get.

  • MXX53@programming.dev
    link
    fedilink
    arrow-up
    1
    ·
    1 year ago

    I know a handful of languages and I think of them as tools. For example, a flathead screwdriver will work on a phillips screw head (In most cases with some outliers), but a phillips screwdriver might just be better for the job. Same with a wrench and a socket with a ratchet, etc.

    When it comes to programming or scripting I approach it in the same way. If I am at work, and I need to automate something quick and dirty, no end user will need to use it, and it is just adjusting data or spitting data back at me, I am probably going to write it in Python.

    Or, if I need to make something that an end user is going to interact with, I am probably going to spin up a web server and use the MERN stack to create that.

    If I am working at home on a TUI for my favorite application, I am going to use Rust or Python

    And if I working on a project that requires me to work with embedded systems, I am probably going to reach for C, maybe C++ depending on the support, and I have in a couple of instances needed to use Assembly.

    All this to say, I think that if I had to use Python for all of these, I would be in trouble. Same as if I had to use C++ to accomplish all of the above. Could it be done? Sure. Do I want to do that? Not at all.

  • TheCee@programming.dev
    link
    fedilink
    arrow-up
    0
    ·
    1 year ago

    You can not perfect old languages, since there are a lot of features that you can not add on or change afterwards, OP. Not in a worthwile way. This is not a philosophical question, it wasn't for a lack of trying. And since there aren't enough skilled people in this niche, fashion driven field, expect history to repeat itself and some langs at best get 60 to 80% right.

    • Hector_McG@programming.dev
      link
      fedilink
      English
      arrow-up
      0
      arrow-down
      1
      ·
      1 year ago

      You cannot perfect old languages. And you cannot write a new language without making architectural errors. And any new language that deviates significantly from what has gone before will only ever see niche success.

      Thus what we have today is the best we can expect: gradual evolution of new languages, and gradual improvement of old languages. Neither has any particular advantage, but the industry as a whole keeps grasping at the eternal straw of the ‘silver bullet’ language that new languages promise.

  • beeng@discuss.tchncs.de
    link
    fedilink
    arrow-up
    0
    ·
    edit-2
    1 year ago

    Like human languages, you get different types of expressiveness in different ways. If you know multiple languages whether is python or Java, or English and French / Spanish / German, you'll see that there are positives and negatives to each language.

    Lots of people want to design the best combination of them all, using the newest tools and newest tech to create something as useful as possible.

  • Hector_McG@programming.dev
    link
    fedilink
    English
    arrow-up
    1
    arrow-down
    1
    ·
    1 year ago

    Partly because sometimes a particular language suits a particular problem set.

    Partly because people just like writing computer languages.

    But mostly because people mistake the fundamental problem of programming, which is programming is really hard. So someone comes along and thinks “Programming is really hard, it must be a problem with the languages available” and sets out to write a computer language that makes programming easy.

    But all that happens is they trade one set of difficulties for another set of difficulties. They might succeed in making writing the initial version easier, but make maintaining that code harder. Or they might solve some memory allocation problems, but create performance issues.

    Either way, someone will write a language because they think they will help solve the issue of programming being hard, and fail. Because the really hard bit about programming is about understanding everything the program needs to do, in microscopic detail, and translating that into a structure that best fits the problem; not the actual coding itself.

  • gnus_migrate@programming.dev
    link
    fedilink
    arrow-up
    0
    ·
    1 year ago

    There can be a universal language in theory, but it’s borderline impossible to achieve. Every domain has a different set of problems that it needs to solve, and language design involves tradeoffs that may make sense for one domain but not another. That’s why I think language wars are silly, without context it’s impossible to say which language is “better”, because you could have different answers depending on what you’re trying to do.

    In the end you shouldn’t be too concerned with it. There are lots of languages, but all of them fall under two or three paradigms where if you learn one language from that paradigm, your skills are mostly transferable.

    • demesisx@infosec.pub
      link
      fedilink
      English
      arrow-up
      0
      ·
      1 year ago

      It has been achieved by many different projects: The K framework is probably the closest to a universal language.

      There’s also the possibility of formally defining code as an Agda spec which also allows that code to be converted to any other language without adding new bugs.

      Then, you have category theory which is literally a universal language that describes ALL processes in a program.

      Then you also have lambda calculus which does the same thing.

      • gnus_migrate@programming.dev
        link
        fedilink
        arrow-up
        2
        ·
        1 year ago

        I mean if youre going to think of it that way any Turing complete language fits the bill, but what I mean by universal is a language you would reach for to solve any problem you have and it would be better than any other language. It’s not a computer science problem it’s a software engineering problem.