Boost logo

Boost :

From: Vladimir Prus (ghost_at_[hidden])
Date: 2004-09-14 03:22:57


G. Wang wrote:

>> I'm interested. My first question would be, "what kinds of real
>> problems can I solve better/more easily/more expressively with UBL
>> than with approaches we already have available?" That's the test that
>
> UBL allows you to write Prolog-like code directly inside C++. The current
> Prolog is modeled directly to the Prolog standard. So IMHO your question
> is equivalent to
>
> "what kind of real problems can I solve better/more easily/more
> expressively with Prolog than with approaches we already have available in
> C++?"
>
> Prolog is the preferred language in the field of AI, expert systems,
> business logics, etc. There are lots of discussions about why Prolog is
> better in those areas than traditional procedure-oriented or
> object-oriented languages. I don't think that I can cover the reasons in
> just a few paragraph.

There's another question, too. Even if Prolog is better for some task, why
would one prefer prolog-like template metaprogramming library? You say:

   .. in VC++ 7.1
   The 8-queen problem takes less than 28 seconds on my Athlon 2200+

How much does it take with a real interpreter? I'm not a prolog expert, but
the 'queens.pl' example which comes with gprolog runs in about 40 ms on
Athlon 1700. That's 700 times faster (not counting CPU speed difference),
and I'm pretty sure that g++ will be much slower than VC++ on your example.
Is writing complex AI programs to be executed at compile time ever needed?

- Volodya


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk