the corner office

a blog, by Colin Pretorius

Fun with Prolog

Another assignment done, and my introduction to the world of Prolog programming. Interesting and fun, although it takes a bit of getting used to the changed way of thinking. Everything seems back to front, inside out, but not really kind of thing. Solutions hover in the air as 'logical' ways of doing things, but then old-fashioned 'normal' programming thinking gets in the way and confuses the hell out of everything. By 3 in the morning last night I felt I was reasonably coherent and shock bloody horror, actually managed to write and debug a few procedures.

I probably spent as much time trying to get a Prolog environment up and running as I did actually doing the assignment. Our university software CD had a dog-old, 16-bit version of Amzi! Prolog for Windows 3.1 (woo!). First, I tried that with Wine, and got it working, except the editor wouldn't open documents. The listener interface could consult() files; just the editor was antsy. Not knowing what the hell I was doing, really, this all seemed too intimidating, so I downloaded the latest and greatest student/evaluation version from the Amzi website, which sounded very confusing but sexy at the same time, with an Eclipse plug-in that allows you to do all your work through Eclipse. Cool, thoughts I. Well, pain in the arse enough trying to get my environment working (still dunno why LD_LIBRARY_PATH is so finicky), I finally got the plug-ins loaded in Eclipse. Only to get told that the evaluation period had expired (on day 1. Doh!). That and other misbehaviour left me deciding to give that a skip.

First, I rebooted into Windows and worked with the app there. After a while I started missing my Linux desktop's mod con (hee hee), and with a bit of digging around, realised that all I really wanted was the interactive listener, which I knew was on my Linux box because I'd half-stumbled across it earlier. So, I rebooted, and tried said Linux native listener. Except that was a piece of shite, totally confusing itself with arrow and navigation key escape sequences. So I finally ended up editing my programs in good ole gedit and running the interactive listener and debugger through Wine. Which seemed to work well enough.

{2005.05.01 12:29}

Comments:

1. Ben Langhinrichs (2005.05.09 - 00:31) #

Boy, I haven't worked with Prolog since my university days, which were a good twenty years ago. (How we yearned for a 16-bit version in our cardboard box - Nah, just kidding) It was truly mind bending, although I had less to compare it to at the time since I had only ever user Pascal and LISP.

2. Colin (2005.05.10 - 00:41) #

It's fun, and a bit disappointing because unless one's going into academia, or working in an AI-oriented environment, it won't be more than a bit of a detour. But it is nice to have one's horizons broadened. As for LISP, I'd love to sit down and just play with it for a month or two, to know what the old-school hackers are always carrying on about :)

« Another day in the dungeons

» Fuhree