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

  • FizzyOrange@programming.dev
    link
    fedilink
    arrow-up
    2
    arrow-down
    5
    ·
    edit-2
    2 days ago

    Rust. It has all the good bits of functional programming but basically none of the bad bits.

    Good bits:

    • Strong type system (though not quite as sophisticated as Haskell or OCaml).
    • Map, filter, etc.
    • First class functions (though lifetimes can make this a bit awkward)
    • Everything is an expression (well most things anyway).

    Bad bits:

    • “Point free style” and currying. IMO this is really elegant, but also makes code difficult to read very quickly. Not worth the trade-off IMO.
    • No brackets/commas on function calls. Again this feels really elegant but in practice it really hurts readability.
    • Global type inference. Rust requires explicit types on globals which is much much nicer.
    • Custom operators. Again this is clever but unreadable.
    • Small communities.
    • Poor windows support (not a fundamental thing but it does seem to be an issue in practice for lots of functional languages).
    • AbelianGrape@beehaw.org
      link
      fedilink
      arrow-up
      1
      ·
      2 days ago

      The only things on the bad list that I agree with are top-level type inference and small communities. And ocamls windows support is terrible. Haskell’s is more than ok now.

      In Haskell, any style guide worth its salt requires annotations on top level functions, and many of them also require annotations on local bindings. This pretty effectively works around the problem.

      Bad code will be unreadable in any language of course. But the other things don’t themselves make code unreadable once you’re actually familiar with the language and its ecosystem.

      • FizzyOrange@programming.dev
        link
        fedilink
        arrow-up
        1
        ·
        8 hours ago

        Bad code will be unreadable in any language of course.

        Yeah I’m talking about good code, or at least not bad code. Let’s not “no true Scotsman” this.

        Even for good code you don’t need syntax highlighting to easily see which identifiers are function names and which are their parameters in Rust.

        • AbelianGrape@beehaw.org
          link
          fedilink
          arrow-up
          1
          ·
          edit-2
          5 hours ago

          I don’t need syntax highlighting for that in Haskell either. My usual highlighting just leaves them both in the default text color.

          And I’m specifically arguing that the other things on your list do not inherently make code bad.

    • lad@programming.dev
      link
      fedilink
      English
      arrow-up
      1
      ·
      2 days ago

      I would advise going in the opposite direction, learning a purely functional language first to then being able to appreciate functional parts

      That is beside the point of an opinionated list of the good and the bad, that will differ for others