should i go with Clojure or common Lisp? i’m looking for an intuitive language and the tooling is great. my background: Ruby programmer and i use neovim. my goal: AI development. do people really use Lisp family for AI dev tho?

  • NostraDavid
    link
    fedilink
    arrow-up
    3
    ·
    4 days ago

    If you want to learn FP for the sake of learning FP:

    Learn you a Haskell is a great start.

    Now, something to know about my opinion:

    • I think Haskell is great.
    • I think Haskell’s tooling is pretty doodoo.

    So, you could use Haskell Playground or something like repl.it to run Haskell in your browser. This should save you on a confusing setup.

  • FizzyOrange
    link
    fedilink
    arrow-up
    8
    ·
    5 days ago

    do people really use Lisp family for AI dev tho?

    Not since the 70s. They almost all use Python.

    FP has absolutely nothing to do with modern AI.

  • somegeek
    link
    fedilink
    arrow-up
    2
    ·
    4 days ago

    Clojure is great but not for AI. Currently the best option for AI is python.

  • coherent_domain@infosec.pub
    link
    fedilink
    English
    arrow-up
    5
    ·
    edit-2
    5 days ago

    Functional programming doesn’t have much to do with what people call “AI” nowadays, but it is still a valuable skill to write compositional code.

    Since you mention tooling, I am going to give a unconventional recommendation: rust, but try not to use mut keyword. Rust is a decently matrue language, widely used in the industry, and it actually support decently advanced functional features (e.g. https://varkor.github.io/blog/2019/03/28/idiomatic-monads-in-rust.html ).

    Another alternative is scala, which I don’t know whether it is still very popular. But it certainly is one of the approachable “cool” language 7 years ago.

    • silasmariner
      link
      fedilink
      arrow-up
      3
      ·
      5 days ago

      Second vote for Scala. It’s not one of the top 5 langs, but it has a solid niche and doesn’t seem to be going away any time soon

  • sudo
    link
    fedilink
    arrow-up
    2
    ·
    5 days ago
    • Read SICP.
    • Learn what a type class is and some basic category theory.
  • e0qdk@reddthat.com
    link
    fedilink
    arrow-up
    2
    ·
    edit-2
    5 days ago

    Ruby is already a functional programming language – you can pass functions to functions, return functions from functions, and make closures in Ruby already. You’re probably already using some functional programming concepts if you’ve done anything non-trivial in Ruby even if it didn’t register for you as “functional programming”.

    If you want to do ML (current “AI”), you’d probably do best to learn some Python (PyTorch, TensorFlow, etc.) and maybe CUDA for lower-level control. (It’s basically C++ with extra features for running code on NVIDIA GPUs.) There might be Ruby wrappers for the underlying ML libraries, but I expect most resources you’ll find (e.g. StackOverflow answers) will assume you’re working with Python…

    If you’re still interested in learning one of the languages you listed, you’ll get some educational benefits from exploring them but I don’t think you’re likely to get much practical benefit out of it for AI over Ruby. I learned a lot from exploring Clojure personally – I particularly liked the idea of identity as a series of values over time – but I don’t work in the JVM ecosystem, and so I haven’t actually done anything with the language in 10+ years… The concepts I learned from playing with it were more useful than the language itself to me.

    • Hammerheart
      link
      fedilink
      arrow-up
      2
      ·
      1 day ago

      Were you able to transfer those concepts you learned from clojure to other languages?

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

        Yes, but more in a philosophical sense. Basically, just go read this: https://clojure.org/about/state

        I generally use message passing rather than the sort of transactional concurrency the language promotes, but the idea of value vs identity has stuck with me.

    • occultist8128@infosec.pubOP
      link
      fedilink
      English
      arrow-up
      1
      ·
      5 days ago

      yes i been already using some of functional features on it, but i want to use Lisp family language esp for AI dev

  • ChillPC
    link
    fedilink
    arrow-up
    1
    ·
    edit-2
    5 days ago

    You can do FP in any programming languages, some are just focusing more on it than others. With OCaml, you will have what might be the best type system of the world. With Haskell, purity everywhere. With clojure, Lisp which is awesome. So Ruby should just fit, here are some resources to make you understand what is FP :

    Another interesting resource is how John Carmack talk about potential use of purity (with haskell in its case) in event passing to entities in video game at the Quake Con 2013 (~17min 30). It made me better understand how pure and impure code should coexist.

  • insomniac_lemon@lemmy.cafe
    link
    fedilink
    English
    arrow-up
    1
    ·
    5 days ago

    You might want to check out Nim-lang (3 options for deep-learning, Arraymancer being the most popular and active) (also considering how much AI stuff is on Python, you can call Nim code from Python via Nimpy)

    I mostly just find it the most intuitive (for the performance/capability it offers) though, as in I haven’t done much (certainly not AI stuff) and can’t tell you if it’s the best for functional programming (other than that Nim takes inspiration from Lisp). Though I do see that some Nim users have said it’s not purely functional (it may be on you to make sure your code is) and that other options might be better if it’s a priority.