Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

I was wondering, there are so many articles about what the best coding languages are. C, C++ Go Haskel lisp java ML F# etc etc.

But rarely i see an article about the most human like programming language. It doesn't need to be fast but be closest to the English (or other natural) language. Once it was a goal to create such languages it was seen as a form of AI. But these days AI went a different direction Now there is Siri etc, but those are application not coding languages themselves.

Out of curiosity is there still somewhere a language that understand basic English to code with ?

share|improve this question

closed as not a real question by gnat, Glenn Nelson, Walter, Martijn Pieters, ChrisF Jan 20 '13 at 23:33

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

3  
COBOL was supposed to be very human readable (so that non programmer account types could use (well that was the idea)). –  Loki Astari Jan 20 '13 at 15:46
9  
It has not historically been a great idea. Programming bridges a different gap than human spoken languages do. –  Erik Reppen Jan 20 '13 at 16:30
1  
An obligatory DeCSS link: cs.cmu.edu/~dst/DeCSS/Gallery/decss-haiku.txt –  SK-logic Jan 20 '13 at 16:35
1  
Lolcode! lol lol –  Falcon Jan 20 '13 at 19:54
1  
what is unclear about this real question ? I ask what is the most human lange based programming language. One that comes most close to natural language –  user613326 Feb 8 at 14:32

8 Answers 8

up vote 18 down vote accepted

COBOL is the classic example of a language whose expression syntax tried to approximate English, and programmers generally hate(d) it. Think of it the other way around: Arithmetic and logical notation were developed, over the last few centuries, as improvements over natural-language descriptions. That's why you see English keywords used for flow of control (for, while, if/else), but not for arithmetic.

For those reasons, programming languages whose syntax is based on a natural language tend to be curiosities, not real tools. That said, Perligata is just what you're looking for: An alternative syntax for perl (implemented as a module) that uses rich natural-language syntax instead of obscure punctuation. But there's a catch: the natural language is Latin.

Here's a working implementation of the Sieve or Eratosthenes, from the documentation (a peculiar and highly recommended read). Enjoy!

#! /usr/local/bin/perl -w

use Lingua::Romana::Perligata;

maximum inquementum tum biguttam egresso scribe.
meo maximo vestibulo perlegamentum da.
da duo tum maximum conscribementa meis listis.

dum listis decapitamentum damentum nexto
    fac sic
        nextum tum novumversum scribe egresso.
        lista sic hoc recidementum nextum cis vannementa da listis.
    cis.

PS. Unlike the Chef and Shakespeare languages mentioned by @dyosoko, Perligata is not gratuitously convoluted or verbose; it maps almost one to one to the equivalent perl program. (But still it's an "esoteric" language because, well, who needs it?)

share|improve this answer
    
"Progammers generally hate[d COBOL]": is that why so many of them used it? It and fortran were for a long time the most popular languages in use, beating out ALGOL, PL/1 and many others. –  user4051 Jan 20 '13 at 23:34
    
That's what I hear but I wasn't around in its heyday, what do I know. The complaints were part of the COBOL lore, but that could have been disinformation by the C programmers I hung with :-). Still, I don't think programmer satisfaction was the primary factor in choosing a project language; we're talking about large enterprise projects. And certainly the expression syntax didn't catch on with newer languages, that's a fact. –  alexis Jan 21 '13 at 0:16
    
xTalk is another notable family of structured-English programming languages. –  Anderson Green Jan 16 at 4:00

AppleScript claims to be based on a Natural Language Metaphor.

In keeping with the Mac OS tradition of ease-of-use, the AppleScript language is designed on the natural language metaphor, just as the graphical user interface is designed on the desktop metaphor. A well-written AppleScript should be clear enough to be read and understood by anyone, and easily edited. The language is based largely on HyperCard's HyperTalk language, extended to refer not only to the HyperCard world of cards and stacks, but also theoretically to any document. To this end, the AppleScript team introduced the AppleEvent Object Model (AEOM), which specifies the objects any particular application "knows".

The heart of the AppleScript language is the use of terms that act as nouns and verbs that can be combined. For example, rather than a different verb to print a page, document or range of pages (printPage, printDocument, printRange) AppleScript uses a single "print" verb which can be combined with an object, such as a page, a document or a range of pages...

share|improve this answer
    
