Having learned Prolog in 2012, and loved it ever since, and having used Haskell on and off for longer than I can remember (but not long enough to truly truly understand it yet) I once wrote a blog post about what my perfect programming language might be.
At the time I wrote it…
I had no idea Mercury even existed! Today I decided to try it…
The initial instructions are to download the latest stable release and then unpack it, change into the folder and do this:
That almost worked for me first time except for a couple of missing packages that were required, this may or may not affect you as well. The missing packages were `
and, and I installed them with:
Post-install setup and configuration
Once you have done the
sudo make install bit, the console shows you some very helpful extra information which, depending upon your taste for an easy life, should probably be carried out as suggested!
Adding the Mercury bin to $PATH
Don’t forget to add /usr/local/mercury-14.01.1/bin to your PATH,
zsh so this was just a case of editing my
~/.zshrc and adding this line at the bottom of the file:
Upgrading MANPATH & INFOPATH for reading pleasure
/usr/local/mercury-14.01.1/man to your MANPATH, and /usr/local/mercury-14.01.1/info to your INFOPATH,
…was as simple as adding this next to the previous item:
And some CGI black-magic
to copy deep_profiler/mdprof_cgi to /usr/lib/cgi-bin,
Not exactly sure what that’s all about but I did it anyway!
Since building Mercury can take a long time, you may prefer to use multiple processors during the build process. Adding “PARALLEL=-jN” without the quotes to make’s command line will tell make to run N tasks at once. Substitute N with the number of processors in your system, or fewer if you want to use other processors for other tasks. For example:
Of course, I didn’t see this little nuggest until after I’d installed it, right at the bottom of the page…I guess I still haven’t learned to read eveything before diving in after all these years! :)
Next time then!
Playing ball with Emacs
and to add the following lines to the `.emacs’ file in your home directory:
I mean who doesn’t use it for everything anyway? As instructed, I placed these lines into my ever swelling configuration:
In my next article in this series looking at Mercury, we’ll walk through how I fared following the mandatory “Hello World” application!