News for hackers. Stuff that matters.
Re:The Mercury programming language by thrwia22 on Wednesday November 07, 2018 @11:15PM (#18404290)
faq in the documentation is mostly useless. but the wikipedia entry on it is quite succinct and good. but still after reading that wikipedia article and skimming through the website, i, as a typical average code monkey with a some grasp of python/js/whateva else among these lines, have no clear idea what and where mercurylang is useful for. can someone eli5-explain that to me in a few sentences?
Re:The Mercury programming language by colanderman on Wednesday November 07, 2018 @11:27PM (#18404318)
Mercury is the love child of Haskell and Prolog: that is, a very strongly typed logic language. However, it's not quite as flexible a logic language as Prolog (owing mostly to its strong typechecking and modality system), so in practice it's closer to a Haskell with a different I/O containment mechanism (uniqueness types instead of monads) and the ability to sometimes write reversible functions if you bang your head against the modality system hard enough.

Its compiler is impressive, and is capable of acts such as compiling certain non-tail-recursive functions in a tail-recursive manner, or even transforming them into tail-recursive equivalents, given the right hints.

All this capability comes at a cost. At least as of ~4 years ago, the error messages the compiler can spit out over modality errors dwarf even those from C++ templates. And compiler bugs/unimplemented features are not unheard of.

Re:The Mercury programming language by astrange on Thursday November 08, 2018 @02:37AM (#18404876)
I want to point out that Mercury is an eager language, so it's more like ML than Haskell. It does have the ability to backtrack and execute in reverse, which is kind of magical in the way people think Haskell is.

I wanted to learn it recently, but couldn't find enough example programs.

Re:The Mercury programming language by toolslive on Thursday November 08, 2018 @03:40AM (#18405082)
Yes, uniquenes types for IO (with proper syntactic sugar) really felt powerful, elegant and correct all at the same time.
Re:The Mercury programming language by bjz_ on Wednesday November 07, 2018 @11:43PM (#18404370)
As Mike says in a sibling comment, we use it quite heavily for implementing our HTML-to-PDF browser engine, https://www.princexml.com

It's a pretty handy general purpose language, kind of a combination of Prolog and Haskell. It's much easier to maintain a long-lived project in Mercury than one in Prolog due to the static typing, and it also generates much more efficient code. That said, it doesn't have the greatest documentation, so you might have to reach out on IRC, or the mailing list if you run into some challenges with it.

Re:The Mercury programming language by dundunduuuuun on Thursday November 08, 2018 @12:11AM (#18404455)
I agree with bjz_ - the documentation isn't great, and may have deterred more than a few curious individuals.

That aside, it's a pretty nifty language and I found learning it worthwhile.

Re:The Mercury programming language by aidenn0 on Wednesday November 07, 2018 @11:18PM (#18404294)
The e-mail client I use (bower) is written in mercury.