Will LISP be more useful than Java for this problem??
-
- Posts: 2
- Joined: Sun Sep 05, 2010 6:31 am
Will LISP be more useful than Java for this problem??
Hi,
I am planning to write code for solving analogies.
i.e the question is A:B::C:? and the computer is given four choices and the computer has to select the
right choice.
Here A , B, C and choices are visual represenatations.
For example:
A is letter 'B' in a box.
B is mirror of letter 'B' in a box.
and C is letter 'F' in a box.
Now the choices have letter 'F' is different orientations in a box.
The program has to determine the relationship between A and B and choose D so that C and D have the same relationship.
The input is not a image but a text file describing the image.
There are other cases like a circle in a triangle and things like that.
I do not know LISP and want to know if doing this in LISP will be more helpful than in Java.
Can you please let me know if it will be helpful to code this in LISP.
If so, what features in LISP will help me. Please give some examples.
I am planning to write code for solving analogies.
i.e the question is A:B::C:? and the computer is given four choices and the computer has to select the
right choice.
Here A , B, C and choices are visual represenatations.
For example:
A is letter 'B' in a box.
B is mirror of letter 'B' in a box.
and C is letter 'F' in a box.
Now the choices have letter 'F' is different orientations in a box.
The program has to determine the relationship between A and B and choose D so that C and D have the same relationship.
The input is not a image but a text file describing the image.
There are other cases like a circle in a triangle and things like that.
I do not know LISP and want to know if doing this in LISP will be more helpful than in Java.
Can you please let me know if it will be helpful to code this in LISP.
If so, what features in LISP will help me. Please give some examples.
Re: Will LISP be more useful than Java for this problem??
First, the language had been called Lisp, not LISP, for decades, ever since lowercase letters were invented. It might not be exactly incorrect, but looks archaic.
Anyway, in my perhaps not entirely unbiased opinion Common Lisp is superior to Java for every problem domain except glueing together preexisting libraries, which are rather scarcer for CL, although the situation is somewhat improving. Your problem appears to be in a domain formerly known as AI, with which Lisp is historically associated.
There is a summary of features of CL with examples. There are some free online books: Practical Common Lisp, Gentle Introduction to Symbolic Computation.
Anyway, in my perhaps not entirely unbiased opinion Common Lisp is superior to Java for every problem domain except glueing together preexisting libraries, which are rather scarcer for CL, although the situation is somewhat improving. Your problem appears to be in a domain formerly known as AI, with which Lisp is historically associated.
There is a summary of features of CL with examples. There are some free online books: Practical Common Lisp, Gentle Introduction to Symbolic Computation.
-
- Posts: 2
- Joined: Sun Sep 05, 2010 6:31 am
Re: Will LISP be more useful than Java for this problem??
@ramarren:
Ok Lisp.
Can you please give some examples where Lisp scores over Java for this problem?
Something more concrete and more specific to the context of the problem...
Ok Lisp.
Can you please give some examples where Lisp scores over Java for this problem?
Something more concrete and more specific to the context of the problem...
-
- Posts: 447
- Joined: Sat Jun 28, 2008 7:49 am
- Location: Austin, TX
- Contact:
Re: Will LISP be more useful than Java for this problem??
Lisp will score over Java in at least two areas:
Finally, note that everything said above is a generic comparison between Lisp and Java and doesn't involve your problem in any way. I'd have to think more about your problem to give deeper specifics, but the generic differences are large enough that, per Ramarren's response, if there wasn't a ready-made Java library available that you required, I'd just write it in Lisp.
- First, you typically don't have a write a bunch of data structure code with Lisp. Many problems just reduce to using lists, which are obviously very well supported in the language. With Java, you'll probably have to code up a bunch of classes to represent things the way you want. You can also do this in Lisp, using either structures or CLOS, but you don't have to.
- Next, Lisp uses dynamic typing, so many of your algorithms will work without committing to a final type for your data structures. When your data structures change (and they probably will), you won't have to rewrite as much code.
Finally, note that everything said above is a generic comparison between Lisp and Java and doesn't involve your problem in any way. I'd have to think more about your problem to give deeper specifics, but the generic differences are large enough that, per Ramarren's response, if there wasn't a ready-made Java library available that you required, I'd just write it in Lisp.
Cheers, Dave
Slowly but surely the world is finding Lisp. http://www.findinglisp.com/blog/
Slowly but surely the world is finding Lisp. http://www.findinglisp.com/blog/
Re: Will LISP be more useful than Java for this problem??
Java will be more useful for your problem given 2 conditions:
1. You already know how to program in Java.
2. There is an existing Java library that performs pattern matching appropriate for your problem. Then you will only need to learn how to use the library and at most may have to modify or extend it to solve your problem.
If no such library exists and you are going to implement the pattern matching algorithms from scratch, I think learning Common Lisp will be worth the effort. In your case, I recommend starting with "Practical Common Lisp" and then also work through "Paradigms of Artificial Intelligence Programming: Case Studies in Common Lisp".
As a bonus, there may already be Lisp code that applies to your problem in the CMU Artificial Intelligence Repository.
Good luck,
~ Tom
1. You already know how to program in Java.
2. There is an existing Java library that performs pattern matching appropriate for your problem. Then you will only need to learn how to use the library and at most may have to modify or extend it to solve your problem.
If no such library exists and you are going to implement the pattern matching algorithms from scratch, I think learning Common Lisp will be worth the effort. In your case, I recommend starting with "Practical Common Lisp" and then also work through "Paradigms of Artificial Intelligence Programming: Case Studies in Common Lisp".
As a bonus, there may already be Lisp code that applies to your problem in the CMU Artificial Intelligence Repository.
Good luck,
~ Tom
Thomas M. Hermann
Odonata Research LLC
http://www.odonata-research.com/
http://www.linkedin.com/in/thomasmhermann
Odonata Research LLC
http://www.odonata-research.com/
http://www.linkedin.com/in/thomasmhermann
-
- Posts: 447
- Joined: Sat Jun 28, 2008 7:49 am
- Location: Austin, TX
- Contact:
Re: Will LISP be more useful than Java for this problem??
Tom makes a good point. If you already know one or the other of the languages and you really want to be productive from the get-go, then the best answer is probably to write it in the language that you're already familiar in. We tend to forget that in discussing languages. Yea, in a perfect world, you'd be equally adept at all languages and could simply choose the best one at any given time for the problem at hand. That's a fictional utopia, however, so in practice you tend to use the tool that you are most familiar with.
And that's okay, I should add.
That being said, it's also good to start looking at other tools in your down time so that you can avoid using a wrench to pound a nail when you don't have to.
And that's okay, I should add.
That being said, it's also good to start looking at other tools in your down time so that you can avoid using a wrench to pound a nail when you don't have to.
Cheers, Dave
Slowly but surely the world is finding Lisp. http://www.findinglisp.com/blog/
Slowly but surely the world is finding Lisp. http://www.findinglisp.com/blog/
-
- Posts: 117
- Joined: Tue Aug 10, 2010 11:24 pm
- Location: Calgary, Alberta
- Contact:
Re: Will LISP be more useful than Java for this problem??
It sounds like a very difficult task, what algorithm or technique do you plan on using?
Need an online wiki database? My Lisp startup http://www.formlis.com combines a wiki with forms and reports.
Re: Will LISP be more useful than Java for this problem??
You can, of course, always use clojure, a lisp dialect on jvm which can easily access java.