
Why isn't there a general purpose visual programming language? - AlfredTwo
http://blogs.msdn.com/b/alfredth/archive/2010/07/07/visual-programming-languages.aspx
======
mechanical_fish
Because they're awful?

The author doesn't mention LabVIEW, perhaps because he is not a scientist.
LabVIEW is a visual programming language -- you construct software by
connecting little icons together with wires.

LabVIEW has been around for decades and is a big success. Lots of science labs
use LabVIEW, because (a) it's a National Instruments product and interfaces
perfectly with National Instruments interface cards -- which have been the
industry leaders for years; (b) it has drivers for every instrument ever; (c)
the visual paradigm does work great for GUI design and layout. (Which
shouldn't surprise anyone who has used XCode or Visual Studio.) Scientists
love the ability to throw together a chart recorder application in ten
minutes, and then wire it up to everything else in the lab, and LabVIEW works
great for that particular use case.

Unfortunately, as you go beyond the most basic of computations or out of the
environment's sweet spot -- in other words, as you try to use it as a general-
purpose programming language -- LabVIEW just gets more and more painful. It
has its own special vocabulary, semantics, and design patterns that are unlike
everything else you've seen. Every time you want to define a subroutine you
need to create a little icon for it, and define its arguments in terms of
little panes on the icon. That's slow and painful and limiting; it makes
writing Java in Notepad feel like luxury. But you have to stay disciplined and
keep defining those subroutines, or your code will _literally_ turn into
spaghetti. Oh, the horrors I have seen. It's particularly awful if the code
sprawls over more than one screen.

You can't effectively print out the code. It's hard to blog and hard to quote
snippets from. To refactor you have to manually rearrange icons; there's a lot
of time wasted laying things out. There's no way to use version control or
create a patch. There's no search-and-replace.

Think of emacs. Now think of Notepad. Now think of something that is less
useful than Notepad, to the same degree that Notepad is less useful than
emacs. That's a visual programming language.

~~~
pcarmichael
(Disclaimer: I work on LabVIEW.) For refactoring and layout, there is a
diagram cleanup tool that will automatically re-layout your diagram for you
with just a button press. It does a pretty good job IMO, and really changes
the way you code. Also, version control _is_ supported, and allows for
graphical diff and merge. While there is no search-and-replace, there is a
search function. (Search/replace has quite a different meaning when you're
dealing with graphs rather than text.)

~~~
mechanical_fish
Ah, I forgot to mention another of LabVIEW's good features: The company has
been improving it steadily for decades. ;)

Diagram cleanup tool sounds interesting. I'm old enough to remember the
earliest version of LabVIEW, which as I recall forced you to rewire every
connection to something whenever you moved it. Now _that_ was torture. When I
went back a few years later and found that wires would automatically follow
you around it felt like Christmas. Perhaps the cleanup tool is an equally big
win.

Version control and diffs sure would have been handy when trying to clean up
some of the terrifying things I inherited back in the day.

------
jerf
You always see the same basic demo when people show visual languages. Here is
your homework. Pull up the source code to the program you most like to use.
Take an average-sized function in it. Break it up into a Lisp-like syntax
tree. If you have fewer than about a hundred nodes, you are probably cheating;
get a bigger function. (The purpose of my asking you to get an average sized
function is not to minimize the problems, it is so you can actually complete
this task.) Draw this tree on a piece of paper using any visual syntax you
like.

If you've still managed to dodge enlightenment, repeat one layer down on all
functions your function calls. If you happen to ascribe to the "one method =
one line" school of OO design, then this is mandatory, and you have to
complete the transitive closure of your call graph. Complexity can not be
removed, only moved around. If it took you less than five minutes, you are now
assigned to take the largest function in the source code.

You will attain enlightenment.

If you still don't believe me, grab a literal pen and a literal piece of paper
and literally, in real life, conduct this exercise until you do believe me.
The human mind is quite skilled in handwaving to itself; the paper will not
permit that.

------
neilk
The idea of visual programming is that we'll make the syntax easier for people
by using colors and shapes and connecting things together in 2D.

To me that seems misguided. When it comes to parsing a stream of text into
concepts, humans have hardware acceleration. You're doing it right now,
effortlessly.

Visual formatting cues can help, but only at a pretty crude level, compared to
our sophisticated understanding of language and grammar.

Furthermore programming requires that you extend the notation every time you
use it. This implies that programming can _only_ be represented well with
combinations of symbols, of which the example par excellence is text.

