Please ELI5, I lost track. I used to learn a bit of C and a bit of Python a few years ago but never really went deeper into programming. And now suddenly it seems that a host of new programming languages have appeared and that stuff that used to work fine in whatever old language it was in is now rewritten in a new language.

How do languages like Golang and Rust differ from older languages (these two have probably been around a while but for me they feel ‘new’)? Why are we coming up with new languages all the time? Besides those two, what other languages are there worth knowing about? Is it worth learning them? Are they going to come up with yet another one next week? (I know, many questions, an invitation to infodump I guess …)

  • resipsaloquitur@lemmy.cafe
    link
    fedilink
    English
    arrow-up
    12
    arrow-down
    5
    ·
    2 days ago

    For the same reason every engineer looks at legacy code and says “this is too complicated! I’m throwing this out and starting over” only to find out the hard way that the “complication” was a decade worth of requirements.

    Hubris.

    • draco_aeneus@mander.xyz
      link
      fedilink
      arrow-up
      10
      ·
      2 days ago

      There have been genuine advancements in language design in the last three decades. The existing languages aren’t suddenly outdated and useless, no, but it’s just as wrong to say there is no room for growth and improvement.

      Besides, nobody is throwing away legacy code and starting over, at least when it comes to language development. The language teams are new groups working on new projects.

      We also see that the ‘legacy’ languages are taking lessons from the new ones. Java is implementing features first seen in Kotlin. C++ is getting classes inspired by Rust. The users of these existing languages are benefiting by the development efforts of these new languages, without ever having to even use them.

  • Pieisawesome@lemmy.dbzer0.com
    link
    fedilink
    English
    arrow-up
    55
    ·
    4 days ago

    Golang is 16 years old and rust is 14 years old.

    Why do people use them? Why do developers prefer C or Python? Because they like them.

    Go has a good niche of native + performance for systems programming. It’s still more abstract than C, but much less than Python. It’s a good middle ground. It’s not JIT like C# or Java.

    Rust is just as fast as C, allows lower level programming that you could do with C. Rusts big advantage is that its memory safe (unless you use unsafe). That eliminates a very common C bug.

    • nous@programming.dev
      link
      fedilink
      English
      arrow-up
      33
      ·
      3 days ago

      Rusts big advantage is that its memory safe

      Most languages are memory safe. It’s only really C, C++ and zig that are not (at least for more mainstream languages). Rust is special as it is memory safe without a garbage collector. Which is big for domains where the overhead of a GC is unacceptable.

  • fubo@lemmy.world
    link
    fedilink
    arrow-up
    47
    ·
    3 days ago

    Trying to stop software engineers from inventing new programming languages is like trying to stop college students from having sex. You’re better off spending the effort on promoting safety¹ rather than abstinence.


    ¹ type-safety, memory-safety, etc.

    • blx@piefed.zip
      link
      fedilink
      English
      arrow-up
      11
      ·
      3 days ago

      Thanks to your comparison, I can now totally relate!

      *am software engineer

  • silly_goose@lemmy.today
    link
    fedilink
    English
    arrow-up
    24
    ·
    3 days ago

    Making a new programming language is like inventing a new musical instrument.

    It represents the creator’s vision of what good music is and how easily and well it produces these sounds.

    • Napster153@lemmy.world
      link
      fedilink
      arrow-up
      5
      ·
      3 days ago

      So can we expect some dude whose gradually going blind to be the programmer equivalent of Mozart to write the single greatest script soon?

    • schmorp@slrpnk.netOP
      link
      fedilink
      English
      arrow-up
      1
      arrow-down
      1
      ·
      3 days ago

      Ah, I like this comparison - something I can relate to. I mostly listen to either European Pre-Renaissance or world music/folk jazz these days. What would that be in programming languages?

      • silly_goose@lemmy.today
        link
        fedilink
        English
        arrow-up
        2
        ·
        3 days ago

        It’s probably C that’s closest in the programming language world. It’s old, stood the test of time and is still popular.

        • heartSagan5@lemmy.zip
          link
          fedilink
          arrow-up
          1
          ·
          3 days ago

          C, in some ways, is probably like a Xylophone because I always “get assembly” when I think it, and I know bits are the drum line and the CPU is the drummer.

  • Eggymatrix@sh.itjust.works
    link
    fedilink
    arrow-up
    21
    ·
    4 days ago

    People fogured out that there are better ways to abstract problems than what we thought 50 years ago. Hardware also has changed, now favouring a lot more concurrent programming on multiple threads, rather than efficient sequential execution.

    In some cases languages have evolved but keep back compatibility, like C++, where you can use modern features like template genericity, metaprogramming, introspection, coroutines but still do OOP with virtual functions like in the early 2000s or pointer juggling and manual allocation like C.

    This comes at a great cost of complexity, so people figured that limiting the scope of languages to only modern stuff frees up cognitive space and kept on adding languages.

    Since software development is still a young science all this is still being figured out, so there are a LOT of new languages every year.

  • Nibodhika@lemmy.world
    link
    fedilink
    arrow-up
    8
    ·
    3 days ago

    I don’t think there are more languages being created now than before. There are tons of languages that have been created over the years, but you get the survivors bias effect where the ones that are actually useful in some context start being used in that context, and the ones that are less useful stop being used.

    When you were learning python was already established, but I remember having long discussions trying to convince people to use it instead of Java because it was a much higher level with much better in many aspects at some cost performance, and if you’re not willing to pay that cost you should revert to C++ which is much better than Java anyways.

    And that’s sort of what’s happening here. C++ is good for things that need to be fast, but it requires careful consideration to avoid several issues, if you don’t need the speed, python gives you a much better experience in several aspects. For other specific things there are specific languages that fit better, if you’re developing for web JS is already in most browsers so that’s an easy choice, and if you want to make a game maybe you learn C# to use in Unity. But for general stuff C++ and Python have been the de facto standards as they cover most use cases very comfortably, so there hasn’t been any real competition for them.

    Enter Rust, Go, Zig, etc. Even if something is a standard it doesn’t mean it’s the best thing, Assembly, Cobol, Fortran, C have all been standards, but C++ can do 99% of what those other languages did and makes things easier, so slowly it became the default language. Of those “new” languages the only one I know enough is Rust, so let’s talk about what Rust brings to the table that’s not available on C++ or python, and why people are so excited for it.

    Rust is fast, we’re talking C level fast, this means that Rust beats almost every other language (including C++). Rust is safe, it’s purposefully designed not to allow you to miss use it accidentally, this includes memory safety which is the most talked about, but it’s a whole thing in Rust, with enums you need to match all cases, result types that includes error responses, and optional objects that force you to acknowledge the None. Rust has a great package support, better than python because it’s standardized. Besides all that Rust is able to be used almost everywhere, whereas C/C++ does work in many places, but libraries for it don’t.

    So, why new languages? Because there are things to improve.

    • Dookieman12@piefed.social
      link
      fedilink
      English
      arrow-up
      2
      ·
      3 days ago

      Just wanted to add, the reason JavaScript is on the web is because it’s designed to keep running, no matter what errors occur. This is the opposite of what’s desired from most languages, but the reason it’s a priority for JS is because the web page HAS to work.

      This is the reason for a lot of JS’s quirky behavior, such as type coercion. In most cases, 1 + ‘cat’ should absolutely produce a terminating error. But, you don’t want someone visiting your site to have the page crash, so it’s preferable to return bad data than to terminate entirely, so you get ‘1cat’ as your output.

  • red_tomato@lemmy.world
    link
    fedilink
    arrow-up
    13
    ·
    4 days ago

    All programming languages suck in their own way. Naturally people want to create languages that suck a bit less for their particular problem.

    Go was created because compile times in C++ are ridiculously long. Rust was created to prevent common memory bugs without sacrificing runtime performance.

    C and Python are still widely popular. It’s rare these days that a new language completely displaces an old one, so don’t worry about being left behind by learning an ”old” language.

    Other popular languages are C++, Java, C# and JavaScript.

  • 9point6@lemmy.world
    link
    fedilink
    arrow-up
    11
    ·
    3 days ago

    As others have mentioned Go and rust are nearly old enough to drink.

    And the answer is pretty simple, if an existing language does something differently to how a group of people wants to work, someone will eventually write a language to do it that way.

    There’s no single way to solve a problem, and that’s a good thing. If someone wants to whip something up quickly there’s a host of high level languages to do that in, it just probably won’t be especially quick. If you really care about performance, there are low level languages with varying levels of safety measures. Then there’s the whole code style thing, you might be a functional programming monk who is truly at home in APL, others may still long for something a bit more LISPy.

    stuff that used to work fine in whatever old language it was in is now rewritten in a new language.

    This is an illusion. If a project is moving from one language to another, that’s not a lightly taken decision, and almost definitely means they’ve had it with all the issues brought by the first language. I’m assuming you’re referring to the movement from C/C++ code to Rust that I’ve seen a fair bit.

    This one particularly is because in C-like languages, any engineer will make mistakes, and those mistakes may never be obvious enough to be fixed. These kinds of mistakes are what cause those random crashes that never get fixed, but more severely, they often also give an opening for a security researcher (or someone more nefarious) to exploit. No one typically wants their software to be used for making people’s lives worse, so a lot of effort will be put into trying to catch those issues early, and manage the situation when one isn’t. With the advent of AI many projects have seen an exponential increase in the number of security issues they’re dealing with.

    Or, they could bite the bullet and move to something like rust which keeps the performance benefits, but removes the ability to even make the mistakes in the first place.

  • originalucifer@moist.catsweat.com
    link
    fedilink
    arrow-up
    10
    ·
    4 days ago

    its like this.

    is there only one tool in your toolbox? no? why not? cuz you need the right tool for the right job, obv

    thats why there are lots of languages. new languages are tools for jobs.

    the ‘jobs’ change over time and so do their requirements… the languages are just evolving to match our required workflows

    • qualia@lemmy.world
      link
      fedilink
      English
      arrow-up
      5
      ·
      4 days ago

      Yes, evolution. The best measure of fitness in any system is diversity. So many languages may be unwieldly for any one person but they’re more fit as a whole system.

  • ExLisper@lemmy.curiana.net
    link
    fedilink
    arrow-up
    2
    arrow-down
    1
    ·
    2 days ago

    The best way to understand this is… to learn a new language. C and Python are language with some of the worst tooling out there. C was simply created before languages had decent tooling and the foundation responsible for standardizing Python is doing a terrible job. Just having quality tools to work with a language makes a big difference.

    On top of that people keep coming up with better ideas to do things. Sometimes it’s possible to add those ideas into older languages and sometimes it’s not. Java was able to add algebraic types but it will never get rid of null values. Even when you can add new features they are always something optional. Creating a new language lets you take the best ideas out there and use them as a base for the entire language. Having strong base makes the whole language better.

  • Infrapink@thebrainbin.org
    link
    fedilink
    arrow-up
    5
    ·
    3 days ago

    A novice asked Java master Banzen, “What is the most perfect programming language?”

    The master answered, “The one which accomplishes the desired task with the least effort expended by the user.”

    The novice asked, “Is there a language which exceeds all others in this regard?”

    The master answered, “Build me a garden of ten thousand stones!”

    –From The Codeless Code

    • Infrapink@thebrainbin.org
      link
      fedilink
      arrow-up
      6
      ·
      3 days ago

      A thin, bedraggled stranger came to the Temple one night and asked for master Kaimu. The master was roused and brought to the gate, whereupon the stranger said:

      “For years I have wandered this pitiless land, seeking the perfect programming language. Name any one and I’ve given it a go, be it fast or slow, high-level or low, from Ada to Zeno. But whatever the pluses there are minuses too, so I pack my things and hit the road again—which in this case led me to your door.”

      Kaimu asked the stranger to describe the language of his heart’s desire.

      “It must be suitable enterprise-wide,” the stranger replied, “client-side and server-side, in scripting, in shells and in spreadsheet cells. I need it real-time, multi-threaded and optionally object-oriented; with garbage collection, deadlock detection, custom exceptions, auto-resizing arrays of things and regular expressions for matching strings. I want the simplicity of BASIC, the purity of Smalltalk, the brevity of Haskell, the speed of C, the consistency of Lisp, the readability of Python, the flexibility of Perl, and the portability of… Java, I guess, but with native code bindings that aren’t a mess.”

      “Then tomorrow morning we shall assist you as best we can,” said Kaimu. “But tonight you must spend in the carpenter’s shed below the south wall.”

      The stranger bowed and departed to make his bed amid sawdust and wood shavings. As Kaimu left for his own chambers a monk asked, “What is your design for him?”

      “When dawn breaks,” replied the master, “our guest will see that on the walls of that shed are arrayed ten thousand tools, each crafted to serve a unique purpose. No one would mistake the hammer for the chisel, and no true carpenter would renounce one for the other.”


      At the sun’s first light the stranger returned to the Temple gate, there to be greeted again by Kaimu and the monk.

      “Do you still seek your heart’s desire?” asked Kaimu.

      “No!” replied the stranger. “For in the shed I found a most marvelous dagger, no larger than my hand, whose hilt opened to reveal the most wonderous things: tweezers and toothpicks, pliers and drill-bits, wrenches and reamers and rulers and tiny blades too numerous to count! Holding it I understood that my destiny is to fashion the thing I have sought for—a language made of other languages, a tool to end the need for other tools!”

      And with that the stranger bowed and departed.

      The monk turned to Kaimu, whose jaw had gone somewhat slack. “What do the annals say on the subject of the Misunderstood Lesson?”

      “That it too brings wisdom,” said the master, “If only to the hapless teacher. No doubt I would have been twice as effective had I been half as clever.”

      “And what of the stranger?” asked the monk. “Surely he will fail in his endeavor, for that knife he prizes holds neither hammer nor chisel. And should he partly succeed then all the worse, for he will have added yet another language to a world that already drowns in confusion.”

      “Let him try, and good fortune to him!” said Kaimu. “If not for fools of his fashion, we would not have Perl or Python, Bourne shell or Tcl, and the world would be a poorer place. I only grieve that you and I are not such fools, for since we will never attempt the impossible, we can never hope to achieve it.”

      Thus master and monk left the gate, and went in to the Temple together to greet the morning.

      ibid

  • AnAmericanPotato@programming.dev
    link
    fedilink
    English
    arrow-up
    5
    ·
    3 days ago

    A lot of the time, a new language is created to make one particularly difficult thing easy.

    For Go, that one thing was concurrency. You CAN do concurrency in C or Python or whatever, but it’s not really built into the language. It’s hard to do right and easy to do dangerously wrong.

    For Rust, that one thing was memory safety. C leaves it all up to you, so it’s very easy to make mistakes that lead to memory leaks, crashes, or security vulnerabilities.

    If you program in any language for a significant amount of time, you’re bound to find a few things that you do a million times that you wish were easier to do right and harder to do wrong. Some people see those problems and say “I can make something better”.

    • benjirenji@slrpnk.net
      link
      fedilink
      arrow-up
      2
      ·
      3 days ago

      But if a language makes a particular thing easy, it also forces you to adopt a certain premise and accept the way the language solves that particular problem. This also limits you.

      Every new language wants you to accept a new premise.

      I’ve got a friend who rewrote parts of the C++ standard lib to optimize it for his purposes. I guess an STL isn’t the same as a language, but my friend’s efforts is maybe a small version of people recreating a new language to solve a problem.