Live data from Hacker News

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

pcmonk.me

41–50 of 222 posts

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

#42
post #26

Because we don't have a general-purpose tree file format.

I'm not being facetious here ... but aren't XML, Json and Yaml popular tree-structured formats?

Like OP mentions Excel for instance, for editing tabular data, which isn't quite a standard file format, and in any case supports many different formats for tabular data.

I can't help but wonder if OP is focusing on "format" rather than the structure of the data itself. There's plenty of editors for these well known formats. Perhaps he just needs to restructure his problem to use one of these?

In XML for instance, it's fairly straightforward to implement a "plugin" such as he describes, using python or ruby and a DOM parser, which could amongst other things provide the different renderings described.

I remember using XML Spy a long time back which seemed to do this quite well, as an ever expanding grid of cells, click into a cell, and it would expand showing its constituent cells. There were different tree representations available as well.

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

#44
post #40

Earlier quoted context omitted.

This sounds like something that can only be true for equations below some size. If you're trying to manipulate a sufficiently large equation, it has to be automated, so directly editing text is bound to lose (however clunky the automated method may be). So maybe your experience is just that equations rarely get large enough to make it worth it to use a graphical editor? For instance, doesn't the fact that people do p…

I regularly edit large equations in LaTeX. I don't see how it's not manageable, just break your equations into multiple lines. \begin{equation} H_n(i) = \begin{cases} \left( H_{n-1}(i)_2, H_{n-1}(i)_1 \right) & 0 \le i > For instance, doesn't the fact that people do pure algebra with Mathematica (forgetting about all the numerics, integrals, etc.) demonstrate that TeX loses for sufficiently large equations? I use Mat…

> regularly edit large equations in LaTeX. I don't see how it's not manageable, just break your equations into multiple lines.

I understand how to indent TeX, but when you have a hundred algebraic terms it's very unwieldly, and Mathematica becomes clearly superior (for me) just to visualize it.

Anyways, it sounds like you're just saying you haven't found the graphical visualization for equation trees to be useful, so you stick with the linear representation, but the manipulations of those trees (by mathematica, or some other dedicated editor) is still useful.

In this case I would add that we would probably still need some sort of visualization aid for sufficiently large equations, and that the tools are just not good right now. After all, much/most code is written in normal (linear) text editors, but some people still do find it useful to "collapse" sections of code, corresponding to branches of the tree structure induced by indentation. Many people don't bother with this right now because it can cause headaches that simple scrolling does not, but better tools may change this.

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

#45

Check gingko, which is more focussed on docs, but is a tree editor at its core. https://gingkoapp.com/ Used it at university for notes, and is great for quick revisions before the exams too!

Looks great but it only does text. The link speaks of beyond ASCII. For this the old school PIM were better at storage of thoughts.

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

#47
post #3

Emacs has ParEdit minor mode which is a general-purpose tree editor. https://www.emacswiki.org/emacs/ParEdit edit: paredit demos: Productive Emacs: Paredit https://www.youtube.com/watch?v=T1WBsI3gdDE Emacs Rocks! Episode 14: Paredit: https://www.youtube.com/watch?v=D6h5dFyyUX0

How good is it? I've never used it and I'm genuinely curious.

It's definitely written with the intent of using it to edit Lisp code, and for that it is great. It is now hard for me to imagine writing Lisp by editing S-expressions directly.

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

#48
post #3

Emacs has ParEdit minor mode which is a general-purpose tree editor. https://www.emacswiki.org/emacs/ParEdit edit: paredit demos: Productive Emacs: Paredit https://www.youtube.com/watch?v=T1WBsI3gdDE Emacs Rocks! Episode 14: Paredit: https://www.youtube.com/watch?v=D6h5dFyyUX0

How good is it? I've never used it and I'm genuinely curious.

Pretty good, it almost make you feel you're working on trees and not text. Takes a few moments to get used to. I recommend what I did: take a bunch of Lisp code, strip it out of parenthesis (M-x replace-string, replace ( and ) with empty strings), and then use Paredit commands to restore the original tree structure. I spent less than an hour simply doing this exercise again and again, and it was enough to become a proficient user.

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

#49

Earlier quoted context omitted.

FWIW the editor in Chromium's and Firefox's developer tools are pretty good. I'd really like to see something like that as a standalone tool for both trees and XML and see how far it can be taken.

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.

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

#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 or less), which is easy for text. But as soon as you want to move to useful, common tree-structures, you have to agree on both representation and semantics, which makes it much harder.

One challenge we need to solve is - what level do you want to work on? Let's say you're working on some code. You may want to treat functions and blocks as a tree structure, but you want to treat simple mathematical expressions as text. Where this threshold is, is entirely context-dependent. The editor needs to understand the language and be able to expand text into its tree structure, or collapse the tree into its text representation, at any node in the tree.

This implies that we need to agree on a common format for defining the conversion (parsing and generating) between text and trees. We'd probably also need a package system which contains common definitions for all major languages.

Post reply on HN