skip to Main Content

I am a computer science student and I am going to work on an artificial intelligence project which will compose a musical tune according to the genre and mood inputs. Are the algorithms to be used for this project likely to be very resource-consuming? Would it make any difference (in terms of speed) if I choose to go with Java rather than C++? (Note : I know only these two languages and I am more comfortable with Java than C++.)

NB : Sorry for my poor English. If someone can, please clean up this post wherever necessary. Thanks.



  1. Go with Java since you are more comfortable with it. That will allow you to concentrate on solving the problem, not the programming. Maybe C++ would end with a faster program, maybe not, but getting there will be slower and you don’t categorically state that the program must be blazingly fast.

    Login or Signup to reply.
  2. In my mind, the language mostly associated with AI is Lisp.

    See the answers to Why is Lisp used for AI? – top voted mentions this was the case in the 60s and 70s, but these days dynamic languages are used (ruby, python and such).

    Login or Signup to reply.
  3. It looks to me like you’re at the proof-of-concept stage of your project. I’d use whatever language your most comfortable with. Well written Java code will run a lot faster then poorly written C.

    Login or Signup to reply.
  4. The resource consumption is way more influenced by the algorithmic approach than the language chosen. If you are comfortable with Java, program your application in that language – even though a C++ implementation might be 10% faster.

    That being said, you might be interested with Artificial Intelligence API’s for Java.

    Login or Signup to reply.
  5. I did a similar AI project a couple of years ago. I don’t know what solution you will be implementing, but AI programs can generally be both resource consuming and may take a long time to run, but on the other hand, you’ll need a language you’re familiar with to get it done in time.

    Therefore, my advice is that if you feel you know C++ (or C), go with one of them. If you don’t know them, then consider carefully the time you will need to invest in learning a new language before choosing.

    Login or Signup to reply.
  6. If you’re starting from scratch, use whatever you know best. If you want to use established libraries to speed up development, you might want to investigate that first – but Java is certain to have some.

    In your shoes, I’d pick Java for sure.

    Login or Signup to reply.
  7. I would use Common Lisp for a project like this. If you don’t know Lisp, I would learn it for this type of project. It would be a great learning experience and since you are a CS student, it will only help you. Lisp is a language that can be a real eye opener.

    Login or Signup to reply.
  8. My advice is design everything you need first, every ADT, every algorithm class, hierarchy, everything. This kind of project/programming could be really hard to design in C/C++ family of languages, maybe you could choose other language with less string typed philosophy. So i encourage you with using a language designed for this kind of problem, better suited to your application, functional paradigm ex: LISP, logical paradigm ex: PROLOG or something like that.

    Login or Signup to reply.
  9. My 3rd year dissertation project was an implementation of heuristics for cellular network radio frequency allocation. I chose Java over C++ because it allowed me to visualize the results much easier than if I’d used C++. I don’t believe the performance would have been significantly different in C++ – the complexity factor of your algos is going to be the biggest factor probably.

    Login or Signup to reply.
  10. I’d go with Clojure for the following reasons:

    • It’s a Lisp, and Lisps are great languages for AI development (partly historical, but also for some real concrete reasons – see this thread and this thread)
    • Clojure runs on the JVM and has great Java interop, so you can exploit all the great Java AI libraries (e.g. Weka) plus you already have some experience of the Java environment
    • JVMs have excellent optimizing JIT compilers nowadays, for all practical purposes you will get performance as fast as C/C++ for this kind of application.
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top