------
Jun8
What would be the point of this? Sure, you can come up with a more general
purpose visual esolang
(<http://en.wikipedia.org/wiki/Esoteric_programming_language>) but how would
this match the efficiency of programming in, say, C? This would be meaningful
only when the visual element adds some value.

One such place I can think of would be a video/image query language, e.g. for
querying Flickr, that allows users to create complicated queries from image
primitives.

~~~
andrewtj
_What would be the point of this?_

I think many seasoned programmers forget that for the non-programmer, syntax
is a sizeable impediment to getting a working program and so I'd imagine
removing syntax as a source of errors would open up programming to more
people.

 _Sure, you can come up with a more general purpose visual esolang
(<http://en.wikipedia.org/wiki/Esoteric_programming_language>) but how would
this match the efficiency of programming in, say, C?_

I don't think this comparison makes sense — how can you compare the efficiency
of a programming environment to that of a programming language?

~~~
barrkel
Many non-programmers get around this by relying on learning by example, most
notably by copy-and-paste code, with minor adjustments of the parameters, in a
kind of cargo cult style. But even this is more awkward with visual languages;
it's far harder to e.g. do web searches, ask for help on forums, etc.

~~~
andrewtj
I don't think visual necessarily implies non-textual. I remember once seeing
an old terminal app used by an airline that would allow you to escape the
bounds of the input area if you used the arrow keys. You could literally type
anywhere on the terminal which as you'd expect, effectively trashed the
session till it was reset.

The analogy I'd draw is that programming in most editors is like that terminal
app, you can do anything even if it's totally illogical and breaks horribly.
When I read the question posed at the end of the article, the image that came
to mind wasn't a pointy-clicky diagram monstrosity but more of an Intellisense
with a tight input guard and strong visual delineation of blocks; a Python
with even tighter structural rules rather than a UML on steroids.

------
dirtyaura
I have said this argument in HN before, but let me repeat.

There's strong evidence that evolution of human language and ability to think
with abstract concepts are related. Programming is all about abstractions. It
might be even harmful to move to mainly visual programming paradigm.

Visualization certainly help in certain subdomains, for example state
machines, but, as said, there might be even biological bias in favor for text-
based programming languages.

------
gmlk
So SmallTalk and Self are not visual enough?

<http://www.smalltalk.org/> also <http://www.squeak.org/>
<http://selflanguage.org/>

------
noahlt
I am convinced that this is because the primary input method for PCs is the
keyboard, so user input is primarily text. Perhaps a visual programming
language will emerge on the iPad, or some other platform where primary user
input is graphical rather than textual.

~~~
Qz
Primary input for _coding_ on PCs may be the keyboard. Doesn't need to stay
that way.

------
scottw
For the same reason we still use text to communicate: iconography is
insufficiently rich to express the degree of complexity required to abstract,
describe, and solve hard problems.

------
johngunderman
Visual programming languages are great as a teaching tool, but I fail to see
how they would be useful as a general purpose programming language. There is
no need to be filled.

~~~
silentOpen
I believe that a visual programming environment or state visualizer for
concurrency will be essential for a next generation programming language. The
need to be filled is the need for representing many dimensions of computation
simultaneously. It's 2020 and you've just written a program to run on 1024
machines with 1024 cores each. How do you reason about that?

~~~
barrkel
How do you visualize a subspace delimited as segments in 1024 axes?
Visualization doesn't scale in this way. You need to focus on the small, and
have strong and reliable guarantees about those fundamental particles;
combined with a safe and reliable way to compose those particles, and
combinations, and so forth. You need proofs, and easy ways of asserting that
certain properties are true, with help from the machine such that it can tell
you - for certain - whether your assertion is true or not for all possible
numbers of threads.

Now dataflow programming languages, which are often visual, are naturally
parallelizable in the same way functional languages are, but this is not
related to their visual implementation.

~~~
silentOpen
You certainly don't make each processor or core a dimension if that is what
you are suggesting.

The small is type systemic. Machine proofs show that you have written your
typable logic correctly.

This is still not at the level of concurrency or machine assistance to which I
am referring.

You are getting closer with dataflow programming languages. Pipeline and
compute farm visualization, spatial/resource quota policies and control, and
process calculi equivalences proven across visual/spatial refactorings is what
is needed.

Of course you can do all of this with a linear byte array. Of course you can
get more dimensions with names and references.

Unfortunately, these methods are very specific and very technical and, despite
their accuracy, are relatively devoid of meaning at-a-glance. In the future, a
domain expert will work with a programmer to build an application which the
domain expert will then operate and monitor. This is not possible without
heavy use of graphical interfaces and visual representations. This is not
possible without an advanced type system and an easily constructible syntax
for DSLs and DSL graphical front-ends.

Perhaps you wouldn't classify this as a "visual programming language" as most
of the programming itself is not done via virtual objects and connections.
However, visual system tools will become increasingly important as programming
moves from implementation to specification and control.

~~~
barrkel
> _In the future, a domain expert will work with a programmer to build an
> application which the domain expert will then operate and monitor_

This has been in the future for at least 30 years, by my knowledge of the
literature. In fact, it's been in the future for so long by now that it seems
to be in the past, by my reckoning.

------
metamemetics
VVVV is probably the closest you'll get:

<http://vvvv.org/tiki-index.php?page=Tutorial+Hello+World>

~~~
dzuc
Also interesting in this space (audio/visual/performance) is Pure Data:
<http://puredata.info/>

------
mishkinf
java studio for sun tried to do this but sun was a failure of a company and
didnt succeed in staying in alive.

i have dabbled in creating a visual programming language for c#. i have a lot
of code written. contact me. <http://www.thedirtydeveloper.com>

------
d0m
Let's one statement = a 100x100 images..

Now, imagine 1 million line of code.

~~~
nooneelse
That mapping seems to undervalue the expressive power of pictures, which is
commonly taken to be: 1 picture = 1000 words.

