How to pick a language for Artificial Intelligence programming?

26,429

Solution 1

All the cool bearded gurus in what's left of AI research use Lisp :)

There are two big camps: Common Lisp and Scheme. They have different syntax, etc. Lots of good stuff written for both.

Java is a very popular all-purpose language but a lot of the interesting stuff in AI / Functional Programming, such as passing closures as first-order objects, is clumsy to do in Java.

My personal preference would be to stay away from Windowsy languages like C# and F#. Cool people develop under Unix. Or Linux if they're cool but poor.

Some cool but weird people program in Haskell. A reasonably modern FP language with good performance. I tried it once, it made my brain hurt; but you might be smarter than I am.


UPDATE: Answers to Steve's questions.

  1. I wouldn't be the one paying for a Unix variant; that's what corporations and research institutes do. The idea is, you want to be doing AI research for an outfit that sinks millions into their hardware and doesn't balk at paying a few thousand for an operating system. That's the kind of outfit likely to have good food in the cafeteria and/or pay well for doing fun work. But I'm certainly not knocking Linux.

  2. F# may be cool but I see a whole raft of issues getting it to run on Linux or any other Unix (that's what I meant by "windowsy"), and I don't want to work under Windows (that's what I meant by "personal preference").

  3. To elaborate on the "windowsy" theme: You mention that F# is an OCaml variant. From my own admittedly brief research, it seems that F# is missing functors, OCaml-style objects, polymorphic variants and the camlp4 preprocessor. A functional language without functors? Really? If one were disposed to not like Microsoft, as I admittedly am, one could conclude that they had gone ahead and crowbarred a perfectly good functional language, OCaml, into something they could get to run in their CLR so they could claim to "have" a functional language. Finally, because I don't suspect, I know that Microsoft always prioritizes market dominance over product quality, I don't plan to touch F#. But this is my personal preference, and clearly identified as such, while we're really more concerned with making a good recommendation for mary.ja45 .

I have better reasons to recommend Lisp over F# and even OCaml and Haskell. These are mostly based on the historic preponderance of Lisp over any other language in the AI field.

  • The bulk of AI literature is based on programs written in Lisp or Prolog. If nothing else, good knowledge of Lisp would allow a student to understand the sample programs. My personal favorite AI megaproject, Cyc, has runtimes in your choice of Common Lisp or C.

  • In the TIOBE index of programming language (as seen and used in industry), Lisp takes 15th place while Haskell takes 43rd and F# and OCaml place below 50th. Presence on the market correlates with employment opportunities, naturally.

That said, it's quite possible that a number of the younger "AI interesting" languages are poised to skyrocket. If some major research institute published some groundbreaking, defining-the-field research in, say, Scala, you'd see Scala's popularity advance sharply in the research community and, with some lag, in industry.

I (obviously) can't comment on F#'s other qualities but you're as welcome to make recommendations as I was.

Solution 2

Python seems to be used a lot in the general scientific community. It has a lot of libraries available and it's easy to learn.

Solution 3

I'll throw Scala into the pot.

  • it's usable for functional programming
  • it can be made as fast as Java
  • it's a modern language with lot's of nice aspects
  • Java seems to be a bit popular in AI, too and so you can use all those Java libraries from Scala

I've solved all exercises from a basic AI course in Scala. It worked really well.

Solution 4

If by "all of AI" you also mean machine learning, which I guess, Matlab, R and Python+Scipy should definately be mentioned.

Solution 5

I personally use Clojure for AI programming, and have found it to be a great all-rounder AI language.

Reasons:

  • It's a Lisp, and Lisps have historically been very strong the the AI field
  • It's a homoiconic language with powerful macros, so great for code generation and genetic programming. This is a surprisingly useful property for AI programming (and possibly explains some of the success of Lisp in general in this space)
  • It runs on the JVM and can easily access all the Java libraries for number crunching (Weka, Colt, etc.).
  • It's good for rapid interactive development - it's very dynamic and you can do pretty much everything interactively in a running Clojure REPL. No need for recompiling etc.
Share:
26,429
mary.ja45
Author by

mary.ja45

Updated on September 26, 2020

Comments

  • mary.ja45
    mary.ja45 over 3 years

    What is the best programming language for artificial intelligence purposes?

    Mind that using suggested language I must be able to employ any AI technique (or at least most of them).

  • mary.ja45
    mary.ja45 over 14 years
    "If you want to learn from the basics and just implement theoretical AI stuff" - yes just that for now
  • prasanna
    prasanna over 14 years
    I say go with either what you are more comfortable with or lisp, python. I know for sure Norvig's book Artificial Intelligence:Modern Approach has a lot of stuff on Lisp and there are codes in these languages. code.google.com/p/aima-python maybe useful if you choose python
  • mary.ja45
    mary.ja45 over 14 years
    Can I use Lisp for anything else?
  • Carl Smotricz
    Carl Smotricz over 14 years
    Lisp is certainly a very powerful language, and people like Paul Graham claim that Lisp gives you some mechanisms that no other language gives you. There are comms libraries, GUI libraries, math libraries... whatever you wanna do.
  • Carl Smotricz
    Carl Smotricz over 14 years
    But to be honest, Lisp is not a very mainstream language. It's 30 years old and still very useful in academia, but doesn't draw crowds of cheering fans. It's #15 in the TIOBE index: <tiobe.com/index.php/content/paperinfo/tpci/index.html>
  • mary.ja45
    mary.ja45 over 14 years
    thanks, i'll check this stuff out
  • mary.ja45
    mary.ja45 over 14 years
    Davie, I'm hoping to find language which will be good for any AI problem :) Is that possible? :/
  • Carl Smotricz
    Carl Smotricz over 14 years
    Until this year, MIT did their "intro to CS" course in Scheme. I worked through the course book. Heavy concepts, blows your mind. But in a good way. If you survive that, a little AI programming won't scare you.
  • Steve Severance
    Steve Severance over 14 years
    1. Why would you pay for a unix varient? 2. F# is the most productive language I have ever used. I have written a lot of machine learning code in it and is a good mix the features of Lisp (code as a data type) and libraries that you need to get stuff done. 3. F# is not "windowsy. It is an OCaml varient and has great OCaml compatibility. 4. Haskell is a great language that had a great impact on F# and I do recommend it.
  • Carl Smotricz
    Carl Smotricz over 14 years
    @Steve: I've addressed your questions in an update to my answer. @everybody: Please pardon my wordiness. I hope to have hidden some useful information in all my blathering.
  • Carl Smotricz
    Carl Smotricz over 14 years
    Scala is a very capable language by and for smart people. I like it and think it might have a bright future. +1.
  • hasen
    hasen over 14 years
    +1 for cool people develop on linux
  • Caleb Jares
    Caleb Jares almost 13 years
    Sounds very much like a conspiracy theory to me, or just strong fanboy preference (windoze suckzz!!)
  • Nathan Shively-Sanders
    Nathan Shively-Sanders over 12 years
    Can you give a link to "lots of good stuff" for Scheme? I went to a heavy Scheme school (Indiana University, home of the Little Schemer), and the only bearded gurus doing AI (I was one of them) had switched away from Scheme entirely by 2007. Usually to Python for prototyping, Java/C++ for performance.
  • rjt
    rjt almost 8 years
    Since the OP tagged neural-network, he also has non-traditional AI needs. Does Scala or Haskell address that need?
  • kn3l
    kn3l over 5 years
    Scala is very good for enterprise scale, performance