Live data from Hacker News

Why Don't We Have a General-Purpose Tree Editor? (2014)

pcmonk.me

101–110 of 222 posts

Re: Why Don't We Have a General-Purpose Tree Editor? (2014)

#101
post #50

I've been thinking about this constantly for the last 2-3 years. I'm working on something which might lead to this. What I've concluded, is that we don't have a good representation for a general purpose tree editor to work on. Roughly speaking, S-expressions are just a bit too simple, and XML is way too complicated. General purpose plain text editors work so well because we've agreed on a common representation (more…

>What I've concluded, is that we don't have a good representation for a general purpose tree editor to work on. Roughly speaking, S-expressions are just a bit too simple, and XML is way too complicated.

Ummm json??

Re: Why Don't We Have a General-Purpose Tree Editor? (2014)

#103

See to me the problem is the notion of tree structure itself. Forgive me because I don't know the correct mathematical way to talk about this: a tree is a particular type of network in which nodes can have only one direct parent and thus only share siblings with the descendants of that single parent. What we are really lacking is a good network editor, which would encompass not only trees but also more complex rhizom…

The author does mention such networks (AKA "graphs"), and there's a lot of discussion in the article's comments.

Whilst networks/graphs in general are very expressive, they can also be tricky to manage in some situations; e.g. think of a graph containing a cycle:

    A -> B
    ^    |
    |    V
    D 
How do we handle the order of these nodes and edges, e.g. for display or for serialising/deserialising? If we parse the graph from the text above, would we get an identical value to a parse of the following?

    B -> C
    ^    |
    |    V
    A 
If yes, would the user be upset that we've discarded the order? If no, then what is the form/structure of this extra information? Can it be represented as a specialisation/generalisation of a graph, or do we need something fundamentally different (a string, a parse tree, a partial-ordering, etc.)?

If we forbid cycles, we get a "directed acyclic graph" (DAG); it's like a tree, but multiple parents are allowed. DAGs are nice since we can do things like topologically sort them.

If we only allow nodes to have a single incoming edge, we get trees. The nice thing about trees is that they can be represented without any notion of "references" or "arrows". For example, we can write trees by nesting parentheses: (A (B C) D) is the tree:

    C  D
We can't write the following DAG just by using parentheses: should we put "C" inside the parentheses for "B", or for "A", or for both?

    C  D
    ^           |
    |           |
    \-----------/

Re: Why Don't We Have a General-Purpose Tree Editor? (2014)

#104
post #65
post #50

I've been thinking about this constantly for the last 2-3 years. I'm working on something which might lead to this. What I've concluded, is that we don't have a good representation for a general purpose tree editor to work on. Roughly speaking, S-expressions are just a bit too simple, and XML is way too complicated. General purpose plain text editors work so well because we've agreed on a common representation (more…

While we might have some common idea what is text, we definitely not have common semantics! The resulting situation isn't so much different from trees. And what do you mean by "s-expressions just too simple"? Isn't simplicity something to strive for?

> And what do you mean by "s-expressions just too simple"? Isn't simplicity something to strive for?

I should stress "a bit". Actually, looking closer at s-expressions right now (I was writing based on what I remembered), I'd like to flip that statement. S-expressions are just a bit more complex than what I have in mind. Or alternately: they're equivalent under some trivial transformation.

It depends on how you look at things - there are supposedly many different implementations of s-expressions, which support different fundamental data types. The basic idea is simpler. There are no fundamental data types, just nodes. For example a 'bit' is a node which can contain one of two child nodes ('one' or 'zero'). Any tree which represents data in memory on a computer can be expanded down to a collection of bits. Though in a text representation or tree editor the user will generally have collapsed the tree such that they don't see individual bits.

What I have in mind could look more complex than s-expression in a different context though: the text file representation of the trees may have more syntactic sugar than s-expressions in lisp.

The representation isn't significantly different, but the focus is. I'm focusing more on things related to type theory, schemas, how to represent patches/diffs, standardizing parsing/generation and other transforms, etc.

Re: Why Don't We Have a General-Purpose Tree Editor? (2014)

#107
post #50

I've been thinking about this constantly for the last 2-3 years. I'm working on something which might lead to this. What I've concluded, is that we don't have a good representation for a general purpose tree editor to work on. Roughly speaking, S-expressions are just a bit too simple, and XML is way too complicated. General purpose plain text editors work so well because we've agreed on a common representation (more…

>What I've concluded, is that we don't have a good representation for a general purpose tree editor to work on. Roughly speaking, S-expressions are just a bit too simple, and XML is way too complicated. Ummm json??

I was wrong about S-expressions. S-expressions are roughly the right complexity, or even a bit too complex, depending on how you look at it.

JSON is way too complex. JSONS assumes that you have an object/record structure (labels and values), and gives you both objects and arrays with which to build tree structures.

Re: Why Don't We Have a General-Purpose Tree Editor? (2014)

#108
post #43

We do: http://strlen.com/treesheets/

Seems like a enhanced personal wiki and away from PIM style and more added MindMap style. I would say this is not a tree editor.

what features/behavior would you want to have it qualify as such?

Re: Why Don't We Have a General-Purpose Tree Editor? (2014)

#109
post #49

Earlier quoted context omitted.

For XML you may want to take a closer look at XML Marker 1.1 (it's old, freeware and Windows but still better than many other tools) and maybe Eclipse.

I think that sums it up. We really can't top crufty old Windows freeware? There is a gaping hole in the market.

Or the market is smaller than it might seem.

Re: Why Don't We Have a General-Purpose Tree Editor? (2014)

#110

See to me the problem is the notion of tree structure itself. Forgive me because I don't know the correct mathematical way to talk about this: a tree is a particular type of network in which nodes can have only one direct parent and thus only share siblings with the descendants of that single parent. What we are really lacking is a good network editor, which would encompass not only trees but also more complex rhizom…

There's a core abstraction lurking behind tools like ZigZag, the Leo editor, hashtags, and C pointers/linked structures.

The hyperlink as the base abstraction allowed us to store and navigate individual nodes in a hypertext, but it doesn't work well for collections - thus it provides limited support for programmatic access.

Conversely, pointers & references in programming languages allow for easy handling/transformation of large structures (either loops or recursive traversal), but there have never been a really good visual representation beyond a few nodes, and are difficult to navigate.

A good tool should be based on an abstraction that worked well for linking information at separate places in the data space, and for retrieving collections as a whole. I have my ideas for how that abstraction should work, and even may develop a product around it eventually. ;-)

Post reply on HN