Delta_G:
potentiometer1 = create Potentiometer on pin 1
Take this line for instance. How is this any easier than creating a potentiometer class in C++ and putting it in a library for the noobs so they can write.
Potentiometer myPot(1); // creates a pot on pin 1
and later
int val = myPot.read();
The point of this is not just a different syntax, but different approach to the whole program structure.
Everything follows a strict convention and a lot of the stuff comes 'out of the box'
Timing is handled for you, so you don't need to worry about delay() halting your program flow.
You would loose some flexibility, but I think many things can be taken out if the language is aimed at beginners (pointer arithmetic for example)
Here is how I see it working:
device is the main entity in the language (think Class)
Every device follows this structure:
[i]device[/i] [b][color=green]DeviceName[/color][/b] ( [i]constructor parameters[/i] ) {
[color=#5f3e31]write:[/color] pin1, pin2, pin3 [color=gray]// pins that the device can write to[/color]
[color=#5f3e31]read:[/color] pin1, pin2, pin3 [color=gray]// pins that the device can read from[/color]
[color=gray]// Here go predefined blocks that are built into the class[/color]
[color=#5f3e31]init[/color] { ... } [color=gray]// basically constructor[/color]
[color=#5f3e31]actions[/color] { ... } [color=gray]// all object 'methods'[/color]
[color=#5f3e31]always[/color] { ... } [color=gray]// this code is executed all the time[/color]
....
[color=gray]// then goes a list of all 'events' - code that executes when a condition is satisfied[/color]
[color=gray]// they all start with keyword 'when'[/color]
[b]when[/b] pin1 [b]is[/b] HIGH { ... }
[b]when[/b] pin2 [b]is <[/b] 512 [b]and[/b] pin3 > 128 { ... }
[b]when[/b] pin4 [b]is[/b] RISING { ... }
...
}
So there isn't much code apart from within the devices. (There can be other entities though, like timers for example, with their own set of "actions" and "events")
There would be a small runtime that would take care of timing and executing events.
PS I do appreciate any criticism though, as it is entirely possible that I am missing some huge flaws in this.