
Why Don’t We Have a General-Purpose Tree Editor? - pcmonk
http://pcmonk.wordpress.com/2014/04/01/why-dont-we-have-a-general-purpose-tree-editor/
======
rossng
DOT/GraphViz [1] is very powerful. You might find it a bit unwieldy at first
but, as with everything, editing in plain text is often faster than trying to
use a GUI.

For extremely simple stuff, you can use TGF [2] to represent the graph and
something like yEd [3] to view it.

None of these tools have any real provision for structured proofs etc., but
that could be built.

[1]
[http://www.graphviz.org/Documentation/dotguide.pdf](http://www.graphviz.org/Documentation/dotguide.pdf)

[2] [http://docs.yworks.com/yfiles/doc/developers-
guide/tgf.html](http://docs.yworks.com/yfiles/doc/developers-guide/tgf.html)

[3]
[http://www.yworks.com/en/products_yed_about.html](http://www.yworks.com/en/products_yed_about.html)

~~~
naftaliharris
I've made "proof graphs" with GraphViz, but honestly it was something of a
challenge to make them look how I wanted them to. Compared to the time I spent
drawing the graph on paper, (ie, collecting the statements and theorems),
making the GraphViz version look okay took a long time.

[http://www.naftaliharris.com/blog/mc-
graph/](http://www.naftaliharris.com/blog/mc-graph/)

[http://www.naftaliharris.com/blog/mg-
graph/](http://www.naftaliharris.com/blog/mg-graph/)

~~~
pcmonk
Those graphs are good examples of what I want to be able to make. You bring up
a critically important point, though: I must be able to write graphs very
quickly, easily, and painlessly, like I use vim to write text or Trello for
to-do lists. Most tree-editing interfaces are painfully inefficient and slow
to use (and are far too reliant on the mouse).

~~~
Natsu
Speaking as someone who has used graphvis before, those examples are one
possible mode of output. The input for the graphvis programs are plain text
files. See:

[https://en.wikipedia.org/wiki/DOT_%28graph_description_langu...](https://en.wikipedia.org/wiki/DOT_%28graph_description_language%29)

------
hibikir
We do not have a general purpose tree editor because trees are quite the
complicated structure, and most valuable operations on trees require quite a
bit of knowledge of what the tree represents.

Look at, for instance, source code. In many languages, we represent code in a
tree-like structure, just with text and braces/parenthesis/tabs as
indentations. But we all know that there are major limitations on how to
represent a class. If you have 200 methods in a class, said class is unwieldy.
If your methods are very deep, the whole thing also becomes unwieldy, so we
make them smaller. We'd still do that with huge monitors that could show lots
and lots of code at once: Without abstraction, any nested structure is hard to
manage.

Many text editors will collapse levels for you, but really, how often do you
all use them? Whenever you need to use them, it's a smell, because it means
that the structure is getting too complex for a mind to handle.

This is not an issue that is unique to code. Any tree structure has the same
issue of abstraction: We are not designed to handle more than one layer at a
time, unless we are dealing with a tiny number of nodes. We have trouble
seeing trees and navigating trees, so of course we can't have good general
tree editors. I've seen four attempts at just general tree visualizers at work
in the last year. The most successful barely pay lip service to regular tree
'views', and instead try to answer secondary questions that would help us know
how we want to explore the tree.

And, as others here have already said, there's always non graphical
representations. find, awk and grep can go very far when you are trying to
find things on a tree. Proper indexing does a good job too.

~~~
seanmcdirmid
> Many text editors will collapse levels for you, but really, how often do you
> all use them? Whenever you need to use them, it's a smell, because it means
> that the structure is getting too complex for a mind to handle.

I agree with you on everything except this: code folding is very useful in
creating a high level view of code to reason about. I would argue further for
code bubbles, but they haven't really been done right yet; perhaps we will
eventually see some interesting good solutions in LightTable.

~~~
kristiandupont
Agreed. I frequently mention Code Browser ([http://tibleiz.net/code-
browser/](http://tibleiz.net/code-browser/)) which has multi-level folding
that works very well. When I work solo on a project, I tend to fold many
levels deep and create what would otherwise be a "smell" but it doesn't seem
to cause problems. Unfortunately, I can't use it when working with a team
because I know of literally nobody else who uses the editor.

I've considered writing a plugin for LightTable or perhaps Sublime Text but I
have no experience with either of their API's and I am not sure whether it
would even be possible.

------
teleclimber
In the comments in the article somebody mentioned this:

[http://strlen.com/treesheets/](http://strlen.com/treesheets/)

Looks really cool. I always felt spreadsheets were too grid-oriented and flow
charts too much about vectors and nodes. Treesheets looks like a great mashup
of those two.

~~~
solstice
I agree. It also seems quite suited for keyboard navgation and editing. It has
a linux version and the tutorial is very well made.

------
chavesn
Some others have already mentioned that "mind mapping" software is similar,
and I'd agree -- just see this image[2]. That image was created with
Mindnode[1], which I really like (I've only tried the light version, but that
seems to be discontinued).

[1]:
[https://mindnode.com/assets/images/screens/iphone-1-1136x640...](https://mindnode.com/assets/images/screens/iphone-1-1136x640-withstatusbar.png)

[2]: [https://mindnode.com/](https://mindnode.com/)

~~~
pcmonk
I'd never really seriously considered mind mapping software, and while I still
don't think it's exactly what I want, it actually seems to have more potential
than it seemed. Thanks for the suggestion.

~~~
Retric
For tree data you may want to look into various XML designers / editors. You
can easily define a recursive XSL style sheet that has the structure you want,
after that there are various editors that automatically read that structure
and give you a GUI from it. It's been a few years but I found XMLSpy to be
fairly decent.
[http://www.altova.com/xmlspy.html](http://www.altova.com/xmlspy.html)

Edit: The simplest tree editor is probably the file system on your computer.
However, the problem is for proof's I suspect your going to want to have some
sort of graph structure.

PS: If your willing to do some light coding XQuery/XSL-FO let's you transform
the raw XML into various more user friendly formats like PDF's. However, if
your structure is really nested that quickly get's hard for people to
understand.

------
ttctciyf
Just slightly away from the practical job of finding a usable editor, but I
found the following demo of an in-game node-based tree display/editing
interface from Limit Theory[1] lone developer Josh Parnell quite impressive as
eye candy if nothing else:

    
    
       http://www.youtube.com/watch?v=Ekq56VZqQvs&t=5m25s
    

earlier version:

    
    
       http://www.youtube.com/watch?v=KN3tKT0E0t8&t=14m30s
    

(EDIT: also at:
[http://www.youtube.com/watch?v=KN3tKT0E0t8&t=19m40s](http://www.youtube.com/watch?v=KN3tKT0E0t8&t=19m40s)
as he updates the layout algo in real time (!))

Worth watching as he puts it through its paces.

If I was hiring someone to create a generic tree editor, his number would be
top of my call list :)

[1] [http://ltheory.com/](http://ltheory.com/)

~~~
Udo
Wow, it's not often that I see something that makes me sad I wasn't the one
who implemented it, but damn this is one of those. Beautiful and elegant,
really nice. Thanks for linking to it.

This takes me back to high school when a friend and I goofed around with
spatial navigation through hierarchical structures. Of course that was in the
era of the 486, and we had no idea what we were doing, trying to build
something based on vector graphics with Pascal on DOS... so this was what we
were dreaming of but couldn't make (nor properly articulate).

~~~
ttctciyf
Code envy: yes indeed! :) Apart from the nice graphical touches like animating
the branches and zooming and whatnot, the node-based navigation looks like a
win for dealing with scale issues.

It's also nice that he abstracted the layout so thoroughly that he can not
only create a variety of 2D and 3D views, but also map the underlying data
structure onto actual game elements in the game's main display, as you can see
in one or two of the other demo videos.

------
scelerat
I think there are many of examples out there; the simplistic answer to the OP
question is "we do; you just haven't heard of them."

My favorite is OmniGraffle... you can enter nodes in a text-entry outline
style mode and the results are updated instantly. The default styles and
stencils, while recognizable as being generated by OG, are inoffensive, and
the layout tools are among the best of any layout or presentation software.

Others have mentioned GraphViz, which is a general purpose graph description
utility.

Outliners as a general category of software have existed since the 1980s and
seen an ebb and flow of popularity. Just a few off the time of my head...
Think, More, Acta, OmniOutliner.

The Frontier scripting language in particular stands out as a programming
environment completely integrated into an outliner paradigm. My first exposure
to code folding came when discovering Frontier sometime in the mid-'90s. As
Apple put its Mac scripting focus on Applescript, Userland reimagined Frontier
as a web site programming environment: templating, scripting, and content
management all rolled into one. But at the same time it was a general purpose
scripting environment.

Maybe my graphing needs are not so deep that these tools (or some combination
with a few others) wouldn't suffice for a variety of tree/graph related tasks.

~~~
steveax
Frontier was one of my first experiences with programming and I still have a
soft spot for it. Small nit: Frontier was the environment (object database,
etc.), UserTalk was the scripting language Frontier used.

------
nmrm
The author's examples -- proofs and ASTs -- provide a hint at the reason.

If you need a tree, it's most likely that you want some custom operations on
that tree (e.g. parsing text into the tree, pretty-printing the tree,
traversing the tree in various ways, etc.)

At some point, the tree is just a data structure and what you're interested in
are full-blown, non-trivial algorithms/programs for fairly domain-specific
tasks. In these cases, a library (or even custom implementation) for a general
purpose programming language is more useful than a tool (a la Excel or vim).

Viewed in this light, it's not unsurprising that we have many domain-specific
tools for manipulating trees. Most of the proof assistants have a GUI based on
Gentzen-style sequents.

LaTeX has styles for type setting proofs which look like the ASCII ones in the
article.

Tools for generating parsers often have tree-based UI's.

And so on.

~~~
pcmonk
You're right that most of the time we need non-trivial algorithms or
visualizations for trees for it to be useful. If I ignored that it would be
like wishing for a "general binary editor" because it would be so "powerful"
and all data can be represented as binary.

I think, though, that there's enough common ground between the various domain-
specific tree editors that some kind of useful intersection exists. Then the
domain-specific tree editors would simply be plugins.

~~~
nmrm
Perhaps the "killer app" is an extensible GUI framework with some sensible
defaults already implemented (e.g. those mimicking some of the design
dimensions explored by the software mentioned in other posts), combined with a
scripting language and/or a suite of good libraries/apis for popular
languages.

At any rate, thanks for provoking the discussion.

~~~
pcmonk
Yeah, I guess that's essentially the ideal.

------
Pxtl
Well, if you're okay with XML there's Microsoft's XML Notepad. It's xsd-aware
so you get type-safe constrained tree editing. But it's ms, XML, and
xsd...that's like 3 strikes.

------
trogdoro
I posted this on the blog itself, but re-mentioning it here... I've been
evolving Xiki for over 10 years to do be a language for doing this kind of
thing. The ideas is you can interact with trees and other nested structures
(file paths, dbs, general UI's) from your text editor, using a simple
plaintext representation, but in a GUI-like manner.

I've done talks about Xiki at RubyConf, Strange Loop, and QCon. Here's a quick
3 minute video -
[https://www.youtube.com/watch?v=bUR_eUVcABg](https://www.youtube.com/watch?v=bUR_eUVcABg).
I'm doing a Kickstarter campaign soon, to bring Xiki support to vim, sublime,
and possibly other text editors!

~~~
marknadal
Wow, that video is incredible. I'm definitely going to dive into this, thanks
for sharing.

~~~
trogdoro
Thanks! :)

------
fragsworth
You already have fairly general-purpose tree editing right under your nose -
look at GUIs for your filesystem.

You can drag and drop folders and files. You can see the hierarchy on one side
of your screen, and then the contents of a single node on another.
Minimizing/expanding usually works. You can rename things in-place.

If you're imagining tree structures that don't map really well to this kind of
GUI, then the reason your tree editor doesn't exist should be apparent.

~~~
loqi
Assuming one agrees that filesystems map really well to that kind of GUI in
the first place. It's not obvious to me that they do.

------
eternalban
[http://scripting.com/98/01/stories/frontier5IsAnOutliner.htm...](http://scripting.com/98/01/stories/frontier5IsAnOutliner.html)

~~~
matthewn
Frontier has been reborn. Dave Winer's outline editor is now GPLed and runs in
a browser:
[http://scripting.com/2013/09/16/concordOurGplOutliner](http://scripting.com/2013/09/16/concordOurGplOutliner)

There's a forked version that can save to the local filesystem here:
[https://github.com/interstar/OWL](https://github.com/interstar/OWL)

~~~
oneofthose
I wonder if this good be a Getting things Done tool. You'd probably need
multiple of those trees and a way to put simple, wiki-like multiline articles
(maybe markdown syntax?). I'd use something like that!

~~~
tjr
You can do that with Fargo.io. Concord out of the box appears to just hold a
single outline.

------
mgraczyk
I once wrote an ASCII graph/tree compiler that compiles ASCII representations
like the example in the article into data structures.

[https://github.com/mgraczyk/GraphCompiler](https://github.com/mgraczyk/GraphCompiler)

The data structures can be used directly in Python or parsed/consumed
elsewhere. I think it is pretty useful, and I have used it in a couple of
places where moderately complicated trees are used to generate C/C++ code.

------
oneeyedpigeon
Are you kidding? We have excellent tools to edit and manage trees: touch,
mkdir, cd, mv, ... :)

~~~
gizmo686
Why the joking punctuation? With userspace filesystems it is easy to expose
any tree like data as a filesystem. In fact, a while ago I made a (still
readonly) filesystem for my browser bookmarks.

As long as I am on the topic of this, you know that you are in under explored
territory where the first man page you visit for debugging your first non-
trivial problem starts with "This is not the function you are interested in."
(man getdents).

------
maxiepoo
Like paredit:
[http://www.emacswiki.org/emacs/ParEdit](http://www.emacswiki.org/emacs/ParEdit)?

~~~
andrewvc
I know it's a cliche, but really, the answer to nearly every question often is
"It's already an emacs macro"

------
obeattie
Internally, we have a graph editing tool which uses D3 (screenshot [1]) which
I threw together based on some existing examples. I'd be happy to open up the
source code if there was any interest, though it's really nothing all that
special. The layout algorithm could definitely use some work for our use-case
at least. It's force-directed at the moment, using stock D3 layouts, but
really needs a hierarchical mode. While it's not perfect, it is intuitive
enough that non-technical people "get it".

Beyond this, yEd[2] is really quite cool (even if it does have a very dated
UI).

[1]
[https://www.evernote.com/shard/s3/sh/67c67a48-8b3d-4eac-b7ee...](https://www.evernote.com/shard/s3/sh/67c67a48-8b3d-4eac-b7ee-427fbf6fb5ca/ab7dff4c05a5503d06b001ac7f248451/deep/0/Define-
concept-relationships.png)

[2]
[http://www.yworks.com/en/products_yed_about.html](http://www.yworks.com/en/products_yed_about.html)

------
solomatov
Actually we have a lot of such editors. For example, JetBrains, MPS
([http://www.jetbrains.com/mps/](http://www.jetbrains.com/mps/))

I am currently working on a web based version of such an editor at JetBrains.
You can take a look at it here: [http://jb-proj-demo.appspot.com/](http://jb-
proj-demo.appspot.com/) (It's open source and it's available on github here:
[https://github.com/JetBrains/jetpad-
projectional](https://github.com/JetBrains/jetpad-projectional))

~~~
marknadal
Fascinating project, what library did you use for your HTML based graphs? I'd
be interested in using it, I was thinking about building something similar the
other day. Great work.

~~~
solomatov
If you are interested in graphs, you might also want to look at this demo:
[http://mbeddr-dataflow.appspot.com/](http://mbeddr-dataflow.appspot.com/)

We have quite a smart layout here which was implemented from scratch.

------
dfc
I am surprised that nobody has mentioned Tinderbox. It is an awesome
mindmapping/outlining application and one of the two applications that make me
jealous of OSX users. (Bibdesk is the other)

[http://www.eastgate.com/Tinderbox/](http://www.eastgate.com/Tinderbox/)

~~~
radicalbyte
Calibre is a multi-platform alternative to Bibdesk, the UI is ugly but it's
very usable.

~~~
dfc
I am sorry but Calibre and Bibdesk are completely different programs. I have
used both programs and I am surprised you would say that calibre is an
alternative to bibdesk. Calibre's focus is ebooks and bibdesk's focus is
bibliographic information. The only possible overlap is that they both create
a directory with electronic reading material. In order to get calibre to
organize a directory like bibdesk (ie configured by author/journal/year) you
have to jump through a million hoops and it requires duplicating your library.
Have you ever used Bibdesk?

I grudgingly use calibre for epub/mobi conversion. Calibre's UI is ugly and it
is not very usable: there are _three separate pairs of arrows_ on the ebook
preview screen! How would you decide which pair is for pgup/pgdn? And what
would a user expect the use is for other two sets?

------
VLM
Productivity problem because of degrees of freedom.

Hard to do without graphics, and once you introduce graphics, you end up with
endless non-productive futzing by non-graphics artists trying to be amateur
graphics artists with move this one pixel over to get an artistic look or
whatever other graphical effect. Unfortunately the user isn't a graphics
artist and is theoretically hired to write code or memos or reviews, so
they're both working way out of their core competency AND usually not any good
at graphics arts. And if you don't allow hours of futzing, a competitor will,
and you'll be destroyed in the marketplace. People like futzing even if its by
definition totally anti-productive, which isn't all that weird given the
popularity of the open plan office and so on.

Nothing is ever new in IT. In the early years of desktop publishing,
productivity suffered dramatically because a simple memo meeting notice which
took 10 minutes on typewriter and xerox, now took at least 3 hours of font
selection (at least 6 different fonts and sizes per page) and endless clip art
and at least 10 revisions to get it "just right".

------
pwg
The author might be looking for Treesheets:
[http://strlen.com/treesheets/](http://strlen.com/treesheets/)

------
erikcw
It's been a few years since I've played with it, but Leo[1] seems like it
might be what the author is looking for. It's even scriptable (in Python).
Looks like it is actively maintained[2].

[http://leoeditor.com/](http://leoeditor.com/)

[https://github.com/leo-editor/leo-editor](https://github.com/leo-editor/leo-
editor)

~~~
cben
I was just about to write that... I barely know it but it seems it can be
summed up as a hybrid of mind mapping [1] and literate programming [2], with a
graph data model [3].

[1] [http://leoeditor.com/tutorial-basics.html#selecting-and-
movi...](http://leoeditor.com/tutorial-basics.html#selecting-and-moving-
outline-nodes) [2] [http://leoeditor.com/tutorial-
programming.html](http://leoeditor.com/tutorial-programming.html) [3]
[http://leoeditor.com/tutorial-pim.html#clones](http://leoeditor.com/tutorial-
pim.html#clones)

It's status somewhat resembles Org Mode: it has its own format (which hasn't
caught on as interchange format) but has sufficient manipulation and export
power to allow some people to spend their life inside it.

\---

The second thing that spings to mind is YAML which is usually used for trees
but the actual data model allows graphs. Is there any structured YAML editor
(a-la paredit)?

------
todazar
I created GraphBin ([http://graphbin.co](http://graphbin.co)) because my data
structures and algorithms prof didn't want us to hand draw graphs for
assignments. I didn't want to make them via paint either.

Maybe not a general purpose tree editor, but at least it's helped me out so
far :)

~~~
dfc
How do I select the two nodes to create an edge? (Iceweasel beta in case that
makes a difference)

~~~
todazar
Hit Selection Mode > Press and hold "s" for source node and click on the node
you want > Press and hold "t" for target node and click on the node you want >
Once the names of the nodes appear to the left under the header "+/\- Edge",
hit Add Edge.

------
oevi
For general purpose graphical tree editing a tool like yED [1] might be the
most flexible solution. yED's native GraphML can be easily transformed into
other XML-like Structures.

If you like a plain text solution the TGF Format might suit your needs. It can
also be visualized and edited in yED but it's very limited in its feature set.

A very nice and simple solution for visualization of small trees is to parse
plain text with XSLT and transform it into SVG [2].

For are more programmable concept i would recommend to have a look at the
combination of D3js [3] + JSON (or XML).

[1]
[http://www.yworks.com/en/products_yed_about.html](http://www.yworks.com/en/products_yed_about.html)
[2] [http://www.xml.com/lpt/a/1472](http://www.xml.com/lpt/a/1472) [3]
[http://d3js.org](http://d3js.org)

------
hyp0
We have file tree viewers, and standard GUI components like Java's JTree.

I only skimmed, but the article didn't seem to address the questions raised
("why?"), but instead described the problem and proposed solutions.

I think an answer to the question would be far more interesting and
revealing... it might simply be that 1. it's hard; and 2. text is far better
at hierarchical structures. Like his examples, lisp, programming languages in
general, arithmetic algebra.

So I think the hint is that the Human Processing System is adapted to handling
hierarchical structures linguistically (i.e. symbolically: speech, writing,
text). I suspect there is a very good and deep reason for this, to do with the
kinds of operations (transformations) typically needed. But I don't know what
that reason is.

------
paul_milovanov
can't believe nobody has mentioned org-mode yet.

~~~
freshhawk
Why did I have to scroll so far down for this! I was starting to think I was
going to have to write "can't believe nobody has mentioned org-mode yet."
myself.

Org-mode (and outliners in general) are tree editors. If they support links
then they are graph editors.

------
bakul
Might be more fruitful to think of a graph or tree "ecosystem" rather than
just an editor. For an ecosystem one can think of the following aspects:

\- a representation that can be shared by various tools, possibly in parallel.
Allow attaching arbitrary attributes

\- ability to map between equivalent but different representations (adjacency
matrix, node/link/port etc.)

\- plugins that operate on a specific rep. and map to some visual
representation

\- a language for programmatic construction (or may be a library)

\- efficient storage representation (one or more)

\- communication protocol for sharing/moving subgraphs

\- key/mouse bindings when viewed graphically

\- macros/functions to encapsulate useful patterns

\- graph manipulation & mapping tools (e.g. mapping a circuit schematic to a
PCB, compiling, etc.)

[Sorry for the frequent editing - I was trying to get the list right. Still
not quite right.]

------
aurelianito
Another project related to the one propossed in this article is a diff-
diff3-patch like program suite that can be used on trees. It would fit in a
great way with version control systems and make them (more) aware of
structural changes in changesets.

Imagine being able to dump plain-text files for real trees when diffing-
merging. The way differences are shown to the user could be like a project i
did a few years ago to show differences in graphs (applied to basic-blocks
graphs). Here is the link:
[http://corelabs.coresecurity.com/index.php?module=Wiki&actio...](http://corelabs.coresecurity.com/index.php?module=Wiki&action=view&type=tool&name=aureliax)

~~~
pcmonk
This would be wonderful. Certainly a prerequisite for any serious programming.

------
retrogradeorbit
I use treeline.

[http://sourceforge.net/projects/treeline/](http://sourceforge.net/projects/treeline/)

~~~
erikano
Looking at the screenshots reminded me of Leo. I only used it a little bit but
liked it.

From their homepage:

> Leo is a PIM, IDE and outliner that accelerates the work flow of
> programmers, authors and web designers. Leo's unique features organize data
> in a revolutionary way:

> * Leo outlines are views on an underlying graph.

> * Outline nodes can reside in many places within a single outline.

> * Leo is fully scriptable in Python.

> * Leo scripts have full access to Leo's source code and all outline data.

> * Outline-oriented markup generates external files from outlines.

[http://leoeditor.com/](http://leoeditor.com/)

------
mfenniak
Hm... I've been quite happy using an Open Source tool called FreeMind. It
seems to be a "tree editor", although I'm not sure it quite satisfies what
this author is looking for.

Screenshot:
[http://freemind.sourceforge.net/wiki/index.php/File:FreeMind...](http://freemind.sourceforge.net/wiki/index.php/File:FreeMind-
computer-knowledge-080.png)

Website:
[http://freemind.sourceforge.net/wiki/index.php/Main_Page](http://freemind.sourceforge.net/wiki/index.php/Main_Page)

~~~
petercooper
Yeah, outliners and mindmappers provide a lot of this functionality although,
alas, not _all_ , which would certainly be nice.

~~~
analog31
Are any of them scriptable to the point where we could add our own desired
functionality? Python preferred for me, but I'd learn another language if the
app was compelling.

~~~
pcmonk
This is certainly an important point. There seems to be more potential in mind
mapping software than I thought, but extensibility is key.

------
hyperion2010
I have used yEd for a few years to do simple mind mapping with graphs. Not the
best solution, but it works.

------
Arelius
The problem is that everybody has different goals in a tree editor. But the
Sony ATF framework, has a lot of support for graph editing.

[https://github.com/SonyWWS/ATF](https://github.com/SonyWWS/ATF)

See many examples in the gallery: [https://github.com/SonyWWS/ATF/wiki/ATF-
Gallery](https://github.com/SonyWWS/ATF/wiki/ATF-Gallery)

------
kazagistar
You say things like "programming languages have an AST", but in reality, it is
more like a couple of directed graphs over an AST in terms of the semantics.
The AST is more an accident of how we compile, but syntax is still invalid if
you fail to match types, which are context sensitive; all of the calls (and
thus most of the meaning of a function) refers to these tables as well, and
many nodes can share the same "semantics" subnode; and by far the most
important part to us as while programming is the data flow, which is
structured as an often cyclic directed graph. Really, the tree does not buy us
much of anything in this case: modern editors tend to allow syntax aware edits
and refactoring anyways, and coding structure dictates that your code "look"
like the AST anyways with blocks and spacing and such.

Similarly, proofs are only treelike at a very small depth before becoming
directed graphs, and most modern data stores like XML and JSON which form
trees tend to have additional logical (if not formal) schemas that add
complexity to the problem.

------
fcc3
Ashton Tate made a tree editor called
[Framework]([http://en.wikipedia.org/wiki/Ashton-
Tate#Framework](http://en.wikipedia.org/wiki/Ashton-Tate#Framework)) which I
used to write my thesis in the late 80s on a DOS machine. I loved it. It had
intuitive keystrokes, using the numeric keypad to zoom in (+) and out (-) of
the tree with an easy way to collapse the tree branches (enter).

Each frame held other frames, or could hold text, a spreadsheet or a database.

It wasn’t a DAG (directed acyclic graph) which was frustrating sometimes.

I think you could program leaves to link to other leaves, but I wasn’t any
good at programming. It had its own programming language FRED.

The people who grokked it loved it.

I think there is still a [closed
source]([http://www.framework.com/](http://www.framework.com/)) community
supporting it, last time I looked.

I hope you will use markup with something like YAML or [JSON-
LD]([http://manu.sporny.org/2014/json-ld-
origins-2/](http://manu.sporny.org/2014/json-ld-origins-2/)) to store your
links.

------
j2kun
It seems like he (or someone) could quickly code up a javascript demo of what
he wants using D3.js. Maybe this is my excuse to learn D3.

~~~
pcmonk
When I learned about D3.js this was exactly what I wanted to use it for.
Unfortunately, I've mostly avoided web development, so my javascript isn't
good enough to _quickly_ code anything up. You're right, though, this could be
a good excuse to learn it.

(by the way, I love your blog)

~~~
j2kun
ty

Graph layout algorithms have come to mind for a topic on my blog from time to
time. It's a woefully underdeveloped field, and it could be good blog
fodder...

My favorite casual text editor is this one [1]. So likewise I imagine a graph
editing program that's very simple and one could use it anywhere. Say you
click and that creates a new node and a text area pops up for you to type
things in. Then you can create a new node, drag to form an edge, etc. The only
thing is that I imagine I'd hate working around the force-guided graph layout
algorithms the entire time, cause stuff would keep bouncing around. I'd want
to be able to drag and drop nodes to move them away momentarily, zoom in and
out and pan to focus my attention on some small part of the graph, and then
toggle the layout algorithm to snap things back into place.

Everything would be stored locally in the DOM (or, say, in the url), so you
could bookmark and share easily, and import/export to JSON or edge-list
representations. And... yeah that's about it. I can't imagine wanting colors
or styling, but if the design is simple enough you could have plugins for that
(and plugins for layout algorithms, etc). I also can't imagine how one would
do text navigation on nodes of large degree... Even if you did come up with a
system, it would necessarily depend on the graphical layout decisions (which
change dynamically) and that would require you to tie the graph data structure
to its geometric interpretation, which smells like spaghetti design to me.

It's something to think about. If your ideas are along similar lines, I'd be
happy to team up and start a github repo. I just can't commit to working on it
all that often.

[1]: data:text/html, <textarea style="font-size: 1.5em; width: 100%; height:
100%; border: none; outline: none; font-family:monospace" autofocus /> (copy
and paste this as a url)

EDIT: I suppose if you really wanted a keyboard-based system you could have a
text representation of the graph (as a vertex list + edge list) and have the
graph update in real time. When you make changes in one side the changes
automatically update in the other side. Then you could use keyboard or mouse
however you see fit.

------
adriano_f
This is pretty much exactly what we're trying to achieve with Gingko.

It's a full tree editor, that is being used for everything from PhD theses, to
television screenplays.

[http://gingkoapp.com](http://gingkoapp.com)
[https://www.youtube.com/watch?v=egCKZHsICm8](https://www.youtube.com/watch?v=egCKZHsICm8)

~~~
aendruk
It's a shame that this is proprietary and hosted—as good as nonexistent in the
discussion of general-purpose tools.

------
unfamiliar
I think text editors are a bad comparison because they do something a little
different. They are not linked to a specific data structure, they are linked
to a particular data type. All of the examples of how diverse text editors are
(Latex, csv files, log files, etc) are completely different data structures
but all are stored in the same data type -- plain text. You can easily edit
tree data in text files as long as they are stored in a plain text encoding.
Counterpart to text editors would be hex editors, and all of the above can be
done in them if the original data was stored in a binary format.

Text editors are useful because standards have evolved with them. We have
standards for trees - XML and JSON for example. CSV editors are useful because
there are ways to convert other table data into CSV to work with. If you just
allowed a tree editor like XCode's plist editor to import other file types it
would be the same situation.

------
ajarmst
I said I was jut going to ignore this downthread, but I just can't help
myself. Feel free to dismiss it as "another emacs dweeb pointing out they've
been using alien technology since the 1970s".

[http://orgmode.org/manual/Structure-
editing.html](http://orgmode.org/manual/Structure-editing.html)

------
JoeAltmaier
Heck why don't we have an xml editor, with syntax checking through a schema?
This has been possible for a decade.

~~~
gavinpc
If you're not joking (and it is April 1), you seriously should check out nxml-
mode for emacs. It has amazing support for RelaxNG based schema (the compact
syntax).

~~~
JoeAltmaier
I'm looking for more of a forms editor, that generates xml and guides editing
with an xml schema. So no I don't want to edit xml; I want to edit data
records, configuration file entries etc with a schema-driven editor.

------
tavoe
I'm definitely thinking of making a graph based text editor.

I think I could work off of code-highlighting files to figure out where to
break code out into different nodes.

Then, I would look for matching terms in each node, and make connections.
Connections could also be made based on containment (part of a class, or a
child function, or a where clause).

One hotkey to follow a connection to it's destination (and select that node).
Another to pull it in and make it share the screen with the current node (and
select it). Pressing the "pull in" key would push a node off the screen if it
were already on screen.

Of course, maybe you would only want to explode some of your code as nodes.
You could highlight part of you file and hit "explode" to break it out into
nodes for a minute.

------
galactus
Fargo is quite nice [http://fargo.io/](http://fargo.io/)

~~~
sukuriant
Is there a way to play with this without using Dropbox?

~~~
treerock
You could try Little Outliner[1]. Dave Winer has been making outliner software
for decades[2]. I remember playing about with a desktop app years ago. I guess
Fargo is the latest iteration.

[1]: [http://littleoutliner.com/](http://littleoutliner.com/) [2]:
[https://en.wikipedia.org/wiki/Dave_Winer#Career](https://en.wikipedia.org/wiki/Dave_Winer#Career)

------
narag
I'm writing one. Inspiration from
[http://www.treepad.com/](http://www.treepad.com/) I use Treepad for notes
heavily. Now I want to be able to manipulate the tree programmatically.

Also it will serve for a html/js workshop for kids. They have a hard time
setting up and working with regular editors and the file system.

The program is general purpose (different kind of node can be handled with
plugged-in "drivers").

If you're interested, drop me a mail.

------
rch
It's ugly, but take a look at the HDF editor:

[http://www.hdfgroup.org/products/java/hdfview/](http://www.hdfgroup.org/products/java/hdfview/)

There's also:

[http://oboedit.org/](http://oboedit.org/)

The deficiencies in the generally available tools are obvious, but refined
versions do exist here and there.

~~~
rch
I wasn't insinuating that those example are 'refined' or anything; just that
the ideas embodied in those tools might be worth knowing about.

------
spankalee
Sounds sort of like OmniOutliner with plugins.

~~~
lordlarm
OmniOutliner is commercial; only for OSX; and a GUI, not a CLI. Just to
mention _some_ weaknesses.

~~~
cturner
Another big limitation with Omni - it doesn't have a mode where it can just
operate on and save to graphviz format. It's screaming out for this. Omni
could be the editor of choice for graphviz. Instead they have gone down the
route of allowing you to import what you want, but then you have to save it in
their opaque format.

------
bambax
What about Workflowy ([https://workflowy.com/](https://workflowy.com/))?

~~~
pcmonk
It seems like a good product, but it doesn't fit my requirements because (1)
it doesn't support plugins to specialize its functionality to particular
domains and (2) its reliance on the mouse looks like it would make it far too
inefficient for the kind of work I would like to do.

It's an interesting project, though, I'll try to check it out and see what I
can learn from it.

~~~
ninkendo
Workflowy has keyboard shortcuts for pretty much everything. I've been using
it for about 6 months now and I swear by it.

Workflowy is an enlighteningly simple app (it's really just bullet lists with
zooming) but it's incredibly effective for what it does, and the free-form
nature of it makes it easy to just brain-dump random notes to get your
thoughts out into text. I use it to do rubber ducking [1], because just the
act of putting my problem into text helps me organize my thoughts. I can't say
enough good things about it.

[1]
[http://c2.com/cgi/wiki?RubberDucking](http://c2.com/cgi/wiki?RubberDucking)

------
tonyedgecombe
I use a tree editor[1] in one of my products, it's almost a graphical DSL,
originally inspired by a now deceased product called FormScape.

[1]: [http://www.folderagent.com/images/blog/fa-rules-
tree.png](http://www.folderagent.com/images/blog/fa-rules-tree.png)

------
kyllo
For this purpose I like typing out YAML files in Sublime Text 2. It has syntax
highlighting and a formatting plugin. YAML is much more concise and readable
than XML and JSON, and many programming languages have libraries for parsing
and deserializing it into an in-memory object.

------
tmcw
Because we don't have a commonly-accepted tree file format, so an editor has
nothing to edit.

~~~
paul_milovanov
but we do: basic emacs org-mode file format is simple, intuitive, text-based
and human-readable.

~~~
pcmonk
I don't think that qualifies as "commonly-accepted". It's not a bad format
(for trees -- it doesn't look like it generalizes to DAGs or graphs), but a
standard format might be helpful.

------
BadassFractal
I've actually looked into the existence of quality JSON-editing tools that can
deal with more than 2 dimensions and have not found anything good yet. Too
bad, because excel/csv can be pretty restrictive for certain types of data.

------
wslh
Have you seen Tom Sawyer software? components such as
[https://www.tomsawyer.com/products/layout/index.php](https://www.tomsawyer.com/products/layout/index.php)
(commercial).

------
scotty79
What I'm looking for is a code editor that doesn't let you edit text but
rather the code tree. That prevents you from writing a code that is not a
valid tree but doesn't get in the way too much.

------
edwinyzh
Well, I used to develop MindVisualizer ([http://innovationgear.com/mind-
mapping-software/](http://innovationgear.com/mind-mapping-software/))

------
clord
I have this crazy idea in the back of my mind to write a visual programming
language based on Haskell, where shape and colour convey kind and type
information. Still cooking that one.

------
panic
Maybe because we don't have a general-purpose tree file format?

~~~
bpicolo
XML. : )

~~~
MichaelMoser123
or JSON or S-EXPR; or structures in memory with pointers between nodes
(multiple ways to do that, also very specific to the current programming
language) and you can store that with some serialization mechanism; or records
in SQL table with links as foreign keys (nasty); or object oriented databases
(overkill)

It is hard to do them all, or to come up with one solution that pleases
everybody, therefore everybody is doing his own tree. Maybe that's not the
most general solution, but in reality you really need this one particular
choice of tree representation to do your job.

------
dm2
Freemind might be similar to what you're looking for.

[http://freemind.sourceforge.net/wiki/](http://freemind.sourceforge.net/wiki/)

------
mark_l_watson
One of the best tree editors I have used (actually a graph editor) was built
into the InterLisp-D programming environment on my Xerox Lisp Machine.

------
tunesmith
You might like Flying Logic (flyinglogic.com) .

------
mtdewcmu
A web browser is a GUI for viewing a directed graph, the web (vertices =
pages, edges = hyperlinks). It's quite popular.

------
q234
nestgrid is a general purpose tree editor. Description, in-browser flash demo
and desktop app installer are available at
[http://nestgrid.org](http://nestgrid.org)

ETA: incidentally, architecturally it is structured for easy plugin / "script"
extensibility, like a low key emacs.

------
Myrth
What about hnb? [http://hnb.sourceforge.net/](http://hnb.sourceforge.net/)

------
sjtrny
Well mathematically we represent trees with matrices. So anything that can
edit tabular data can edit trees.

~~~
maaku
Do we? That's only one possible implementation, and not a very efficient one
for most uses.

~~~
sjtrny
Efficient in what sense? Computationally and storage wise it is the most
efficient.

~~~
sigstoat
that isn't true. there are tradeoffs between using an adjacency matrix, and
other representations. different operations will be more efficient on
different representations.

and in the special case of extremely sparse graphs like trees, the adjacency
matrix isn't going to win very often.

your copy of CLRS should discuss all of this. and for practical uses of non-
adjacency matrix representations of trees, you can take a look at every
functional programming language, ever.

------
danielweber
There's one for JQueryUi I've used and been pleased with, but damned if I can
remember it now

------
talaketu
[http://xanadu.com/zigzag/](http://xanadu.com/zigzag/)

------
leoc
Let me get back to you on this... :)

------
quiksilver19
askrafiki.com is a good example of a general purpose editor

------
arvidj


