My First Experience of Open Source Software - Porting a Prolog Interpreter (or, so you think ChatGPT is new?!)
Recently I was trying to remember what my first experience of open source software probably was and I think I've worked it out - it was a long time ago and involved a Prolog Interpreter. Way back in the early 1980s (in NZ) the only way to get academic software was by tape - the internet hadn't reached NZ yet. While studying at Waikato University I was becoming increasingly interested in Artificial Intelligence, and Machine Learning in particular. In those days there were two main competitors for an AI language - LISP (too many ((()))))'s) and Prolog - a logic programming language. For me, the only choice was Prolog.
But where to get it from? I recall we had acquired a version of Prolog in Pascal (which was good as that was the first language of choice in those days and ran on the university VAX 11/780). But I wanted to run it on a "home brew" microcomputer a friend and I had designed and built from scratch based on a Motorola 6809 microprocessor. We had designed and built the hardware (complete with 64K RAM and dual 8" floppy disks), wrote a BCPL compiler for the 6809 (also an open source experience, as the BCPL was available - on tape - and written in BCPL with an intermediate language "O" so only part of the compiler had to be bootstrapped - I also implemented some aggressive optimisations for the BCPL compiler as part of a compiler course), and then a disk driver, basic operating system and a few utilities (command line, editor etc). But being interested in AI I was interested in getting Prolog working on it. I recall looking at the Prolog source code and noticing that all the comments and the variable names were in a foreign language - this made it tricky to port to BCPL but I succeeded eventually - and I learned a lot more about the internals of Prolog in the process (E.g. Horn Clauses, unification, resolution and backtracking black magic).
But recently I wondered where this "odd' version of Prolog had come from... Looking at Prolog history I found what I was looking for. In this paper ("Prolog was not really distributed; rather it ‘escaped’ and ‘multiplied’") there is a reference to the first-ever edition of the Logic Programming Newsletter which explains that Maurice BRUYNOOGHE wrote a Prolog interpreter in 1979 in Pascal - in Belgium. That name and the fact that the comments were not in English explain the origin of the source code I ported to BCPL. So I guess I contributed to the "multiplication" of Prolog if not its escape.
What was Prolog useful for? I used it for a course on "automatic" programming and implemented an English language parser (based on an open English grammar from IBM), but primarily for my MSc thesis research on autonomous machine learning - about 1/3 of my 300-page thesis was the Prolog code I had written (for a robot world simulation, first order machine learning algorithms, etc) which I made open source in the publication.
But, even though I had used Prolog for natural language processing, I was surprised to read in the above paper that Prolog was developed primarily to act as a natural language reasoning system (well, French!) - this is a record of a dialogue with it in 1971 - this a long time before ChatGPT:
User:
Cats kill mice.
Tom is a cat who does not like mice who eat cheese.
Jerry is a mouse who eats cheese.
Max is not a mouse.
领英推荐
What does Tom do?
Prolog:
Tom does not like mice who eat cheese.
Tom kills mice.
Repeating the same questions with ChatGPT today (52 years since the original) resulted in a similar conversation.
ChatGPT:
This is a logical question that can be answered by using the given facts and some common knowledge about cats and mice. Based on the information, we can infer that:
So, the availability of open-source software (even if it was in the wrong programming language, with comments in a foreign language, on a tape!) had a big impact on my computer science career. I continued to use Prolog into the late 1980s (PhD research at UNSW), and into the 1990s (a declarative protocol generator for a commercial project with Optus, and a declarative test-case generator for the UNIX kernel etc, and in the late 1990s worked on a CSIRO project to turn a monolithic Prolog system into a distributed one - NRMTools it was called). It also made me aware of the existence of open-source software early on (it was relatively rare in the early 1980s) and the opportunities and benefits of being able to read the source code, use the source code and even modify and extend the source code (of which porting to another language is only one of many examples).
Helping Tech Vendors meet their Ideal Customer Profiles ????Director @FordBridge Events
1 年Must have been an awesome experience, Paul Brebner