[mercury-users] Re: ICFP - OCaml entry

Dominique de Waleffe ddw at miscrit.be
Thu Sep 7 00:48:56 AEDT 2000


The following message is a courtesy copy of an article
that has been posted to comp.lang.functional as well.

  >>> "Yoann" == Yoann Padioleau <padiolea at thyra.irisa.fr> writes:

Yoann> Peter Ross <petdr at miscrit.be> writes:
>> 
Yoann> quite functionnal so
>> - nondet:                    0 (  0.00%)
>> - multi:                     0 (  0.00%)

Yoann> so the logic nature of mercury was not really used, i mean the possibility
Yoann> to have multiple solution/backtracking and so on.

Indeed, the code appears to be more functional than relational. 

In the context of our developments using Mercury, we found out that
most of the time, the language definition pulls you into a
'functional mode' for the most important part of the work. Below is
the similar statistics for the sources of a workflow server we have
written and is being deployed at a customer site.

Number of types:                   346
Number of insts:                     2
Number of predicates:             1435
Number of functions:               241

Number of predmodes:               479
Number of funcmodes:                29
Number of separate modes:         1177
Number of implicit function modes:    ?
Total number of modes:       >=   1685
                             =<   1926
        - det:                    1630 ( 96.74%)
        - semidet:                 245 ( 14.54%)
        - nondet:                   30 (  1.78%)
        - multi:                     6 (  0.36%)
        - cc_nondet:                 0 (  0.00%)
        - cc_multi:                  2 (  0.12%)
        - erroneous:                 4 (  0.24%)
        - failure:                   0 (  0.00%)
Average modes per predicate: >=  1.154
                             =<  1.174

Blank lines:                      3261 ( 10.35%)
Comment lines:                    4095 ( 12.99%)
Total whitespace/comment lines:   7356 ( 23.34%)

Function declaration lines:        242 (  0.77%)
Predicate declaration lines:      1678 (  5.32%)
Mode declaration lines:           1194 (  3.79%)
Type declaration lines:           1318 (  4.18%)
Inst declaration lines:             10 (  0.03%)
Other declaration lines:          2304 (  7.31%)
Total declaration lines:          6746 ( 21.41%)

Code lines:                      17412 ( 55.25%)

Total number of lines:           31514 (100.00%)


Note however that:
      1) there are only 8 true cases of 'nondet' modes being defined
         and not 30 (others are lambda expressions calling those true ones
         within some context). 
      2) and only 4 true cases of 'multi' modes.
      
So when one writes a fairly complex application, which has to do lots
of real world things [networking, database accesses, exception
handling, file handling, ...], one gets pulled into a rather
functional approach of writing the code [e.g. anything that needs to
do IO must be det,...].

So the 'Logic nature' of Mercury is there, but it is not obvious to
use it very often for much of the applicative code.

We've noticed that too on other programs we've written. However, I am
not claiming that this is true for all applications. This is just our
experience with what we've done so far.


D.


-- 
Dominique de Waleffe   
Mission Critical       
PGP key fingerprint: F9 CC 23 74 44 62 7C F3  8C 12 DF 71 BB 60 54 98

--------------------------------------------------------------------------
mercury-users mailing list
post:  mercury-users at cs.mu.oz.au
administrative address: owner-mercury-users at cs.mu.oz.au
unsubscribe: Address: mercury-users-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-users-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the users mailing list