In that vein, Applescript also used to support foreign language translations of it. It called them "dialects" : French Dialect, Italian Dialect... –  ZJR Jan 20 '13 at 18:00
    
Look at hypertalk from the hypercard days. –  MichaelT Jan 21 '13 at 16:57

Take a look at Shakespeare or maybe at Chef.

  • The Shakespeare Programming Language (SPL) is... designed to make programs appear to be something other than programs; in this case, Shakespearean plays.

    A character list in the beginning of the program declares a number of stacks, naturally with names like "Romeo" and "Juliet". These characters enter into dialogue with each other in which they manipulate each other's topmost values, push and pop each other, and do I/O. The characters can also ask each other questions which behave as conditional statements. On the whole, the programming model is very similar to assembly language, but more than an order of magnitude more verbose...

  • Chef by David Morgan-Mar is a stack-oriented programming language designed to make programs look like cooking recipes. Programs consist of a title, a list of variables and their data values and a list of stack manipulation instructions. Despite the first stated design principle requiring that "Program recipes should not only generate valid output, but be easy to prepare and delicious.", most programs consist of ingredients in combinations and quantities that would result in food that is barely edible (if at all).[5] One exception to this is Hello World Cake with Chocolate sauce

share|improve this answer
    
Note that both are esoteric language. In other words: Jokes, created only for fun or challenge rather than because someone thought programming like that is a good idea. –  delnan Jan 20 '13 at 15:32
    
Sure, but take Brainfuck as example: people are actually using it. (Crazy people). –  dysoco Jan 20 '13 at 16:29
3  
People are using it on pet projects to prove a point, to be challenged, or just for the heck of it. Nobody uses it because it's a good choice of programming language. Except perhaps people who are literally crazy, but we shouldn't base our choice of technology on that ;-) Also, both of these languages are kinda cheating: They're not actually imitating English, they're defined such that one can write code that's also English. A Shakespeare compiler only recognized a few keywords and otherwise just does arithmetic with character codes. –  delnan Jan 20 '13 at 16:44

Background

The other answers are talking about history and existing languages, and I think they are pretty good. So, I would like to say something else.

In among existing programming languages - well none of them are really close to human languages.

One could argue among the programming languages which exist, whichever is easy to understand and feels natural to program in - would be the most human language like language (because that's one quality of human languages).

But that can't be taken as a factor in deciding it, because what one person feels natural in, might not be natural/easy enough for the other person. For example, to me Ruby feels natural. I can promise you that everyone else need not feel the same about it. Here is an interview with "Matz" (creator of ruby), where he talks about this particular thing before talking about Ruby in general.

TL;DR - start from here

Now, coming to really answering your question. Let's think about the question: "Most human language like language"... but what's the "human language" in your question? There are tons of them out there. So, I want to point towards engineered languages like Lojban.

As the wiki puts it:

Lojban is a constructed, syntactically unambiguous human language based on predicate logic.

I think a syntactically unambiguous language that is engineered to be a logically correct human language should be an ideal example of what we refer to as a human language in this context.

xkcd-lojban

Now, Lojban itself is not an answer to your question. In fact, you might argue that it's the exact opposite of what you asked for (saying it's most programming language like human language).

The answer I would like to suggest here is samtrosku, which is a

procedural computer language expressed in lojban.

I am pasting some random quotes here which I think are relevant to this topic.

regarding why Lojban is better than other human languages?

English is ok as a base for a programming language for a very limited subset of real world; maybe lojban could be better in fields such as artificial intelligence,interacting with humans, processing and understanding writings and orders because unambiguity.

Using English as a programming language would require a horrible mangling of the grammar just to be able to use it effectively. Also, lojban can say things that are of interest to mathematicians and programmers in fewer words than English can, just to begin with.

Another point to be kept in mind is that an ideal human language like programming language will not be typed on keyboard, but rather spoken to a computer. So, I think samtrosku programs would be spoken to a computer. This is what they look like:

nu'a ne'o (factorial)

Assuming that factorial isn't a built-in operation with {ne'o}, you could implement it as the brivla {nu'a ne'o}:

