• froufox@lemmy.blahaj.zone
    link
    fedilink
    English
    arrow-up
    2
    ·
    3 hours ago

    You don’t actually need to know any of the functional programming languages to work in the AI sphere. Moreover, codebase in pure funcional languages is hard to understand and maintain, that’s why they are rarely used in production. Of course you can learn any language for funsies, but I’d recommend Kotlin as a modern hybrid OOP language with a solid functional toolkit

    • Feyd@programming.dev
      link
      fedilink
      arrow-up
      2
      ·
      9 minutes ago

      Moreover, codebase in pure funcional languages is hard to understand and maintain, that’s why they are rarely used in production.

      This is incorrect. They are rarely used because procedural languages have momentum. It’s way more likely you’ll get Joe Codemonkey to learn and be productive quickly with functional features added to a procedural language than to learn and be productive quickly with an entirely different paradigm. So that’s what happens.

  • PortNull@lemmy.dbzer0.com
    link
    fedilink
    arrow-up
    2
    ·
    6 hours ago

    Elixir is a nice functional language. Not as purely functional as Haskel mind.

    It is based off of Erlang and runs on the Erlang VM. Syntax is Ruby inspired. It is not a high performant language (like C, Rust, etc), but it excels at distributed computing and fault tolerance. There is excellent documentation and tooling for it as well.

  • solrize@lemmy.world
    link
    fedilink
    arrow-up
    9
    ·
    9 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
      ·
      8 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
        ·
        8 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).

    • ECB@feddit.org
      link
      fedilink
      arrow-up
      1
      ·
      4 hours ago

      As a data scientist working in ML: it’s essentially all python outside of some really niche stuff

  • fubo@lemmy.world
    link
    fedilink
    arrow-up
    5
    ·
    9 hours ago

    I recommend picking up Graham Hutton’s short text Programming in Haskell, Second Edition. Even if you don’t end up using Haskell in “real work” (and you might!) it will teach you a remarkable number of things about how functional programming works.

    • MagicShel@lemmy.zip
      link
      fedilink
      English
      arrow-up
      1
      ·
      9 hours ago

      Is Haskell the language that differentiates between pure and impure functions? I’ve never seen a single line of Haskell, but I watched a number of YouTube videos and I agree that experts explaining the language is eminently helpful to understand functional programming in general.

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

        Haskell doesn’t have impure functions. What you’re calling impure functions (functions that produce values in the notorious I/O monad) are actually pure functions, that produce what you could think of as programs that run in an impure interpreter that’s outside of Haskell itself. Don’t worry about understanding that in detail until you’re deeper into learning Haskell, but at that point it will help demystify what the I/O monad (a traditional stumbling block) actually is.

        The first few pages of learnyouahaskell.com will give you some sample code to show how clean the language can be.