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

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

    For a newbie probably something like Scheme (which is just a particular flavor of LISP) although I wouldn’t call it a good language.

    Here’s the thing with purely functional languages that don’t allow in place mutation (most of them, or only under special circumstances like Haskell’s ST Monad), they force you into learning functions that typically don’t exist in other languages like foldl and force you to think about approaching problems in a different way. This will make you a better programmer even when working on other languages, but it’s very much something you have to learn and like all learning it will take time and effort.

    I’m actually tempted to say Haskell is the best option because it actually is a really good language but it’s not so much a learning curve as it is a learning grand canyon. It has an amazingly powerful type system (very similar to Rusts) and uses it very well, but it’s also very unintuitive because it’s deeply rooted in academia and uses names for things taken from set theory and mathematics (terms like endofunctor, profunctor, affine space, and of course the famous Monad). If you’re finding Rust a struggle Haskell would be 10 times worse for many of the same reasons.

    Another maybe good option that I can’t definitively recommend would be OCaml. I’ve heard really good things about it and what I’ve seen of it looked good, but I haven’t personally used it beyond maybe a little reading and a hello world type thing so I’m unsure what kind of pitfalls a newbie might run into.

    The primary reason I’d recommend Scheme is because it’s in many ways a very primitive language. Its type system is very simple and it really doesn’t have a lot going on other than being purely functional. That is also its biggest downside with its second biggest problem being a rather annoying syntax (be prepared to spend a lot of time counting parens to make sure you’re closing every pair and working in the scope you think you are).

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

      Thanks for your write-up. Haskell sounds interesting but a bit intimidating. I’m definitely intrigued by the functional programming thing though, I think that might be my next stop. Ruby seems interesting but I’m already familiar with JavaScript, which seems a bit similar to me, so it would be nice to shake things up a bit.