Alex Rivera | Logout

Is there a human readable programming language?

Asked 2008-10-14T20:51:13.777
56

I mean, is there a coded language with human style coding? For example:

Create an object called MyVar and initialize it to 10;
Take MyVar and call MyMethod() with parameters. . .

I know it's not so useful, but it can be interesting to create such a grammar.

Edit
Report

7 Answers

13

By creating a set of rules, it is possible to do logic programming in Prolog like this. You can build a grammar (or download one) for a particular domain, create a knowledge base and then query it. After defining your grammar you could do something like:

bob is a parent of tim.
mary is a parent of bob.

?- X is a grandparent of tim.
X = mary

?- jim is a parent of bob.
false
answered 2008-10-14T21:07:30.497
13

I see the Shakespeare programming language have yet to be mentioned.

These programs are coded to look like shakespear plays, the individial characters in the play being variables that can hold numbers and the various phrases in the play manipulate the characters and the number they hold. For instance, "Speak your mind" orders a character to output his value.

answered 2008-10-15T13:49:44.717
6

Inform 7 is the most successful such system I've seen. It has two advantages over the cruder systems listed in other answers here: it's for a domain particularly appropriate for natural language (interactive fiction), and it does a fancier analysis of the input code based on more computational-linguistics lore, not just a conventional programming-language grammar that happens to use English words instead of braces, etc.

answered 2008-10-14T21:43:48.757
1

That has to be whitespace. The only programming language where there's simply nothing to read: http://en.wikipedia.org/wiki/Whitespace_(programming_language)

answered 2008-11-13T19:21:38.700
0

Visual Basic (and BASIC based languages in general) are about as close to human language as you get. I'd argue Python comes pretty close too. Using these you can makes your code read as structed english if you care enough, but no, there's no natural English compilers because there's just too much ambiguity there.

answered 2008-10-14T20:55:24.080
0

Basic was a first approach in that direction, and as has been shown in another reply, Perl also allows code that's fairly close to human language - if you ignore all that punctuation.

I just read a very interesting article on how to translate Latin to Perl (for which there's also a Perl module).

So if the human language has enough structure, and you introduce enough restrictions to avoid ambiguousness, you can indeed program in (mostly) human language.

But really nobody really does, because it's very verbose, and hard to make both readable and accurate.

answered 2008-10-14T20:58:49.453
0

Windev is very easy and human readable language. http://www.pcsoft.fr/windev/presentation.htm

answered 2009-10-08T10:46:51.657

Your Answer