Problem specific languages

Started by
2 comments, last by random_thinker 16 years, 6 months ago
How much is it recommended to use programes built for a specific use? For example, I'm thinking about writing an AI program. Now, in C++ I feel like I can implement any algorithm that I can clearly define without to much trouble (except maybe the design). So why would it be better to do it in something like prolog which I feel less comfortable in? Or maybe I'm really asking - what motivates me to learn another language really well when I'm already comfortable with the one I'm using? I know that for some things it's just a syntax issue - like using C# for .net and not C++. But how useful is it in things like ai which are algorithms like any other? Thanks.
"We've all heard that a million monkeys banging on a million typewriters will eventually reproduce the entire works of Shakespeare. Now, thanks to the internet, we know this is not true." -- Professor Robert Silensky
Advertisement
Programming languages are just tools so use the one that you feel suits best for the task you're currently doing. What should motivate you to have a look at other languages is what they can offer in comparison to what you currently use, have a good look a couple of them and see what they offer, you don't necessarily need to learn all about them. The least you've gained is some knowledge that may trigger you to switch/embed/extend/whatever in a future project.
That's my 2 c's anyway.
Depends no what you're after. If you're coding for yourself, then it doesn't matter what you use.

But if you're solving a problem, then you will want to choose best tools for the job.

You can build a house using duct tape. Using enough duct-tape, you could even build a strong house. But you'd be better off using proper tools.

When you say you're using C++, you're just using one of solutions, not a better or more general one. There are areas where domain-specific languages don't do well. C# will surpass prolog when it comes to GUI. Java will surpass C++ when it comes to portability.

But most importantly, you're mixing in types of languages. C++, C, Java and C# are identical. Prolog however, falls under completely different programming paradigm. So does LISP.

This is where the distinction between procedural and functional languages arises (at highest possible level). Each of those is focused at different way of looking a problems.

The advantage? Knowing as many different concepts helps you choose. Prolog, despite dealing with logic, isn't ideal for many AI-related problems. When it comes to games, prolog would likely be very low on the list, since games need imperfect, often flawed logic.

The most deciding factor will always be: what can you use. Can you integrate prolog interpreter into your application? What's the cost of doing so? How will it interact? What's the cost of that? Do you have people on your team who know prolog? What's the cost of training them? (Cost here doesn't mean only money, but overall effort to accomplish something).

Knowledge brings fear.. ahem... You can never have too much knowledge. So a better question is: Why wouldn't you learn another, in many ways exotic, language.
There's really no clear answer to your question...for example, Naughty Dog Software (now owned by Sony Corp) produced the Jax and Dexter series of games for several consoles with Lisp (supported by C++), I understand. Many games are done purely in C++. You could use other combinations as well. Consider interpreted vs non-interpreted languages and the time involved to produce what you want.

--random
--random_thinkerAs Albert Einstein said: 'Imagination is more important than knowledge'. Of course, he also said: 'If I had only known, I would have been a locksmith'.

This topic is closed to new replies.

Advertisement