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.
10
Answers
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.
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).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.
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.
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.
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.
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.
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.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.
I’d go with Clojure for the following reasons: