• solrize@lemmy.world
    link
    fedilink
    arrow-up
    10
    ·
    14 hours ago

    Your crossposted question was a choice between Clojure and Common Lisp. Between the two I would say Clojure is more functional, but it comes with the baggage of the JVM. Common Lisp on the other hand is more of a 1980s language where you can use a functional style some of the time, and with some pain.

    If you want a Lisp-like language, the usual starting point is Scheme, and if you want something with more creature comforts, try Racket. Either way, you’d start by reading SICP (fulltext here). But I think that whole approach misses out on an important aspect of FP, which is how type systems classify values.

    So I’d say go with a typed functional language. OCaml is something like what you are used to, while Haskell is more “drinking from the fire hose” (steeper learning curve, but I think you will get more from it).

    For Haskell, learnyouahaskell.com is a good place to start. I don’t know if there is something similar for OCaml. Haskell can be seen as a gateway drug to even more pointy headed languages like Idris.

    Yet another thing to look at as a possible migration point from Ruby is Elixir. It’s not really so FP, but it’s very practical if you’re mostly interested in web development rather than programming languages per se. It’s dynamically typed like Ruby and uses Ruby-like syntax, so you should be able to switch to it fairly easily.

    • Shareni@programming.dev
      link
      fedilink
      arrow-up
      1
      arrow-down
      1
      ·
      13 hours ago

      Common Lisp on the other hand is more of a 1980s language where you can use a functional style some of the time, and with some pain.

      Isn’t the main issue with it that you’re not forced to be functional? It’s supposed to be pretty good at it with the correct libraries.

      Either way, you’d start by reading SICP

      You really don’t want OP to learn lis

      • solrize@lemmy.world
        link
        fedilink
        arrow-up
        2
        arrow-down
        1
        ·
        13 hours ago

        Isn’t the main issue with it that you’re not forced to be functional? It’s supposed to be pretty good at it with the correct libraries.

        I’d say CL’s main issue is that it’s anachronistic by now, and when used idiomatically it’s an imperative language (think of LOOP). You can use some functional idioms in it, but it gets painful to do so.

        Look at the article “Why Functional Programming Matters” and imagine rewriting the code examples in Scheme (confusing but straightforward) and then in CL (ouch).