I don’t need something practical. I just need something fun to keep me motivated.

    • ageedizzle@piefed.caOP
      link
      fedilink
      English
      arrow-up
      8
      ·
      2 days ago

      Haha thats great. Thanks for the taxonomy of fun. I have been trying to learn Rust but I find the payoff is still a ways away, so something to keep me going in the meantime would be good. So I guess 1 is the way to go, because if I want to keep going back then that’s good motivation.

      • orclev@lemmy.world
        link
        fedilink
        arrow-up
        3
        ·
        2 days ago

        I’m curious what you mean by the payoff being a ways away. Do you feel you don’t understand some aspect of Rust well enough to write anything in it?

        As a tangent to that and your original question what languages do you already know? Understanding where your knowledge is lacking could help provide better answers as what languages someone enjoys learning/using tends to change a lot as they become more experienced and start to develop an appreciation for the more complicated problems more involved languages help solve.

        • ageedizzle@piefed.caOP
          link
          fedilink
          English
          arrow-up
          3
          ·
          2 days ago

          I feel like the payoff is a ways away because, I write something that should work, but then I need to wrangle with the compiler for sometimes multiple days just to get it to work. To answer your second question, I know a very small amount of Python and some Typescript, but I’m mostly familiar with Javascript. I do think that is part of what’s going on here. Javascript is super losey goosey and not typed. So then my brain translates Javascript code to Rust and it just leads to total chaos.

          • orclev@lemmy.world
            link
            fedilink
            arrow-up
            6
            ·
            2 days ago

            Aaaah, yeah. You’re struggling with thinking in terms of types and scopes and probably also a tiny bit of stack vs. heap allocation. Javascript side steps most of the concurrency problems by having a single threaded runtime, and of course is a garbage collected language so you never really need to worry about memory management either.

            Rust is a much more powerful language, but of course with power comes responsibility. The compiler believe it or not is actually helping you a lot even though it probably doesn’t feel like it. In something like C you’d probably be able to successfully compile those programs that Rust refused to build but then you’d get crashes and weird bugs when you ran the program with very few clues on where you made a mistake.

            Fundamentally here’s the difference. Javascript is making the tradeoff that it will worry about a lot of the details for you, but it will get them wrong a lot and performance will suffer as a result. It also doesn’t give you a lot of ability to express your problem well due to its incredibly primitive type system which will lead to a lot of bugs that are very hard to diagnose.

            Rust on the other hand says you need to worry about the details but it will give you some tools to make managing them easier to the point where you can ignore them a lot of the time. E.G. most of the time you can just stack allocate your variables and not worry about heap allocation and the headaches that can introduce. But the tradeoff for that is you can get some of the best performance out there and its advanced type system lets you model problems in ways that make bugs far less likely and much easier to diagnose and fix.

            Rust doesn’t let you write code that works 90% of the time but fails 10% of the time, it forces you to write it in a way that works 100% of the time. This is particularly true for concurrent code where Rust prevents (mostly) race conditions that nearly every other language lets you write. If you’re thinking some code that should work isn’t compiling it’s almost certainly because that code would fail with some kind of race condition under concurrency. The good news is once you start to understand where these problems crop up it’s usually easy to resolve them by putting a Arc or RwLock wrapper around something or maybe just a simple .clone() if you don’t mind the performance hit.

            • ageedizzle@piefed.caOP
              link
              fedilink
              English
              arrow-up
              2
              ·
              2 days ago

              I see. After reading your comment I can already see how learning Rust is helping me look back and better understand what Javascript is doing, too. So somethings working I guess! Thanks for your response.

          • CameronDev@programming.dev
            link
            fedilink
            arrow-up
            2
            ·
            2 days ago

            Once it clicks, rust can be type 1, it certainly is for me. But it’s definitely a long and hard type 2 to get there.

    • ☂️-@lemmy.ml
      link
      fedilink
      arrow-up
      4
      ·
      edit-2
      2 days ago

      assembly can be a lot of fun to play with if you are not making anything super serious.

      • ageedizzle@piefed.caOP
        link
        fedilink
        English
        arrow-up
        4
        ·
        2 days ago

        yeah, if you want something really esoteric check out piet. it doesn’t even use letters or numbers, the code literally just looks like abstract art

        • rumschlumpel@feddit.org
          link
          fedilink
          arrow-up
          1
          ·
          2 days ago

          Amazing, seems super annoying to use! I am definitely not the right type of person for esoteric languages, lol