Bulletproof visual programming


The key thing about visual languages is the feedback the computer gives you as you construct your program. A (possibly minimal) display that tells you "this is the widget you want", "these are the parameters to this function", and so on. Maybe this need not be all that visual. Just a compact representation of the facts and confirmations you're most likely to need, and maybe links off into more detailed documentation.

Whether it's done with boxes and lines or text probably isn't all that important. The killer is the rapid feedback, and the computer's (partial) understanding of what you are doing.

Examples include drag and drog GUI builders, pop up function declarations as you type a function name, syntax highlighting, a dialog box for editing a configuration file.

I'm wondering: could we design a programming language that affords visual programming? As with literate programming, functions and classes would have not just code but meta-information about the code. Where a literate program would have text documentation, a visual program would have hints for how to prompt for the parameters functions need and how to lay out sub-components when constructing "has-a" hierarchies.

This language could be programmed as text, visually, or a combination of both. The text of the program would fully define the visual representation, and the visual representation would fully define the text (including display of comments and such).

An example where this would be useful: a sound or image editor. Sometimes you want to write new algorithms, other times you want to tweak parameters. Algorithms are best desribed in text (Lord save us from flow charts), parameters are best tweaked visually. To be able to flip between modes would allow a more useful editor than either mode on its own.

Another example: a shell that flips between command line and an iconic view of the current directory. Select some files -- flip -- type in a complex pipe sequence, but you're not sure of some of the parameters to one of the programs -- flip -- fill in a form that prompts for the available parameters, preview results, execute.