5 ms·
The Mercury Programming Language
- tlack 16y agoI've always found this language interesting, especially because of its early commercial usage, but I haven't seen many first hand accounts of its use. Anyone care to chime in?
- rndmcnlly0 16y agoEven if you don't find a way to use anything out of the functional-logical space, reading about languages like this can change the way you program when you are in a functional-only or logical-only language. Here's a little oversimplification that I've found useful for understanding this stuff. * Mercury is the Haskell of Prolog * Curry is the Prolog of Haskell It's interesting to see a lot of the ideas in Mercury addressed from the opposite direction Curry. See for yourself: http://www-ps.informatik.uni-kiel.de/currywiki/ http://www-ps.informatik.uni-kiel.de/currywiki/
- Ixiaus 16y agoThis is how I feel about it. Mercury is an elegant language but I think the applicable domain is restricted to a very narrow subset of the industry. As a [primarily] web programmer I will generally only become more "cultured" by studying esoteric languages (Scheme, Haskell, Mercury, Curry) - that acculturation does diffuse into my day-to-day practice, though. I find myself structuring code in a novel manner (often times it's more clean, cogent, and effective too) that I would not normally have done with my narrower knowledge space, pre-saturation. I also see myself creating logic and using data structures that weren't historically typical of me. I think every programmer should study esoteric languages. It's akin to the contrast of arithmetic and mathematical logic - you have the opportunity to appreciate and experience the ideal rather than the mundane. Not that beauty can't be found in building a web application (or any other application for that matter) using a framework and one's own set of libraries; I do everyday because I pour the expression of who I am into my practice - the thing is, it's [esoteric languages] the same sort of joy one derives from contemplating deep philosophical questions or from deliberately cultivating character through introspection. I felt like whipping out the PhilosoRaptor tonight I guess...
- swannodette 16y agoThe fact that people write tediously comprehensive imperative unit tests to verify their programs should be a warning sign that the use cases for logic programming may be more much general than you think. A hunch, nothing more. I'm just starting to dig into this stuff.
- silentbicycle 16y agoThis! People are itching for declarative testing systems. Writing testing code by hand is tedious and error-prone. Static typing works for a lot of things, but isn't completely satisfactory. Randomized testing is also useful (give a function that tests a property, give random_int -> value generators for its arguments, let it find edge cases), but those are only two facets of a much bigger picture. I'm really interested in more modern takes on Prolog, but from what I've read about Mercury, it seems to throw out my favorite aspect: computing with partial information. Constraint logic programming seems like a more valuable direction, though I see the appeal in a Prolog-esque language informed by modern type theory, and I'm particularly interested in what it does with linear types.
- liangzan 16y agoPrince XML is written in Mercury http://en.wikipedia.org/wiki/Prince_XML http://en.wikipedia.org/wiki/Prince_XML
- xtho 16y agoLogic programming languages [...] have not had significant impact on the computer industry. Mercury is a new logic/functional programming language Mercury is "new" and admittedly interesting since 15 years now. Please somebody update the blurb.
- mkramlich 16y agoIf anyone running that site reads this, request: put a Hello World code sample right smack on the home page. Seeing the size and structure of the syntax to accomplish that basic task will tell me loads, immediately, in very little space, about your language. I can then dig in deeper, or move on, depending on interest.
- mkramlich 16y agoTo save others the effort, I did some spelunking and found a Hello World in a tutorial. Here it is: :- module hello. :- interface. :- import_module io. :- pred main(io::di, io::uo) is det. :- implementation. main(IOState_in, IOState_out) :- io.write_string("Hello, World!\n", IOState_in, IOState_out).