.i ca'e ko'a nu'a ne'o ko'e ijo ('X == Y factorial' is defined as:)
tu'e
ny goi 1 (n = 1)
.i ko zukte di'e ca le du'u ko'e zmadu li 1 (while Y > 1 do this...)
.itu'e
ko dungau ny li ny pi'i ko'e (n = n*Y)
.i ko dungau ko'e li ko'e vu'u 1 (Y = Y-1)
tu'u
.i ko'a jagdu'o ny (return n as the value of X)
tu'u 

To be honest, even I don't understand it (I don't know lojban as of yet). But, I can say that it's a factorial program.

I think languages like these are being researched upon, I think it's a pretty great thing to research upon. I just hope that they get done soon, because I want to develop some application using a spoken programming language before I die... ;)

References

Samtrosku specification

Spoken Programming

http://www.lojban.org/tiki/tiki-index.php?page=samtrosku

http://en.wikipedia.org/wiki/Lojban

share|improve this answer
    
Well the background here is that i grew up with the age that it was thought computers could do everything soon we had human like robots, and AI's would be very human like and able to talk and understand. Close to those ideas where some programming languages and some early AI's. I've read books about self awareness inside some AI's (of-course never proven) though the general idea was that computers would become more human like. Programming them by english language. The closest thing of that is maybe IBM's watson machine, but its not based on algorythms that are readable english. –  user613326 Feb 19 '13 at 23:32

A programming language should be formal enough. This isn't purely for easy machine processing, but also for human understanding. This makes programming languages closer to, e.g. mathematical notation.

The difference is in amount of terms a program operates vs mathmatical formula uses. While the mathematical formula uses a limited number of well defined symbols, a program defines a lot of them: each variable, function, or type is such term, and there are thousands of them in every moderate-sized program. So, it is a good idea to give these terms a meaningful names, and this is where a similarity to a natural language is suitable. For example, such names could be multi-word, instead of CamelCase or under_scored_identifiers.

Also, a program logic could be expressed by sentences, not necessary a plain sequence of statements. This makes program look closer to natural text and (arguably) makes it more readable.

See o42a - it's my attempt to create a programming language, which is closer to natural English.

share|improve this answer

Inform is a language for building text adventures. It compiles to bytecode, similar to the bytecode developed for the Infocom games. The previous versions looked a lot like conventional programming languages. Version 7, the current version, is basically structured English.

Here's an example.

share|improve this answer
    
its also a lot more useful than most natural language like PLs as it targets a very specific domain –  jk. Jan 21 '13 at 10:38

I think the basic problem with using natural language (English, Chinese, etc.) to program a computer is that natural languages are too flexible and imprecise to effectively be translated into a computer program.

As an example, take how hard it is to write and understand legal documents and standards, where people try to very precisely specify something. And those are meant to be read by other people, not machines that are essentially incapable of "reading between the lines".

As another example, if machines could effectively process natural language, most programmers would be out of a job, because a machine could directly interpret the requirements specifications.

share|improve this answer
1  
No they wouldn't be out of their job! The requirement specification is usually far from executable code. It merely says: We want this and that. You still would need people who would explain to the computer in precise, unambiguous english, what to do. - This reminds me on the old joke of the mathematician and its girl friend. She says to him: "I love you!" and the mathematician begins to whine. Why? Because she didn't say: "I love you and only you." –  Ingo Jan 20 '13 at 21:52
    
@Ingo: I was describing a "what if" scenario. What if computers could deal with ambiguous, imprecise english, just like we software engineers have to deal with every day. –  Bart van Ingen Schenau Jan 21 '13 at 8:17
    
this is an easy one: those computers would probably sit in meetings half of the day .... –  Ingo Jan 21 '13 at 12:15

I think that a lot of the 'sounds and reads like English" effort has moved into the test space.

With frameworks like cucumber (ruby) and Jasmine (javascript) you say things like "When I, as a User, accept the agreement", etc.

Currently you still have to write the lower code at some point to fulfill these tests but this language is filling the middle ground for some people and organizations.

Opinion: What frequently happens with such efforts is that it becomes apparent that, regardless of the language, syntax or words, programming is about a logical approach to operations. It takes programmers many years to learn the importance of organizing programs and modules. Concepts such as boolean, unique, DRY are much more precise that English, which. I think most folks will agree, is anything from a 'precise' language. A main issue with English is that context and dialect can totally change the meaning of sentences. Computer languages and systems are not yet able to access, use and process that contextual information reliably.

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.