Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Why did you choose Java? I don't have a problem coding in Java, but I thought it was an interesting language choice considering most AI programs I tend to see are written in some derivation of Lisp.


Author here. I started using Lisp for AI in the early 1980s, had a Lisp Machine, wrote two AI Lisp books for Springer-Verlag back then, etc. I thought that Java 1.0 was an interesting language, and Peter Norvig, who did a tech review of an early edition of this book once said something to me roughly like 'Java is half as good as Lisp for AI, but that is probably good enough' (from an email probably 12 years ago, but that is close to what he said).

Clojure, Python, Common Lisp, are other candidate languages for AI.


Clojure seems like a pretty natural choice, especially if you are planning to use a lot of third party libraries written in Java (though even CL might be useful, if you use ABCL). I suppose the real question here is, "Why Java?" Are there technical considerations, or is it about the syntax being more familiar to potential readers, or is there some other consideration here?


Clojure is a natural choice. One reason this book uses Java is that I wrote the first edition in 1998, this being the fourth edition. I still like Java simply because I use Clojure and JRuby a lot and Java interop is easy.

I love to write, and if I could get a world class Clojure coder (perhaps someone like Alex Ott, or someone with similar skills) to co-write, it would be fun to start over.


Why did you choose Java over Python (imo the only two practical alternatives for a textbook since you want to target the biggest possible audience)? Are the Java AI/ML libraries better or easier to use than Python's?


By looking at the source at Github, some chapters (if not all?) utilize third party tools and libraries written in Java. The community is big.

For example Weka is widely used for data mining (even in academia) and here it's used in the Machine Learning chapter; Drools is an excellent solution from JBoss/Red Hat used in the chapter for Expert Systems, and etc... I even see a Hadoop dependency in the code but I'm not sure (yet) in which chapter it's used.

I bought the book, as a Java developer this is one of the areas I'm less experienced in, so this is a great opportunity to get up to date.


I'm wondering if there were any specific reasons as to why Weka was used instead of Mahout for the machine learning chapter, as both are in Java.


Plenty of NLP/recommendation startups use Java.

Practical AI stuff can be done in most (lower level) practical languages.


"Practical AI stuff can be done in most (lower level) practical languages."

It can be done, but that does not mean that it necessarily makes sense to do so. The question is, what advantage does Java really have here, over something like Clojure?


This is like the third or fourth time I've seen Clojure and Lisp mentioned. I know I'm not answering your question (I'm the least able to do so probably on HN) but as a Java developer, I'd like to know why Lisp-like languages make them a "natural choice" for AI/machine learning?


I think this is so often mentioned, because of AI/Lisp's common history. I am in natural language processing (which is sometimes seen as a subbranch of AI) and I have rarely seen anyone who used Lisp (mostly Perl, Python, Java, Prolog, and C++). Also, most machine learning software is written in C, C++, Java, or Matlab, with a strong and growing Python presence (via NumPy/SciPy).


Homoiconicity (code and data having the same representation) is a commonly cited reason, which is key to the macro system in Lisp. Also commonly cited is the symbol type, which is also very useful in various AI contexts:

http://www.cs.st-andrews.ac.uk/research/aisc

This is not to say that you cannot do equivalent things in Java, but it is a lot easier in Lisp.


Theres a lot of history with lisp and a.i. Take for example the famous koza book for genetic programming in lisp. I think its to do with in lisp, the program is data which can be changed


Well... Java is an interesting choice, but it's far from the strangest.

I still have this (https://www.librarything.com/work/3032548) book somewhere. Working through it as a kid was an interesting experience (amplified by the fact my computer was an Apple II+ at the time).


I haven't seen much AI/machine learning in lisp in long time. Mostly I see people use matlab, java, Python and C.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: