Development of The Last One (paper) - British program generator

Written by David Tebbutt, editor of Personal Computer World, in April 1981

OVERVIEW

It's here at last: a computer system which generates genuine program code. No more bolting together pre-written modules, doctored by parameters. No more having to write the odd patch or additional program by hand. This systems accepts program and suite designs at the flowchart level and generates the code necessary to meet your needs. Exactly.

We at PCW couldn't really believe it either, so we spent a lot of time with David James, the system's creator, putting The Last One through its paces. Sure, we found a number of things which could be improved, but the fact is that David has created a remarkable system which really does write genuine programs.

In this conference session you will learn not only what The Last One is but, perhaps more importantly, also how someone in complete isolation, with no previous computing experience, spent over seven years and a personal fortune developing such a system.

David Tebbutt will present the paper and David James will answer your questions.

THE SYSTEM

The Last One allows its user to enter a program design by selecting from various flowcharting options displayed on the VDU. During entry of these flowchart selections, the system will ask any questions necessary to its complete 'understanding' of each line. For example, an instruction to the system to ask for an appropriate file step is completed, so the display changes 'read from file' will provoke reference. As each flowchart to show the program design up to that stage.

Once the whole flowchart has been entered, the system examines it for completeness and logic. Should it find any gaps or illogicalities then system will interrogate the user further, until its 'understanding' is complete.

From this point on, The Last One becomes completely automatic and generates appropriate program coding. At the time of writing this was being produced in Basic on an Ohio C3C. There is no real reason why code shouldn't be generated in any other language, it's just that Basic was seen to be the 'lingua franca' of the micro world. Since earlier versions of the system have run on a variety of machines including Tandy, Apple, PET, Sorcerer and even an HP-41C, conversion of the current version to other machines should pose few problems.

One task performed by The Last One which hasn't been mentioned is that it gives the user the opportunity to define his file requirements. The user describes the field names required, the field lengths and type of content and the system does the actual file creation for him. Obviously, he will be expected to include programs in the suite which enable these files to be filled with appropriate data.

On the C3C, 100 lines of bug-free Basic code can be generated in around five minutes. Since this particular system uses Winchester disks, you could expect a floppy disk, stringy floppy or cassette tape system to run correspondingly slower. Still, whatever version you end up with, it's almost certain to beat the best programmer for both speed and accuracy!

Now, what always happens when you present that final, debugged program to the average user? You've got it - he suddenly realises that it's not quite what he originally had in mind! It is polite to draw a veil across what usually happens next, but with The Last One there's no problem. You can change anything in the system and the program code is automatically regenerated to reflect the change. The Last One may ask the odd question or two, but these will only relate to the parts of the system being modified. Even file layouts can be changed, whether the files are already in use or not. And, here's a neat trick: any programs affected by a file layout amendment will also be regenerated taking this into account.

This all means that, for the first time, systems can be modified to reflect a user's changing needs without it costing him an arm and a leg. The next page shows an outline flowchart of The Last One. You will notice a 'system' function and an 'enquiry' function. The first 'steers' the user through the stages necessary for the generation of a system, while the second helps the user keep track of where he is with respect to his flowcharts, his files or The Last One itself.

BACKGROUND

The story started back in 1974 when David James bought a Wang 2200 to help run his 'leisure bond' business. He bought the machine, a statistical package and then booked himself on a course to learn Basic programming. All went smoothly for a couple of months then David realised that the package didn't quite do what he needed. He asked Wang to make the necessary modifications and was amazed when they quoted a hefty price for doing the work. David had always assumed that computers would be used to make program modifications at very low cost.

Not wishing to pay Wang for the work, David decided to do the job himself. Soon he began wondering whether he might not be able to program the computer to run his business, taking all the logical decisions for him. Before long he had embarked on a course of action which would completely change his life. He decided to write what he called a 'general-purpose', open-ended, problem solving, learning program'. In other words, what you or I might call an artificial intelligence system. He honestly believed that he was way behind everyone else in this and that it would take him about a year to finish the job. Fortunately, perhaps, he had no idea of the magnitude of the task nor where it was to lead him.

