I wonder if you could use annotations to manage the visuals e.g http://drakon-editor.sourceforge.net/folder-night.png
You'd have an inline annotation to separate the code blocks and generate the visuals so you don't have to maintain/update two places.
Any tool that does that?
Flow charts get confusing after some complexity. Useless if you want to represent multiple actors + messages. Systems/sub-systems view.
There is a tendency to think of visual programming as an all or nothing. Either we have all text or all visual. As long as it is "Write once, update everywhere", visual tools can be useful in navigating new code bases, obtaining insights and quickly understanding a piece of code.
The problem though is they often require maitenance and get out of date with reality (even if it is comments/annotations)
sudo port install tk
cd ~/Downloads/drakon_editor1.27
tclsh8.6 drakon_editor.tcl
And it works!!!
Interesting idea for making the structure visible and presumably, helping find corner cases that are not handled. You could presumably build a library using Drakon, and then build an app using the library so that the detail of the code in the library is hidden behind simple function calls.
This reminds me of the proliferation of graphical workflow systems such as BPMN and this nifty Data Mining app called Orange3 http://orange.biolab.si/orange3/
I think we may finally be figuring out how to apply a visual paradigm to coding in a way that works for real production apps.
I've found the Khan academy way to be very efficient for 9-years olds. The main problem with textual languages is that kids mess up with the syntax easily but once they "get it", it's a bliss.
Can the tool generate a diagram from existing source code? Obviously it would likely require additional input for internal 'headings'. And can the diagrams be automatically 'collapsed' into simpler flow charts?
I have two thoughts around this:
1) A lot of 'simple' source code would generate large, complex diagrams - which are likely not very readable, and brings up the same old decries against visual programming.
2) maybe striving for code that works well when converted to a visual language is a good check for code quality.
Pretty cool, but one nitpick: when you save as SVG it embeds the font as a base64 encoded url(). Neat trick, but it bloats the file a lot. A simple chart with a few elements ends up being 250kB. Hand-written SVG would be two orders-of-magnitude less than that.
Humm, this looks and awful like flow charts? What am I missing (apart from the 'Insertion' of macro charts)? All the rules about not 'breaking' visual cohesiveness seem like a plus, although not groundbreaking either. Don't want to sound negative, maybe someone can correct me?
It is a formal specification for a specific kind of flow charts, yes. The specifics of the implementation, the history, and the tooling around it are what's interesting.
Your comment is a bit analogous to someone commenting "Humm, this looks an awful lot like programming?" on a link documenting a forgotten programming language. Well yes, it's true, but it's a tautological statement.
Ah, so this is interesting from a historic perspective. I thought this was being released as a formal method that brought some innovation, as mentionned earlier I had no idea or context other than the slide I went through posted in the link.
I'm really confused as to what exactly this is, but it looks cool. It seems to be some kind of visual programming environment, which I'm usually against on principle (BOO non-standard binary formats! ASCII text is the closest we can get to future-proof, and thus what we should be storing our source code! Down with journald! you should know the drill by now...) But interesting ideas are always interesting, so I'm willing to look into it, even if I don't like the look of it.
I don't understand your ideological point. The editable representation has no bearing whatsoever on the storage representation of a program. There is nothing preventing you from having a visual programming environment where everything is just ASCII text under the hood.
In theory it would be possible to have a visual programming language that had a readable stored representation with meaningful diff/merge/blame. But in practice I've never seen one.
DRAKON represents programs as flowcharts, and there's no reason why the underlying representation couldn't just be C, Python, or some other imperative language, and there's no reason why C or Python originally written in vi couldn't be represented in DRAKON.
I'm not a fan of flowcharts but DRAKON is of historical significance. The same would apply to GRAIL.
Other imperative visual programming languages such as Scratch could also be stored in a form resembling a textual imperative language. In other words, the visual element is largely "syntactic sugar".
Dataflow programs can also be stored as text rather than binary, but due to the nature of dataflow, this would be inconvenient to program directly in. This is because dataflow programs are graphs with only a partial order rather than ordered lists like programs in C or Lisp. This means that visual dataflow languages, such as LabVIEW and my own Full Metal Jacket (http://web.onetel.com/~hibou/fmj/FMJ.html) aren't simply syntactic sugar.
There are textual dataflow languages such as SISAL, but these require a compilation step before code is actually dataflow.
You should not be surprised to find that version control systems designed for text in which lines of code are executed sequentially by default is less useful for stored visual dataflow programs. You could still use diff/merge on the stored representation at the function level, but not easily at the line level, because the visual representation doesn't have lines of text and the order might change arbitrarily from version to version.
This is why visual dataflow programs need a visual equivalent of diff/merge, e.g. clicking on arrows to show the order in which changes were made to the graph instead of diff. Work is being done on this, e.g. Austin Henley's Yestercode (for LabVIEW), reviewed here: http://www.felienne.com/archives/5210
How does a visual programming environment prevent an ASCII text representation? Counter example: Data flow programming, or even SVG diagrams. I can't think of an exact analog, but I'd be willing to bet there is a textual VPL out there. Sure you need a tool to support conversion to a GUI, it's a different way to think!
The ResolverOne spreadsheet was a normal spreadsheet program that wrote Python code under the hood. You could then add unit tests and validate your spreadsheet calculations. The company was sold but this web version https://github.com/pythonanywhere/dirigible-spreadsheet remains and is open sourced.
I also remember a project management tool that similarly wrote Python code under the hood. And then there is the Talend Data Integration toolkit which writes and compiles Java under the hood. There is a lot of this stuff kicking around these days if you care to hunt for it.
However I think that workflow systems like Apache Taverna and jBPMN are more useful. You still write chunks of code but the framework glues it all together in a flexible manageable way instead of creating a Big Ball of Mud.
Compared to UML Activity Diagrams, DRAKON-Foo (where Foo can be Python, C, C++, Erlang, or any of a bunch of others):
(1) Is constrained in a way designed to enhance understanding of the visual flow, and
(2) Directly includes code (in language Foo) in the boxes, rather than text; that is, its a programming environment, not a diagramming language with text that gets converted to program code somewhere else that is maintained separately.
The first item is also a feature of DRAKON by itself.
About (2): there is a standard action language for UML which can be used to fully describe your algorithm, independently of any language. In that sense, the DRAKON approach seems more practical for software engineers / programmers while the UML approach seems better for the domain experts.
there should be a common interface to languages that have the same design patterns, why can't a class just be a visual representation of something that contains code, and do the same thing with methods and functions. then inside of visual blocks of code you can then keep the programming languages as simple as possible.
I wonder if you could use annotations to manage the visuals e.g http://drakon-editor.sourceforge.net/folder-night.png You'd have an inline annotation to separate the code blocks and generate the visuals so you don't have to maintain/update two places. Any tool that does that?
Also, integrating different level of complexity using system 1,2,3 (from https://www.amazon.ca/Software-Requirements-3rd-Karl-Wiegers...) to represent user flow diagram in addition to flow charts.
Flow charts get confusing after some complexity. Useless if you want to represent multiple actors + messages. Systems/sub-systems view.
There is a tendency to think of visual programming as an all or nothing. Either we have all text or all visual. As long as it is "Write once, update everywhere", visual tools can be useful in navigating new code bases, obtaining insights and quickly understanding a piece of code.
The problem though is they often require maitenance and get out of date with reality (even if it is comments/annotations)