
Ask HN: Best language for general AI programming? - aphextron
I&#x27;m interested in building an AI which can take inputs of world events and financial news and make trading decisions. What language has the best libraries and idiomatic features for this?
======
olavgg
I think Python with scikit-learn, nltk, numpy, jupyter and finally Keras for
deep learning is a great combination.

I highly recommend learning Keras before you dive into Tensorflow or PyTorch.
Currently there are some excellent video tutorials available on
[http://safaribooksonline.com/](http://safaribooksonline.com/) with some good
examples available here: [https://github.com/the-deep-learners/TensorFlow-
LiveLessons](https://github.com/the-deep-learners/TensorFlow-LiveLessons)

------
Aryal007
Without a doubt python. I have been doing Machine Learning and Neural Network
Programming for over a year now. Availability of good libraries such as
scikit-learn and tensorflow along with the easiness of python makes python the
go-to language for AI programming in my opinion.

------
ghayashi
Python has sophisticated ML tools and Neural Net packages, I'm honestly not
sure what they are called in Python land, but I see Python on the listings all
the time for the top ML libraries. Clojure may also have really great
frameworks available by now.

~~~
physicsyogi
Clojure has Flare[1] and Cortex[2] for machine learning. Clojure is also a
great language for data processing.

Python, of course, gives you access to a host of useful libraries for NLP
(SpaCy[3], NLTK, Textacy), machine learning (Scikit-learn, PyTorch,
Tensorflow), and more general data processing (Pandas) and visualization
(Matplotlib, Seaborn).

[1]:
[https://github.com/aria42/flare/blob/master/README.md](https://github.com/aria42/flare/blob/master/README.md)
[2]:
[https://github.com/thinktopic/cortex](https://github.com/thinktopic/cortex)
[3]: [https://spacy.io/index](https://spacy.io/index)

------
mindcrime
You can't really go wrong with Python, Java (or any JVM language), R, Octave,
or probably even C++. Prolog might have some appeal if you already know the
language.

If you're really curious as to what languages are being used in this area -
and how - one good source is here:

[http://mloss.org/software/language/](http://mloss.org/software/language/)

Personally, I'm a fan of Java and DL4J, Jenetics, SAMOA, Mahout, COLT,
OpenNLP, CoreNLP, UIMA, Jena, SparkML and the like. But I'm biased since my
background in primarily Java. I've also been doing a lot of Python and R, and
some Octave, lately and all of those are nice in their own ways as well.

The syntax of R is a bit, erm, "quirky" in some ways compared to a lot of
other languages, but it may have the best support of any language in terms of
libraries for cutting-edge statistical techniques (this is because
statisticians heavily use R and the first versions of new techniques are
usually written in R).

------
TheAlchemist
Python, hands down. By far the best tools, community, documentation etc.
Although if you are looking for something 'high frequency' you will need to
implement the stuff on the critical fast path in something faster.

PS. What you want to do is called Machine Learning, not AI

~~~
nestorherre
It is AI. ML is a subfield of AI, so in the bigger scale it's AI.

~~~
TheAlchemist
AI is a completely over-hyped word.

The guy is trying to digest some pre-defined input (world events / financial
news), and predict some output (trading decisions).

That's pretty far from AI in my book.

~~~
shroote
I agree with your point, but ML is even more over-hyped word IMO.

------
ShannonAlther
Python has the libraries you're looking for: numpy, scikit-learn, Keras,
TensorFlow, etc.

But because everyone else is going to tell you to use Python, I'll say that R
and MATLAB/Octave are both acceptable for prototyping algorithms.

------
boidcom
Python + Tensorflow. Not only for the software but the community and
resources. Hardware tensor units in the latest Nvidia GPUs can reduce
computing time substantially.

------
rwieruch
If you are into JavaScript, checkout this article for ML in JS [0]. JavaScript
is not suited for AI, but if you happen to know it already and just want to do
ML for yourself, you can try it out in the browser.

\- [0] [https://www.robinwieruch.de/machine-learning-javascript-
web-...](https://www.robinwieruch.de/machine-learning-javascript-web-
developers/)

------
dasboth
Python for all the reasons people have mentioned here.

Tangential, but does anyone know of a playground environment where you can
code (ro)bots in Python? I'm thinking of the old Robocode challenges, which
were Java based, where you could write some logic and it would enter your bot
in a tournament. Would be fun to do some game AI with Python like that.

------
MichaelMoser123
Wow, nobody suggested scheme or lisp. These used to be traditional choices for
general purpose AI programming. Why did these languages fall out of favor?

~~~
dragonwriter
Lisp family languages, IIRC, were traditional choices for “AI” when “AI”
largely meant expert systems / production rules systems. But, AFAIK, while
s-expression like formats remain traditional for rules expressions in such
systems, the implementation languages even for those (which usually aren't
called “AI” today) are often in other languages.

------
raresp
I guess that AIML ( Artificial Intelligence Markup Language ) is the first
option when it comes to AI.

This article might help -
[https://en.wikipedia.org/wiki/List_of_programming_languages_...](https://en.wikipedia.org/wiki/List_of_programming_languages_for_artificial_intelligence)

~~~
mindcrime
AIML is somewhat misnamed and really has little or no applicability w/r/t what
the OP is asking for. If you're building a chatbot / conversational dialogue
system, then sure, use AIML. That's really all it's meant for.

------
amitprayal
Prolog

------
vgy7ujm
Why not ask Mentifex?

------
ha-shine
We use Prolog at university

------
anhthang
Python, I think

------
jjtheblunt
Mathematica