He spent the first fifteen months building a system around some highly structured data-bases, coupled with a chunk of code which could actually learn and develop itself. Unfortunately, by the time the system was written, it was clear that it could never run fast enough to be of practical use. Development ground to a halt while David figured a way out of this predicament In the end he used the AI system itself to generate the programs necessary to overcome the problems.

By September 1977, David had a logic-solving system which, if it didn't 'understand', asked questions of the user until it had sufficient knowledge to be able to represent the logic mathematically. The system appeared to 'pause' while the logic was developed. On one occasion the problem was so complex that the system 'paused' for three weeks. Sensibly, David had built some sort of trace into the program so he was able to check periodically and make sure it hadn't got stuck in a loop. Once the system's grasp of the logic was complete it then went ahead and turned this into a running program. The next year or so was spent 'tweaking' the system. Redundant code was removed, error trapping included and the system put through its paces on a real project.

By this time David's businesses, which he'd all but ignored, crashed leaving him destitute. The receiver took away his beloved computers - by then David had acquired a TRS-80 and an Apple, as well as the Wang - and left him feeling very, very low indeed. In March 1979 his plight was mentioned in another British computer journal, 'Computer Talk' and, fortunately for David, this was read by one 'Scotty' Bambury. Now Scotty is a successful businessman who, like David, was wondering whether he could program a computer to write programs. He'd got as far as transferring his own responsibilities to others in preparation for his entry into programming when he read about David. Scotty realised immediately that the work had already been done and promptly offered David the opportunity to carry on with his research. The only stipulation was that David should concentrate on making the program writing routines commercial before returning to his AI system. David readily agreed and soon began work using a disk-based Sorcerer running under CP/M.

The first version of The Last One used pre-written program modules which were set according to the flowchart options chosen and then bolted together to form a program. This version had its weaknesses so versions two and three quickly followed. Two worked on the same basis but also had a file creation module, while three added the ability to modify flowcharts.

By mid-1980 Scotty was getting so excited that he offered to buy David any computer he wanted. David rushed out and ordered an Ohio C3C with two terminals, 96k memory, a printer, twin 8" floppies and a 23 Mbyte Winchester disk as well. All in all, a rather nice set-up. Versions four, five and six of the system were just like one, two and three except that they ran on the Ohio machine.

By the end of August 1980 the novelty of the big machine had worn off and David considered that the programs were still running too slowly. At this point he decided to take a week's holiday and, while he was away, he hit on the answer to his problem. By mid-September version seven was up and running. Gone were the parameter-driven, pre-written modules and in their place was a system which generated true Basic code.

Version eight came hot on the heels of version seven, but offered the added advantage of the automatic generation of fresh program code whenever file layouts were changed.

By now David had taken the project just about as far as he could without outside help. Accordingly, a number of computer professionals were approached and invited to see the system and give their comments. Without exception these people were astounded at The Last One, especially since David had developed the system in almost complete isolation and without any previous computing experience.

Version nine - the current version at the time of writing - is well under way, incorporating most of the suggestions made by the various computer experts. It is now possible to incorporate previously written programs into a new program. Some fairly extensive screen formatting facilities and a host of changes aimed at making the system user-friendly have also been added. The British government's Department of Industry is now very interested in the project and is paying David to get version nine running on a popular disk-based micro. It looks as if, very soon, The Last One will be finished and ready for the world markets.

AND FINALLY

The Last One was originally conceived as a way of generating programs to help Scotty run his business. The aim was to produce the programs in such a way that they could be modified easily as Scotty's requirements changed. As development progressed it became clear that here was the potential for an exciting software product which could mark the beginning of a new era in computing: an era in which the user can receive exactly the system he requires and which can change along with his changing needs. No more will he be held to ransom by a data processing industry largely indifferent to the need for systems to be easily changed and intolerant of the slightest deviation by the user from original system specifications.

For Scotty and David the prospects are very exciting - having both been users they now have an opportunity to set up a company which specialises in giving the user exactly what he wants, when he wants it.

Reference: Personal Computer World, February 1981 - The Last One. gives more background material on Scotty and David as well as explaining the use of the system from the operator's point of view.

Note: Trade Mark, Copyright and Patent applications have all been filed for The Last One.