Game Development Community

A Literal Programming Language

by Will Harrison · in General Discussion · 03/28/2005 (11:09 am) · 146 replies

I just had this random thought. I'm not much of a programmer, but wouldnt it be easier if there was a programming language that was basically readable English?


For example, instead of this:

if (John.apples = 5 && Sally.oranges < 3) {
Jason.pears == 7;
}


You would write:

If John has 5 apples and Sally has less than 3 oranges then give Jason 7 pears.



Or in this case:

for (count=1; count<11; count++)
{
steeringWheel.rotate();
}


You could write:

Rotate the steering wheel 10 times.


Object names (steeringWheel) would be case-insensitive and could contain spaces (so you could say "Steering wheel" or "steering Wheel" and they would mean the same thing).... and the definite article "the" (e.g. rotate "the" steering wheel) could be be ignored by compiler.
Page«First 2 3 4 5 6 7 8 Next»
#141
04/22/2005 (7:29 pm)
Quote:
Correction for Joe: "The apple is 5 feet up."

Okay, so that was a minor slip-up, sorry.

and this little snippet is why this whole thing is a bad idea.

This whole thing reminds me of when I started using maxscript and they used the actual words 'and' and 'or' for logical operators (instead of && and ||).. drove me nuts when nothing I wrote worked when I executed it.. and then I looked at the syntax error..

I understand what you are getting at, but your posts above lead me to conclude that you get scripting enough to understand what is going on... not to mention, why would I want to type 'greater than' (11 characters) when I can use '>' (1 character) ?

what if I mistype and write greater then?
#142
05/03/2005 (5:49 am)
Macromedia director implements a verbose as well as a dot syntax version of its script. the verbose version is really easy to get to grips with, and is along the lines of "set the member of sprite 10" or something to that effect. not quite the english language but there's only so far you can bring it out of dot syntax before you find yourself writing an essay everytime you need to program something.

although, it would be kind of cool to write a story, copy and paste the text in a game engine, and the game would be made. barring graphics and the like of course :)
#143
05/03/2005 (3:18 pm)
"although, it would be kind of cool to write a story, copy and paste the text in a game engine, and the game would be made. barring graphics and the like of course :)"

I think the same idea could be extended to graphics, where you can describe things/scenes and they would also be created in the engine :)
#144
05/03/2005 (3:47 pm)
Don't know, for me half the fun is the engineering behind the game, and working out how to get the game to do what I want. Not sure I'd find game dev much fun any more if I didn't have problems to solve. And the challenge of trying to get the computer to understand what I want in that way just doesn't interest me really.

As an artist, the making of the game is the most fun game out there. Don't think that would be the case with what your suggesting. Although it may appeal to a writer I suppose.
#145
05/03/2005 (4:36 pm)
A programming language is a system for formally expressing a solution to a problem. Ideally it should be close to the language used to express the problem. Formal languages, unlike natural languages, focus on a specific domain, allowing one to express information succinctly and with minimum ambiguity.

A game-building machine that worked from a story would have to have all kinds of outside information that we take for granted. This is a big reason for why we don't have AI's running around right now. We assimilate huge amounts of background that we use in interpreting natural language.

To get an idea of what's involved, take a look at the Mozilla rendering code, which converts several dialects of HTML and XML to a rendered page. Those dialects, unlike a natural language, are relatively well-defined and constrained, and yet the code to handle them is pretty large.
#146
11/23/2005 (6:25 am)
Chiming in:

It is far easier to make languages like C, which speak very close to what the computer does and is easy for the computer to understand, and rely on the far-superior computer in the human cranium to do the translation, than to try and make a human-like language very close to what the human mind is thinking, and expect the vastly inferior computer to try and do the translation.

Example: Natural-language handwriting recognition in the Newton vs. the "special Palm handwriting code" easy fro the machine to understand, which the human learns and uses.
Page«First 2 3 4 5 6 7 8 Next»