Arduino Forum

Community => Bar Sport => Topic started by: cjdelphi on Jul 09, 2013, 04:25 am

Title: A new programming Language.
Post by: cjdelphi on Jul 09, 2013, 04:25 am
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.....
Title: Re: A new programming Language.
Post by: keeper63 on Jul 09, 2013, 04:49 am
Hmm...re-inventing COBOL, I see...
Title: Re: A new programming Language.
Post by: cjdelphi on Jul 09, 2013, 04:59 am
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 :)

Title: Re: A new programming Language.
Post by: nickgammon on Jul 09, 2013, 05:01 am
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.
Title: Re: A new programming Language.
Post by: JChristensen on Jul 09, 2013, 05:18 am
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!
Title: Re: A new programming Language.
Post by: cjdelphi on Jul 09, 2013, 05:23 am
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....
Title: Re: A new programming Language.
Post by: AWOL on Jul 09, 2013, 08:47 am
Quote
2. Every line of code has to end with  ;
Code: [Select]
count from 1 to 10
Oh dear. Fallen at the first.
Title: Re: A new programming Language.
Post by: nickgammon on Jul 09, 2013, 09:34 am
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.
Title: Re: A new programming Language.
Post by: nickgammon on Jul 09, 2013, 09:35 am
Try explaining that to Management!
Title: Re: A new programming Language.
Post by: cjdelphi on Jul 09, 2013, 09:53 am

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)
Title: Re: A new programming Language.
Post by: cjdelphi on Jul 09, 2013, 10:02 am
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
Title: Re: A new programming Language.
Post by: AWOL on Jul 09, 2013, 10:03 am
Quote
2. Every line of code has to end with  ;
(my emphasis)
Quote
it's not the end of the statement...
Title: Re: A new programming Language.
Post by: cjdelphi on Jul 09, 2013, 10:16 am
there has to be some form of logical control :)
Title: Re: A new programming Language.
Post by: AWOL on Jul 09, 2013, 10:20 am
I think you're looking for PL/1 (http://en.wikipedia.org/wiki/PL/I), the nightmare marriage of COBOL and Algol.

Quote
there has to be some form of logical control

I eagerly anticipate its arrival.
Title: Re: A new programming Language.
Post by: JChristensen on Jul 09, 2013, 01:39 pm

I think you're looking for PL/1 (http://en.wikipedia.org/wiki/PL/I), the nightmare marriage of COBOL and Algol.


Or maybe LOLCODE (http://en.wikipedia.org/wiki/Lolcode), although it may not satisfy the first rule.
Title: Re: A new programming Language.
Post by: aarondc on Jul 09, 2013, 01:47 pm
Languages are for the weak.
Real developers code in binary.
PETAQ!


Or something.
Title: Re: A new programming Language.
Post by: cjdelphi on Jul 09, 2013, 01:53 pm
real coders use transistors...
Title: Re: A new programming Language.
Post by: AWOL on Jul 09, 2013, 01:59 pm
"My favorite programming language is solder" - Steve Ciarcia
Title: Re: A new programming Language.
Post by: aarondc on Jul 09, 2013, 02:07 pm

real coders use transistors...


Real coders use hardware?

Does not compute!

Dephi FTW!
Title: Re: A new programming Language.
Post by: AlxDroidDev on Jul 09, 2013, 02:29 pm
This made me remind of the fictional, humorous C+- (C More or Less) (http://baetzler.de/humor/c_more_or_less.html)  language that appeared on UseNet a few decades ago.


I can't find the full complete text of the C+- joke in the web (I have it at home), but the above is complete enough.  The complete "reference to C+-"  includes keywords such as EvenIf
Title: Re: A new programming Language.
Post by: aarondc on Jul 09, 2013, 02:42 pm
If you're taking requests, can the new language have a [maybe] operator, allowing us to implement true fuzzy logic?? :D
Title: Re: A new programming Language.
Post by: cjdelphi on Jul 09, 2013, 05:12 pm
it's called "ROM"
Title: Re: A new programming Language.
Post by: eddiea6987 on Jul 09, 2013, 06:34 pm
I remember Borland Delphi , almost identical to Visual Basic
that was pretty easy to learn and start making windows applications.


Do you think that exposure to BASIC can mutilate your mind? haha
Title: Re: A new programming Language.
Post by: AlxDroidDev on Jul 09, 2013, 07:12 pm

I remember Borland Delphi , almost identical to Visual Basic
that was pretty easy to learn and start making windows applications.


Do you think that exposure to BASIC can mutilate your mind? haha


Delphi is pretty easy to learn,and extremely powerful. I started with Delphi with version 1.0, I guess around 1995. When Delphi 4 came out, I got certified from Borland and I've been making my living with Delphi since then.

I went through all the changes Borland had, the first being renamed to Inprise and nowadays it is called Embarcadero, with is a pretty idiotic name.

I really, REALLY love Delphi.
Title: Re: A new programming Language.
Post by: GoForSmoke on Jul 09, 2013, 07:42 pm

I remember Borland Delphi , almost identical to Visual Basic
that was pretty easy to learn and start making windows applications.


Do you think that exposure to BASIC can mutilate your mind? haha


No more than equal time spent in manacles and chains with dirty, scratched goggles on.
Title: Re: A new programming Language.
Post by: bengtb on Jul 09, 2013, 08:04 pm
This proposed language reminds me of Hypercard and its language HyperTalk. It was quite popular at the time.  I used it a lot. Not because I didn't known any other programming language, but because it was easy to accomplish things quickly.  Mind you, this was before the web.  Guess this dates me :-)
Title: Re: A new programming Language.
Post by: GoForSmoke on Jul 09, 2013, 08:09 pm
I remember seeing the term hypertalk. What did it run on?
Title: Re: A new programming Language.
Post by: robtillaart on Jul 09, 2013, 08:53 pm
Quote
I remember seeing the term hypertalk. What did it run on?

the Macintosh II  and the Apple Lisa IIRC
Title: Re: A new programming Language.
Post by: robtillaart on Jul 09, 2013, 09:06 pm
For me the real difference is between language paradigms, to name a few

- assembly versus high level  (portability)
- Object Oriented languages vs function oriented languages  (abstraction)
- declarative languages like SQL  (select * from languages where type is declarative) ==> define the WHAT not the HOW
- "rule based languages" like LISP and PROLOG which need an other mindset
- interpreted versus compiled  (especially an SQL interpreter which optimizes its strategy runtime is fun)
- byte code languages  (Java .NET) - I like the concept of virtualization
Title: Re: A new programming Language.
Post by: westfw on Jul 10, 2013, 12:05 am
Quote
could there be a "language" out there that makes it possible for everyone to write programs to some degree.

This has been an explicit goal of many of the languages written over the years.
The big problem is that if you get a mathematician, a statistician, a businessman, an artist, and a child in the same room with a computer, their approaches to solving their respective problems will be so different that the same language would never be "right" for all of them.

You can see some of this in current debates about the scientists that write their own computer models and tools, often with very little education in the principles of "computer science", sometimes leading to programs that are so buggy that any and all results are questionable.  Or in the fact that COBOL was extremely successful AND much hated.
Title: Re: A new programming Language.
Post by: eddiea6987 on Jul 10, 2013, 03:16 am


I remember Borland Delphi , almost identical to Visual Basic
that was pretty easy to learn and start making windows applications.


Do you think that exposure to BASIC can mutilate your mind? haha


No more than equal time spent in manacles and chains with dirty, scratched goggles on.



this got me into looking into the current version and it seems pretty powerful and still a breeze to get the GUI going hassle free, specially for phone applications. hmm i might get a demo now..