Go Down

Topic: A new programming Language. (Read 8482 times) previous topic - next topic

cjdelphi

After thinking, and thinking.... if I look at all the languages out there, Pascal, C, C++, Python, PHP... etc etc, long long list....

They all have one thing in common, we all have to take the time out to learn the language, how it works, so that got me thinking, could there be a "language" out there that makes it possible for everyone to write programs to some degree.

So, my rules for this new programming language...

1. English is a must.
2. Every line of code has to end with  ;

Here's some sample code for my none existent compiler...

Code: [Select]

Clear Screen;
Display Mouse Position;
count from 1 to 10
  display count bottom left of screen;



Obviously there would be some huge hurdles, but a language you can just dictate too... and it just "does it" maybe this has been suggested before.....

keeper63

Hmm...re-inventing COBOL, I see...
I will not respond to Arduino help PM's from random forum users; if you have such a question, start a new topic thread.

cjdelphi

Well, not really, because you could equally...

Code: [Select]

myroutine:
{
make a username box;
make a password box;
request username;
request password;
if username is blank
  alert the user there is a problem with username
  leave;
if password is blank
    alert the user there is a problem with password
    leave;
}

main()
{
make an edit box;
create an edit box;
display time top right corner;
popup a box in the middle of the screen asking for confirmation;
when user agrees call myroutine;
ask the user if he or she wishes to exit the program?;

if the user says no
     repeat main(); //how annoying this program would be!
}


The compiler being smart enough to understand what you're asking (with the many variations of english is hard...) will be the difficult part :)


nickgammon

Agreed. Cobol. Except for the semicolon requirement.

"Sentences" in Cobol ended with a period (like this one).

Quote
we all have to take the time out to learn the language, how it works, so that got me thinking, could there be a "language" out there that makes it possible for everyone to write programs to some degree.


That was the philosophy behind Cobol. It was intended for "anyone" to be able to write in it, and even for management to be able to pick up a Cobol program and see if it worked the way it should.

I'll let you guess whether it actually met this design intention.
Please post technical questions on the forum, not by personal message. Thanks!

More info: http://www.gammon.com.au/electronics

JChristensen

For some reason this brought to mind the following passage from the preface of The Art of Computer Programming, Vol. 1.

Quote
There is no reason why a student should be afraid of learning the characteristics of more than one computer; indeed, he may expect to meet many different machine languages in the course of his life, and once one machine language has been mastered, others are easily assimilated.

-- Donald E. Knuth, 1967


And from section 1.3,

Quote
There should be no hesitation about learning a new machine language; indeed, the author has found it not uncommon to be writing programs in a half dozen different machine languages during the same week!

cjdelphi

In this past week alone... Delphi, Arduino, Java, PHP.

It's hard not to slip up and start typing in a different language every now and then....

AWOL

Quote
2. Every line of code has to end with  ;
Code: [Select]
count from 1 to 10
Oh dear. Fallen at the first.

nickgammon

Lol.

How do you handle conditions? eg.

Code: [Select]

if it is raining;
take an umbrella;
take your lunch;


Are you going to take your lunch if it isn't raining? Cobol handled that with the period.


Code: [Select]

IF IS-RAINING
 PERFORM TAKE-UMBRELLA.
PERFORM TAKE-LUNCH.


The period on the second line terminated the "if". Mind you, the whole sense of a program could change by leaving out one tiny little dot.
Please post technical questions on the forum, not by personal message. Thanks!

More info: http://www.gammon.com.au/electronics

nickgammon

Try explaining that to Management!
Please post technical questions on the forum, not by personal message. Thanks!

More info: http://www.gammon.com.au/electronics

cjdelphi


Quote
2. Every line of code has to end with  ;
Code: [Select]
count from 1 to 10
Oh dear. Fallen at the first.


it's not the end of the statement...

the line with ; is the end of the statement (consider it a nested for loop)

cjdelphi

eg

Code: [Select]

  if thevalue is equal to 12
      display message happy birthday, you're 12!!!!;
  if thevalue equals 11
      display message you're getting on a bit aint ya matey?
      popup messagebox asking if he needs help operating the program;
   ------------------------
    count from 1 to 5
     count from 1 to 2
       display first value
       display second value
        newnewvalue equals first value multiplied by  second value
       if newvalue is 32
         display message value 32!
        otherwise
          display message it's not value 32 at all!;
------------------
       

consider that block finished when it hits the ;
//; = signifiying end of nested statement

AWOL

Quote
2. Every line of code has to end with  ;
(my emphasis)
Quote
it's not the end of the statement...

cjdelphi

there has to be some form of logical control :)

AWOL

I think you're looking for PL/1, the nightmare marriage of COBOL and Algol.

Quote
there has to be some form of logical control

I eagerly anticipate its arrival.

JChristensen


I think you're looking for PL/1, the nightmare marriage of COBOL and Algol.


Or maybe LOLCODE, although it may not satisfy the first rule.

Go Up