Zig vs Rust. Which one is going to be future?

I think about pros and cons and what to choose for the second (modern) language in addition to C.

@programming@programming.dev

  • OpenStars@discuss.online
    link
    fedilink
    English
    arrow-up
    1
    ·
    edit-2
    2 months ago

    So *I* who am careful to write readable and safe code, have to use a non-preferred language preference b/c someone else cannot handle using it properly?!

    Sadly, that is the realization that I have come to as well. A chain is only as strong as its weakest link and all that… but no, really, that’s true, b/c modifications are likely to be made at some point (kinda biasing towards production there but even so, answers with perl one-liners on e.g. StackOverflow are ubiquitous, but someone would have to know the language to be able to modify them to suit their specific use-case, so also not at the same time).

    Fwiw I really did not think that Perl was hard to learn - though that was coming from the likes of assembly, various Basic styles, C/C++, and having already learned regular expressions via Unix e.g. grep and awk and sed. “Regular expressions” are quite a steep learning curve, though that’s not the same thing as Perl, and quite frankly Perl is the undisputed (iirc?) master of them all, so whether someone wanted to write Perl without those, or wanted to do try to do regular expressions without Perl, either way Perl seems good for having included regular expressions, not something to penalize the entire language for. Also, C/C++ (and Rust) has a bit of a known learning curve as well…:-) Though indeed it’s entirely fair to say that if someone were to pick just one language, then I would be hard pressed to find any justification for that being Perl. C/C++, Java, Python - all of these, depending on the situation, are fine choices, whereas Perl is absolutely niche.

    But even so, why would it follow that it would necessarily be a good thing if Perl, or let’s say awk, would fully “go away”? I kinda see Perl and awk as being in the same boat these days - both niche and powerful, yet both steadily becoming obsolete? Just b/c something else is “better” doesn’t mean that everything else must die. Except, as you mentioned, for reasons of collaboration and thus code-reuse. Even there though, putting all of our eggs into a single basket scares me: what if tomorrow Microsoft, or Google, decides to purchase the rights to Python and suddenly control that entire industry sector in one fell swoop?

    • deegeese@sopuli.xyz
      link
      fedilink
      arrow-up
      6
      ·
      2 months ago

      Personal projects vs everything else:

      Did you want to collaborate with other people? Use something other people like.

    • lad@programming.dev
      link
      fedilink
      English
      arrow-up
      4
      ·
      2 months ago

      So I who am careful to write readable and safe code

      I just want to point out that it’s hard to be sure your code is readable if you don’t work with a team. More than once I saw people write “readable” code that was not readable. My own code I deemed “readable” was in fact not, as time had shown when I returned to fix something. So, the cited part looks a bit arrogant 😅

      • OpenStars@discuss.online
        link
        fedilink
        English
        arrow-up
        2
        ·
        2 months ago

        Fair - and in fact doubly so bc even code that is readable in a language that someone else does not know (well) isn’t so “readable” by definition. i.e. “readable by someone who knows the language” != “readable by most developers”.

        Though having to rediscover how our code works is something shared by all languages. Perl does allow the worst there though.