I recently saw a programming language called supernova and they said in the web page :
The Supernova Programming language is
a modern scripting language and theFirst one presents the concept of
programming with direct Fiction
Description usingClear subset of pure Human Language.
and you can write code like:
i want window and the window title is Hello World.
i want button and button caption is Close.
and button name is btn1.
btn1 mouse click. instructions are
you close window
end of instructions
my question is not about the language itself but it is that are we need such languages and did they make writing code easier or not?
The code may look like natural language, but it’s really just regular computer code with different keywords. In your example,
I wantis probably synonymous withnew. It’s not like you can use natural language directly and saymake me a windowinstead (and if you could, things would get even uglier…).Lets take a close look at your code and the language implications:
i wantmeansnew,anddenotes beginning of the argument list.the <type_name> <member_name> issets instance variablemember_nameon the object being created. Note that you have to write thetype_nametwice..ends a statement. However, you can ‘chain’ method calls on an object by starting the next statement withand. Also, how do you refer to a variable namedCloseinstead of the string"Close"? Heck, we even have this problem in regular English: what the difference between ‘Say your name’ and ‘Say “your name”‘?mouse clickis an identifier containing a space, should bemouseClick.instructions aredefines a lambda (see theisvs.arekeyword confusion causing trouble yet?).you close windowcallswindow.close().end of instructionsis end of a lambda. All of these are longer than they need to be.Remember all that? And those are only my guesses at the syntax, which could be completely wrong. Still seem simple? If so, try writing a larger program without breaking any of those rules, AND the additional rules you’ll need to define things like conditional logic, loops, classes, generics, inheritance, or whatever else you’ll need. All you’re doing is changing the symbols in regular programming languages to ‘natural language’ equivalents that are harder to remember, unnecessarily verbose, and more ambiguous.
Try this translation:
See how each line maps to its counterpart in the previous example, but states the intent more directly? Natural language may be good for execution by humans, but it is terribly difficult to use for precise specifications.
The more you try to make English communicate these ideas easily and clearly, the more it’s going to look like programming languages we already have. In short, programming languages are as close to natural language as we can get without losing clarity and simplicity. 😀