Specifically, I’m interested in BEAM, but I’m not sure if I should go for Elixir or Gleam. What seems cool about Gleam is that it has static typing.

I have no experience with functional programming at all btw

  • masterspace@lemmy.ca
    link
    fedilink
    English
    arrow-up
    7
    arrow-down
    1
    ·
    1 day ago

    I assume this suggestion will get me torched for reasons I don’t understand, but why not a multi-paradigm language like JavaScript/Typescript, or C#?

    • ExperimentalGuy@programming.dev
      link
      fedilink
      arrow-up
      4
      arrow-down
      1
      ·
      1 day ago

      I feel like this is the way. It ensures you get exposed to multiple paradigms and can help you easily switch to a language that’s more invested in one paradigm.

    • XM34@feddit.org
      link
      fedilink
      English
      arrow-up
      2
      arrow-down
      2
      ·
      1 day ago

      I second this. And bonus point: This way you’ll learn a language that has actual real world applications. All thos obscure single paradigm languages are nice toys to play around with, but that’s about it.

  • Mike@lemmy.world
    link
    fedilink
    arrow-up
    3
    ·
    1 day ago

    I did a functional programming course in university snd we learned Haskell and really loved it. By far my favourite subject in all 4 years of uni. Have never used it since tho but it was fun XD

  • qaz@lemmy.world
    link
    fedilink
    English
    arrow-up
    2
    ·
    1 day ago

    F# is a decent introduction into functional programming. You can use .NET libraries and occasionally fall back to imperative code when needed.

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

    Haskell:

    https://learnyouahaskell.com/introduction

    It’s been a while since writing some (2018), but the concepts you learn from Haskell are great (though I still can’t explain Monads, even if my life depended on it) and can be applied in other languages.

    Anyway, I can’t speak to BEAM, but Haskell is very typeful, it teaches you currying, very great language, awful tooling (but that was ~10 years ago, so I hope things have improved since).

    • Corbin@programming.dev
      link
      fedilink
      English
      arrow-up
      4
      ·
      1 day ago

      Haskell isn’t the best venue for learning currying, monads, or other category-theoretic concepts because Hask is not a category. Additionally, the community carries lots of incorrect and harmful memes. OCaml is a better choice; its types don’t yield a category, but ML-style modules certainly do!

      @[email protected] and @[email protected] are oversimplifying; a monad is a kind of algebra carried by some endofunctor. All endofunctors are chainable and have return values; what distinguishes a monad is a particular signature along with some algebraic laws that allow for refactoring inside of monad operations. Languages like Haskell don’t have algebraic laws; for a Haskell-like example of such laws, check out 1lab’s Cat.Diagram.Monad in Agda.

    • thingsiplay@beehaw.org
      link
      fedilink
      arrow-up
      2
      ·
      2 days ago

      When I read about Monads, it looks like to me like generic Rust struct with a generic trait and a (more complex) result as a return value. I have no idea if this is what a Monad basically is or not. For context, I never learned Haskell properly (just tried hello world and read a few topics).

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

        You should think of Monad as basically giving you a way to provide your own implementation of the semicolon operator so that you can dictate what it means to sequence computations of a given type.

        • thingsiplay@beehaw.org
          link
          fedilink
          arrow-up
          3
          ·
          2 days ago

          I think the mistake I do (and many others) is trying to compare existing mechanisms from other languages, without the full picture around that mechanic. Every time I think to understand what a Monad is, its wrong. :D Guess I have to dive deeper to understand what that actually means, not just as an explanation. Just out of curiosity.

  • darklamer@lemmy.dbzer0.com
    link
    fedilink
    arrow-up
    14
    ·
    2 days ago

    “Lisp is worth learning for the profound enlightenment experience you will have when you finally get it; that experience will make you a better programmer for the rest of your days, even if you never actually use Lisp itself a lot.” — Eric S. Raymond, How to Become a Hacker

  • somegeek@programming.dev
    link
    fedilink
    arrow-up
    2
    ·
    edit-2
    1 day ago

    Clojure is simple, is a lisp (huge plus since they are super simple and you gain access to a whole realm of languages), and practical. You can do anything from backend to frontend dev with it, and the philosophy and community are lovely.

    Scheme is less practical but easier to start with.

    Haskell is the least practical but isdefinitely beautiful and helps you understand things better.

  • littleomid@feddit.org
    link
    fedilink
    English
    arrow-up
    11
    ·
    2 days ago

    Why do you want to learn functional programming? If just for fun and learning, then you can’t go wrong with scheme.

    • Lena@gregtech.euOP
      link
      fedilink
      English
      arrow-up
      7
      ·
      2 days ago

      Kinda funny, I’ve also been thinking about scheme as another option. Yes, (currently) it is just for fun and learning.

      • gedhrel@lemmy.world
        link
        fedilink
        arrow-up
        4
        ·
        2 days ago

        Another great avenue into this world is Racket. The tooling is fantastic and the documentation culture is first-class.

        • AlligatorBlizzard@sh.itjust.works
          link
          fedilink
          arrow-up
          2
          ·
          2 days ago

          I had Racket as an intro class language but haven’t really gone beyond the beginner level (I also took another beginner class in Fortran, long story but I don’t hate Fortran, lol) but at that level I enjoyed it. How similar is it to Clojure and what’s my next steps to actually being competent-ish (and maybe employable) from here?

          • gedhrel@lemmy.world
            link
            fedilink
            arrow-up
            2
            ·
            edit-2
            2 days ago

            Clojure has it’s own set of idioms; it comes with some small surprises for old lisp hands. There are some things it’s really brought into the mainstream: performant persistent data structures in particular.

            As well as excellent tooling and pedagogy, the principle attraction of Racket is the macro system. There’s a great book about this (this is true of just about all aspects of Racket). Racket’s focus is on building a tower of languages via macro extension. Metaprogramming is thematically FP-adjacent but neither sufficient or necessary; but if you’re looking for a fun learning experience it’s really worth a look.

            In terms of employment opportunities - I know of several Clojure shops (on the JVM it has the bonus of being able to take advantage of the hole ecosystem), but I’m not aware of anywhere that’s using Racket outside of the academic sphere.

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

      GNU Guile or Racket. from the language side every scheme is a scheme though. it kinda depends what you want to do with it

      SICP is great for a very general in-depth intro

  • atzanteol@sh.itjust.works
    link
    fedilink
    English
    arrow-up
    10
    ·
    2 days ago

    Clojure always seems to be more popular than I expect it to be. Though I have no experience with it myself. It benefits from access to the JVM ecosystem as well I believe.

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

      I love clj. in general it takes more of a pragmatic approach to functional programming than others. you get most of the purity for way less effort. same with specs over proper static types. it just ends up being a very enjoyable and productive language

  • cockmushroom@reddthat.com
    link
    fedilink
    arrow-up
    1
    ·
    1 day ago

    I’ve only used one, and I’m only mentioning it since nobody else has, but I recommend Lean; moreso as a second functional language if you want to build stuff as opposed to just learn the paradigm. It’s mostly used in maths because it supports dependent types, but it was fine for writing simple scripts, and it can be easily compiled to binary formats. I don’t like the package management system and toolchain complexity, but most languages kinda suck at that, imo.

  • Life is Tetris@leminal.space
    link
    fedilink
    arrow-up
    4
    ·
    2 days ago

    My ₹1. It may depend on what you plan to write in it (for fun). The BEAM sounds great for long-running processes, but not as much for point tools; Erlang and co supposedly run slower than Python, which isn’t fast either.

    My other ₹ ;-) if you stick to the BEAM: OCaml sort of runs on it, as there is the Caramel project to replicate it (https://caramel.run/). One of the Erlang creators also ported Prolog to the BEAM (erlog), as well as Lua (erlua) and Lisp (LFE). Elixir is probably great, as it is inspired by Ruby (I found Ruby very pleasant, other languages have so much semantic noise).

    Freebie! The BEAM inspired an inspirational design for parallel programming, the Pony language. I am somewhat sad development slowed down, it is a Rust killer.

  • gedhrel@lemmy.world
    link
    fedilink
    arrow-up
    8
    ·
    2 days ago

    I’d go with Erlang over elixir, but it sounds like you already have an interest in gleam.

    FWIW: just pick one and get started. There are some major axes to consider: pure versus impure, lazy versus strict, static versus dynamic typing, but to kick off if you’ve done no FP before it’s probably better to just go for it.

    There are some really intriguing “next steps”: SICP, the ML module system, the Haskell ecosystem, the OTP approach to state, but to begin with it’s just worth getting used to some basics.

  • AsimovIV@discuss.tchncs.de
    link
    fedilink
    English
    arrow-up
    5
    ·
    2 days ago

    Elixir is quite amazing to write and read, the major libraries (Pheonix, Ecto, etc.) have excellent documentation, the tools are generally excellent and it is built on to BEAM which is amazing. But it is a dynamically typed language with all the pain that can incur. Of course, there are tools (such as Dialyzer) to give some amount of static type checking but they were not very good when I tried them some years ago. Using things that need mutation can also be a pain. Programming Elixir 1.6 Functional |> Concurrent |> Pragmatic |> Fun was the book I used to learn functional programming and Elixir and it served me well.

    There are other good languages you can look into such as Ocaml (that has good free resources for new programmers) and Racket with the amazing free course you can find on OSSU.