Prolog Rules

Surana recently learned prolog, and discovered that it's great at problems involving search -- searching for compiler optimizations, for example. I had the same insight about Scheme a few years ago. I decided to prototype Ripple in Scheme. It turned out to be so easy that it popped my enthusiasm bubble, and I decided that the problem was simply that I had been using Java (where dataflow was hard) instead of Scheme (where it was easy). I can empathize with his comment that "Everything has already been done."

On a slightly different note, I was playing around the other night, using Prolog for a slightly different search problem. My problem related to finding potential runtime errors in code, using a technique called "abstract interpretation". I was only working on paper, sketching out various ideas. But after about fifteen minutes I found that the most natural way of expressing what I was thinking about was to write it down using Prolog's syntax and semantics. I suppose the sign of a sweet-spot language is when you naturally fall into using it for writing pseudocode. Considering how often I find myself aching to redesign the semantics of various languages, the fact that I felt perfectly comfortable using Prolog's goal-directed backtracking model is really saying something.

Posted on September 28, 2004 02:45 PM
More languages articles

Comments
Post a comment









Remember info?




Prove you're human. Type "human":