Thinking of creating a natural looking programming language

Started by
21 comments, last by ToohrVyk 16 years, 4 months ago
Shakespeare is fun but useless :). Since it's esoteric it isn't very good example thought. It just gives you idea of how code could look. You would see a big pile of text and it would take a long time and effort to find something. In C for example you can tell where's a loop were are calcualtions or declarations in a second. In your language we would have to read the whole "code" first. Waste of time if you ask me.
Advertisement
The problem with construction of natural languages isn't verbosity or friendliness.

It's context dependence and ambiguity. Human languages have both, and rely on them. Computer languages cannot have either.

Programming is not about syntax. There's too many guru and pro programmers which have learned all C++ in 2 weeks.
There already is a natural programming language. I don't see any reason why you should duplicate effort.
Quote:
Create a variable called password.
Output the text "Please enter the password:" and a newline.
Accept input from the user and store it in the variable password.

While the variable password is not equal to the text "admin123" then do the following:
Output the text "Access denied. Please enter the password:" and a newline.
Accept input from the user and store it in the variable password.
Then end the loop.

Output the text "Access granted. Welcome".


That's just too low level. You're using whole sentences to create something as trivial as a variable, or set values to it. Who would want that? What's the use of something like that? It's just as low-level as any other programming language, except it uses more words. Now, if you could do something like...

Password is "admin123"
Get the password from the user, and output "Acess denied" if failed, otherwise proceed and output "Access granted".

That would be of some use. But I don't know if it's feasible.
It might be more practical to build an interface that accepts more abstract, syntactical criteria and outputs text that a non-programmer will find easier to understand.

This concept reminds me of "pre-compiled" scripting languages that have a fixed number of statements, and you select which statement you from a list, generally in the form of buttons. I could click the "Create Variable" button and specify a name: "var", and the output would look like, "Create a variable named var." So I wouldn't be responsible for writing the actual code, nor would your software be responsible for parsing its own English (or Spanish, or whatever other languages you want to support). Code would be stored as statement indices and identifier names, but to the end-user it would look like structured phrases.

Of course, you could build a front-end to do this for just about any existing language, though it would of course limit the user's flexibility with using the language, but that seems to be your intent: to make programming easier, not more powerful. And I don't disagree. There are plenty of tools to make software engineering easier; this is simply another approach.

GDNet+. It's only $5 a month. You know you want it.

I applaud the effort in thinking about how to make things better as I believe that is the most noble motivation that a programmer could have. However, you are likely spending your efforts in the wrong direction here.

Perhaps it would be good for you to explore more of the languages that are available. Which ones have you already tried? How long have you worked with them?
Programming since 1995.
Well, I created a basic version of MICE. A few things don't work and this is pretty buggy (such as you can't use keywords even in a string). However, you can do things such as looping, conditionals, output text, etc. The source is only like 35 lines, all I did was convert the MICE code into Perl and eval() it. I just learned Perl today so give me a break :p

http://helnet.org/mice/MICE.zip - MICE .zip
Usage: mice.pl src.ext

You must have Perl to use this obviously. Here is an example that will work in the interpreter:


Output the text "Please enter the password: " and a newline.
Accept input from the user and store it in the variable password.

While the variable password is not equal to the text "admin123", then do the following:
Output the text "Password incorrect, try again: " and a newline.
Accept input from the user and store it in the variable password.
Then end the block.

Output the text "\n\nAccess granted, welcome!".


There is a documentation file in the zip, but note that not everything in it works yet.

[Edited by - SpamBurger on December 1, 2007 6:52:31 PM]
Quote:Original post by SpamBurger
I was thinking of creating a programming language that looks a lot like English, making it easy to learn. Good or bad idea?


The last time someone had this idea, and was given encouragement and the means to act on it and popularize the result, that result was COBOL.

[EDIT: Thanks for the other examples, guys. Actually, COBOL was probably the first time this happened, if anything :)]

... I'll let you decide for yourself.
Quote:Original post by Zahlman
The last time someone had this idea, and was given encouragement and the means to act on it and popularize the result, that result was COBOL.

[EDIT: Thanks for the other examples, guys. Actually, COBOL was probably the first time this happened, if anything :)]


The last time this happened that comes to mind was with Speedo's En.

Well, okay, I guess we didn't really encourage him.

In fact he kind of got banned not just from Wikipedia for sockpuppetry (IIRC), but from the gamedev IRC channel as well for repeatedly spamming his half baked language implementation on everyone, including utter novices who wouldn't be in a position to know any better than to avoid starting on a language that's mostly the efforts of one ranting loon. After being asked by the operators to stop such behavior. Repeatedly.

He also seemed to be immune from the suggestion that his language could have any flaws whatsoever.

As for natural looking languages, well, there's a time and place for them, but as a simple counterexample, I'd simply put forth the question: Which is easier to answer:

Solve for y:
4x - 3y + 5 = 2(3x2 + y)

Or:

Solve for y: The equation, 4x minus 3y plus 5 equals 2 times the sum of 3 times x squared and y.

Mathematical notation is an example of creating a non-English language for the express purpose of more easily manipulating and dealing with a specific concept. It follows, then, that programming, especially given it's ties to mathematics, could also easily benefit from such specialization, both for clarity and expressiveness.
I've written a concise program in your language, please compile it and let me know how it runs:

"Make cool game like Crysis only better and with bigger more realistic explosions and graphics. Start game."

This topic is closed to new replies.

Advertisement