Programming in Plain English

Programming in Plain English

Star Trek had really smart computers, that you could simply tell what you wanted to do and they did it. The [Rzeppa] family has started a plain English compiler. It runs under Windows and appears to be fairly capable.


Plain language programming isn’t exactly a new idea. COBOL was supposed to mimic natural language with statements like:


MULTIPLY HOURS BY RATE GIVING PAYAMOUNT

You could argue this didn’t go over very well, but there is still a whole lot of COBOL doing a whole lot of things in the business world. Today computers have more memory and speed, so programmers have been getting more and more verbose for decades. No more variable names such asX1 and fprdx. Maybe this will catch on.

A function to clear the screen starts out with a list of phrases you might say to call the routine. This is similar to the type of personal assistant logic in which you can speak natural language, but in doing so you had better say something that matches its known template. Here’s the function:


To erase the screen;
To blank out the screen;
To wipe off the screen;
To clear the screen:
Unmask everything.
Draw the screen’s box with the black color and the black color.
Refresh the screen.
Put the screen’s box into the context’s box.

This will work if you say “erase the screen” or “blank out the screen” but it won’t work if you say “blank the screen.” The hello world program shown in the accompanying graphic looks like this:


To run:
Start up.
Clear the screen.
Use medium letters. Use the fat pen.
Pick a really dark color.
Loop.
Start in the center of the ..

Support the originator by clicking the read the rest link below.