Go Down

Topic: Plain English Programming (Read 4304 times) previous topic - next topic

GerryRzeppa

I often wondered if COBOL had a German version, where the verb came at the end of the statement.
I don't know about COBOL, but we've had serious discussions with people who want to, or who are in the process of, translating our Plain English compiler into Plain Spanish, Plain Portuguese, Plain French, Plain German, and Plain Russian. Turns out that the deceptively simple parsing mechanism we implemented works well in any language.

I'm sure you'll think I'm being facetious, but the inspiration for the technique was based on two things: (1) close observation of my youngest, Chuckles, during his first couple of years, and (2) this comic by Gary Larson:



It became apparent to us that when we would say something like, "Time to suck on your bottle little buddy," what Chuckles actually heard was something like, "Blah, blah, SUCK, blah, blah, BOTTLE, blah, blah."

So it dawned on us that he must have a "type name" called BOTTLE somewhere in his left brain connected to a "type definition" (probably in the form of a picture) in his right brain, and a pre-compiled "routine" in his back brain with an associated left-brain "routine header" something like, "To SUCK a BOTTLE." And that he would eventually learn the inessential nuances of the language primarily by rote--simply by mimicking the speech patterns of his elders.

We thus developed our compiler along those lines, with local and global variables representing instantiated types (like Chuckles' actual bottle), taking great care to key only on articles, prepositions, conjunctions, and various forms of the verb "be" (which almost all languages have). The basic idea being that an imperative sentence could be considered understood when a matching routine header was found--even if the match was partial or sloppy.

The result, surprising as it may be to some, is a convenient, efficient, and remarkably reliable programming language where the natural-language vocabulary -- and even much of the grammar -- are defined by the user in his type, variable, and routine header definitions. It's a language that "learns" the "local dialect" simply by being used.


westfw

Quote
Plain English programming language
Hmm.  OK, I guess.

Quote
Copyright © 2006
So, how's that been going for you?  I guess that means that calls for more professional documentation or changes in design are unlikely to be heeded.  Nevertheless...

I really don't want to read language reference manuals that spend a lot of their time complaining about the OS they run on, other languages, perceived style issues, and so on...

Quote
As a matter of fact, our documentation was written with 10 year olds in mind!
Quote
I will quickly take over your screen so you no longer have to look at that painted whore of an interface that comes with the kluge.
   :
I see you're trembling. Don't be afraid. This may be the first time for you, but I'm an old hand at this. ... Was it as good for you as it was for me?
Right.

I see you've invented a new style of GUI, and Yet Another Set of editor keyboard shortcuts and mouse-directed movements.  And vocabulary.  Swell.


Quote
I don't do nested IFs.
I don't do nested LOOPS.
Really?


Quote
I'm thinking of creating a version that will work with the Arduino and I'm wondering (a) if there's any interest in such a thing
Not from me...   I didn't like COBOL either.
(And yes - I listened to a talk by Grace Hopper once (online, in person - I don't remember) and she said that they did foreign language versions as part of a demo, but were told that that was just showing off, or something like that.)




PaulMurrayCbr

Well, if you are generating windows executables, then generating arduino executables can't be that difficult. The main thing is the hardware abstraction layer that the existing arduino IDE supplies. Your compiler will have to do the same job of reading the board descriptions and working out how to convert a digitalWrite to a poke to the correct memory address.

The other main thing is providing some sort of layer allowing Plain English to use the existing C++ libraries - Serial, Servo and all the rest. You don't want to go re-writing them.
http://paulmurraycbr.github.io/ArduinoTheOOWay.html

PaulMurrayCbr

#18
Mar 20, 2016, 04:09 am Last Edit: Mar 20, 2016, 04:12 am by PaulMurrayCbr
Quote
I don't do nested IFs.
I don't do nested LOOPS.
Really?
So every little control construct needs its own named block. Inevitably, these named blocks will be called something that basically re-hashes the conditions in the chain of ifs and loops that would otherwise surround it:

Code: [Select]

PROC thing_to_do_when_switch_1_is_on_and_we_havent_timed_out_and_the_motor_is_running_OR_the_override_switch_is_off
  tell digital output 5 to be on
END PROC


A difficulty is that we deal with things that dont have nice plain-english names. When you set the SLC output on your XYZ667, the native way to name your variables is "SLC", because of the subject matter.

http://paulmurraycbr.github.io/ArduinoTheOOWay.html

Go Up