views:

326

answers:

9

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 the

First one presents the concept of programming with direct Fiction Description using

Clear 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?

+3  A: 

Whether they're better or not is opinion, but that looks like some mutated cross of COBOL and BASIC, which is most definitely epically bad.

So in my opinion, no. I think somewhat to-the-point languages that still use readable verbs/adjectives/names are better (C++, C#, PHP, etc are my preferred languages).

Some languages start to get too high-level and/or verbose, making the actual logic so abstracted it's hard to know what does what. Some are too low-level and brief, forcing you to explicitly state everything you want done. A balance between readability and brevity, with power and flexibility, is what is best for development.

peachykeen
+4  A: 

The programming language you have showed us above is extremely verbose (as it seems even more than COBOL).

This comes with several problems:

  • It takes long code to do simple things.
  • Code grows unmaintainable fairly fast
  • It takes long to find out what code does
lamas
+9  A: 

Since the fundamental difficulty of programming is getting your thoughts ordered enough to tell the computer what to do, making the language more “natural” is highly unlikely to make it more accessible to non-programmers; the language itself was never the real problem in the first place. What's more, all that extra clutter of natural language doesn't help any programmers (worth the name) with what they're doing either, so why add it?

Or can we have a real natural language programming language, complete with “Um”, “Er”, and “Oh, I don't really know”? :-)

Donal Fellows
The natural programming language you mention is the one used by customers to express their intent to programmers. It's reserved key-phrases include "automates our process", "meets all requirements" and "improves productivity". These may or may not be used in conjunction with concrete objects to further describe the intent. In most cases, it is used as a query language, with a final function evaluating to "how much will this cost?" or "how long would that take?" In some cases the query is omitted and an assertion is used, such as "This must be complete in two months."
Dan Bryant
@Dan: That's not a programming language at all. It's a set of ranked constraints, often badly expressed and incomplete.
Donal Fellows
+2  A: 

In my opinion there is no really useful advantage in using that kind of "human language", because you still need a syntax and special words. You have to learn both of them, and because that's necessary it would be not much more difficult to learn a "programming language", which gives lots of advantages because it is oriented at the machine's structure and not at the human's way of thinking.

You will need to think the way the machine works if you want to write good programs, and a programming language is definitely more powerful to express that way of thinking than human language.

+11  A: 

The code may look like natural language, but it is really just regular computer code with different keywords. In your example, I want is probably somewhat synonymous with new. It's not like you can use natural language directly and say make me a window instead (and if you could do that, things would get even uglier...).

Lets take a close look at your code and the language implications:

i want window and the window title is Hello World. 

i want is unnecessarily verbose for new, and denotes beginning of the argument list. the <typename> <member_name> is sets instance variable member_name on object being created.

i want button and button caption is Close.
and button name is btn1.

. ends statement. continuation of an argument list can happen in a new statement starting with and. button caption is syntactic sugar for button.caption

btn1 mouse click. instructions are
   you close window
end of instructions

mouse click is a keyword containing a space, should be mouseClick. instructions are defines a lambda (see the is vs. are keyword confusion causing trouble yet?). you close window calls function window.close(). end of instructions is end of a lambda. All of these are far longer than they need to be.

Remember all that? And that's only my guesses at the syntax, many of why are probably wrong. Still seem simple? If so, try writing a larger program without breaking any of those rules.


Try this translation:

var myWindow = new Window( title="Hello World" );
myWindow.addButton( new Button( caption="close", name="btn1" ) );

btn1.onMouseClick = function() {
    myWindows.close();
}

See how each line maps to its counterpart in the previous example, but states the intent for more succinctly? Natural language may be good for execution by humans, but it is terribly difficult to group into a precise specification. :D

CrazyJugglerDrummer
Of course, your translation magically pulled out of the air the fact that the button is supposed to be in the window. Totally unstated (though correct I believe). That's one of the *real* problems with programming in natural languages: there are vast numbers of unstated assumptions which totally change what's supposed to happen. I'll be charitable and call it a “tricky AI challenge”…
Donal Fellows
+4  A: 

Edsger W. Dijkstra, On the foolishness of "natural language programming". I have nothing to add.

kemiisto
+2  A: 

I'll be brave and offer a slightly different opinion here.

I haven't seen anything of this language other than what has been presented in the question, but looking at that I'd have to say it probably is much more readable for a non-programmer. For a programmer on the other hand it won't hurt readability, but it won't help either because we're used to reading code.

On the actual development side of things, I think it would be horrible to have to type so many extra bits especially if you're used to succinct keywords and constructions like us programmers.

But let's imagine a far away future where speech recognition is actually accurate. I think a language like this would be far easier to code by talking to your computer, I'd hate to have to specify every parenthesis and such. Not having to do that would help keep your train of thought.

In conclusion:

  • non-programmer readability: great.
  • programmer readability: no improvement.
  • codability typing: no, just...no.
  • codability speech: probably much easier.
NomeN
+2  A: 
person.eBusiness[text.this.author].like(language.supernova.idea.reverse);
language.English[ambiguous[very]];
person.eBusiness.suggest(create(language.Codetalk));
language.Codetalk.grammar.inspiration=language.programming.grammar;
language.Codetalk[new,better,ambiguous[not]];
if(person.all.use(language.Codetalk)){
    person.all.understand(person.all.communication);
};
question(language.Codetalk.idea[good]);
eBusiness
person.eBusiness[creativity] = setting.high; ;-)
NomeN
person.NomeN.comment.correct={person.eBusiness[creative[high]];};person.eBusiness[person.nazi[grammar]];
eBusiness
law.Godwin.invoke;
Xorlev
+1  A: 

One problem with these languages is: Say you write significant portions of your app in this language and then need different people to maintain,extend or otherwise change the code.
Who are you going to get to do this ? Nobody off the street is going to know it and others are going to have a steep learning curve.
Let's also assume you have a question on how to accomplish a task the language, where do you turn ?

Romain Hippeau

related questions