[mercury-users] Question

Ralph Becket rafe at csse.unimelb.edu.au
Thu Oct 12 11:36:07 AEST 2006


Hi Rod,

RMJ, Wednesday, 11 October 2006:
>    Being totally new to Mercury (although I have a long experience with
>    Prolog, C/C++ and many others) I wonder if Mercury is a good choice,
>    in performance & flexibility, to program some experimental neural
>    networks and observing their convergence?

Anthony Lee Senyard did a PhD here at Melbourne a few years ago on just
this topic and used Mercury for his work.  He would be a good person to
talk to if you want to track him down.

On 64 bit architectures there is no performance penalty for floating
point performance in Mercury.

On 32 bit architectures there is, because Mercury's float type is
equivalent to a C double, which occupies two machine words and hence
every stored float value has to be boxed (i.e., stored on the heap).

However, you can build the Mercury compiler with
MR_USE_SINGLE_PREC_FLOAT, which makes Mercury's float type equivalent to
a C float, and therefore doesn't need to be boxed.  The trade off here
is loss of precision for increased performance.

For Anthony I implemented a special unboxed, full-precision float array
type which sped his programs up substantially.  I'd be happy to let you
have a copy.

In a nutshell: Mercury is an excellent language for building robust
software, its performance is very good, but it has not been highly
optimized for floating point intensive applications.  (Of course, that
could change if enough users make the request...)

-- Ralph
--------------------------------------------------------------------------
mercury-users mailing list
Post messages to:       mercury-users at csse.unimelb.edu.au
Administrative Queries: owner-mercury-users at csse.unimelb.edu.au
Subscriptions:          mercury-users-request at csse.unimelb.edu.au
--------------------------------------------------------------------------



More information about the users mailing list