I do remember reading a paper about CAP (Computer Aided Programming)... Where you would build your program from black box units (prewritten code units) which you link together to denote program flow and logic...
I seem to recall the interface being based on flow charts, it seemed like a brilliant idea... I have often thought about writing one for myself, as an excercise to improve my programming skills.
The logic would be qutie simple, you only need 5 base types of unit. A Start unit, A conditional unit, an Aritmetic/Logic operation unit, an I/O unit and an End unit.
Then you would have a palette of premade units each one based on one of the base types... I seem to remember getting stumped trying to decide if each flow should relate to a single variable (my prefered but more complex model) or to a single operation (where the user doesn't really have to think about variables)...
All fun stuff... I'll have to dig out my notes...