[mercury-users] "What do you think about Mercury ?"

Renaud Paquay rpa at miscrit.be
Sat Aug 28 02:22:02 AEST 1999


> - Why are you using Mercury ? (instead of another imperative/declarative
> language)

We try to use a highly expressive language to build
mission-critical applications.


> - What are you developing in Mercury ? (the main idea is enough, we
> don't need all the details !)  [Tyson's answer : "A Mercury compiler !!"
> ;-)]

I am currently writing a Mercury module generator to give
Mercury applications access to COM (ActiveX) components.
I wrote 2 years ago a HTML page generator from a DB.


> - What do you like/don't you like in Mercury ?
Like:
- types
- modes
- determinism
- high-order predicates
- typeclasses
- module system

Don't like
- syntax is heavy
- io state
- a lot of "if then else error(...)" to make code deterministic
- a lot of "if then else" when using ADT, whereas it is not needed
  when using lists.
- Type system: no name for members of a functor
- Type system: can't easily extend an existing type
  e.g.:
     :- type base ---> a(int); b(int).
     :- type derived ---> base(base); c(int).
  I would like to express 
     :- type derived extends base ---> c(int).
- Threading variables is a pain (DCG is not an elegant solution)
  e.g:
     foo(In, Out):-
         pred1(In, Out1),
         pred2(Out1, Out2),
         pred3(Out2, Out3),
         pred4(Out3, Out4),
         pred5(Out4, Out).

     Adding a call between pred2 and pred3 will force me to rename
     every variable from pred2.
  
> - What are the advantages working in Mercury ?
See "Like"


> - What features do you specially appreciate in the language ?
See "Like"

> - Couldn't you find these in other programming languages ? Why ?
>   Can you find these in other programming languages ? Why ?
- Many other programming languages have "pointers", which
  often make a program harder to write and understand.
- The other ones I know don't have strong type system

> - What do you find "really usefull" in Mercury ?
- types
- modes
- determinism
- high-order predicates
- typeclasses
 
> - What weaknesses/drawbacks do you find in Mercury ?
Performance of the compiler
Performance of the generated applications
No "native" support for exceptions
io__states are a pain


> - What would you change in the language/implementation ?
Add native exceptions handling
Use of typeclasses in the library
Don't use "C" as a "portable assembler"
Fix all the bugs with the "unique" modes
Use of typeclasses (currently) makes the compiler unstable

 
> - What kind of problems/errors have you encountered when you came to
> Mercury, coming from another language -Prolog?- or not ? Could you
> describe your experience ?

I simply can't stand Prolog. With Mercury,
- I never get a "no" after 20 minutes of execution because of a typo error.
- I never get into infinite loops because of a missing "cut"
- I have access to high-order term
- I can write functions
- When I want deterministic code, I simply declare it and
  the compiler checks my code.
- When I update a type definition, the compiler will often
  tell me where are the impacts
- All the declarations serve as a documentation for other people, 
  _and_ are checked by the compiler.



Renaud Paquay
Mission Critical
--------------------------------------------------------------------------
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