[m-users.] Greetings

Paul Bone paul at bone.id.au
Mon Mar 31 12:10:08 AEDT 2014


On Sun, Mar 30, 2014 at 04:01:25PM -0700, anonymous wrote:
> Greetings fellow Mercury users!
> 
> First of all, kudos to the developers & community of Mercury!
> 
> I just recently started to discover the world beyond C, Java & Co and I am absolutely amazed. 
> 
> First I took a look at Scala. It's a great language to transition from Java and raised my appetite for declarative programming.
> 
> After extensive search & comparison I found my hobby language of choice - Mercury:
> * It has JVM interoperability (Write frontend gui code in Java/Scala, use Mercury for backend business logic)
> * Logic rules (Horn clauses) -> in & out modes for parameters
> * Higher-order functions with good standard library (e.g. list and fold)
> 
> * Typeclasses (sweet!)
> * It surely has more features I will need to discover (e.g. what about parallelization? IDE-support? etc.)
> 
> On paper it sounds astonishing, I hope my future practical endeavours confirm that :)

Hello new Anonymous user!

We're pleased that your interested and hope that you find what you're
looking for.  Personally I find that Mercury allows me to program in a very
high level way using many abstractions, some of which you've mentioned.
But I still feel as if I'm able to be /precise/ about my programs' semantics
and operations.

Mercury has a steep learning curve, it's quite different from many
developer's previous experiences.  We're happy to answer specific questions
you might have while learning Mercury.  Unfortunately there aren't many
resources online at the moment but we're continuing to improve this
situation.

To answer some questions you've raised already we do support parallelism and
concurrency.  This support isn't perfect and we're continuing to improve it.

The low level backend supports the parallel conjunction operator (&) which
can be used to advise the runtime system (when compiled with support for
parallelism) that it may execute the conjuncts in parallel.  There are many
things that can affect how much performance you actually achieve, I'm not
going to list them here but suggest some reading:

    Language Reference Manual section 2.9 Goals.

    Peter Wang's thesis describes how dependencies between parallel
    conjuncts are handled:
    http://www.mercurylang.org/documentation/papers.html#wangp-hons

    My thesis describes how the runtime system currently handles parallel
    conjunctions (information here supersedes Peter's thesis).  I also
    describe some pathological performance issues and their solution:
    http://www.mercurylang.org/documentation/papers.html#pbone_phd_thesis

We also have very experimental support for automatic parallelism.  This is
documented in my thesis and (I think) in the user's guide.  You're welcome
to experiment with it and I encourage you to let me know what you find.

In the parallel C grades, the Java and C# grades we also support
concurrency.  This is available via the thread module in the standard
library.  There is a caveat here that mixing concurrent and IO-heavy code in
the low-level C grade may not perform as well as expected: a thread that
blocks on IO can also block multiple other lightwight threads.

You also asked about IDE support.  Depends what you consider an 'IDE' we
have a style file that is compatible with VIM and elsewhere people have
worked on similar support for emacs.  There is also some support for the gud
debugger in emacs, but I don't know the details.

All the best.


-- 
Paul Bone



More information about the users mailing list