3 ms·
An interesting idea that's definitely worth exploring. However, I think the conflict between tree-based editing and normal editors is completely unnecessary. I
by tikhonj 11y ago
An interesting idea that's definitely worth exploring.
However, I think the conflict between tree-based editing and normal editors is completely unnecessary. In fact, you can actually get basic tree-based editing today in Emacs!
The easiest language to support like this is Lisp because its syntax is about as close to pure tree as possible. And, indeed, Emacs has had structural editing for lisp for a while in the form of Paredit[1]. More recently, somebody extended this idea to Haskell[2] which is interesting because Haskell has one of the more complex, persnickety syntaxes around.
I'm not saying either of these are as good as dedicated editors—I'm not even convinced they could be as good—but they are low-cost ways to try these ideas out right now without abandoning general-purpose text editing or creating a brand new tool.
[1]: http://danmidwood.com/content/2014/11/21/animated-paredit.html http://danmidwood.com/content/2014/11/21/animated-paredit.ht...
[2]: https://github.com/chrisdone/structured-haskell-mode https://github.com/chrisdone/structured-haskell-mode
- LukeHoersten 11y agoTotally agree. You don't have to build a whole new tool just to try out this new method of editing code. I use both ParEdit and SHM from time to time and they work really well but it's a departure form muscle memory to say the least.
- habitue 11y agoThere is also js2-refactor [1] by Magnar Sveen (of emacs rocks fame) which adds structural editing to js2-mode [1]: https://github.com/magnars/js2-refactor.el https://github.com/magnars/js2-refactor.el
- rtpg 11y agoThat Structured Haskell Mode (https://github.com/chrisdone/structured-haskell-mode https://github.com/chrisdone/structured-haskell-mode) readme has some very interesting gifs to show how things work. It's pretty powerful, and I use SHM in my Haskell stuff to mostly good effect. I just have some issues involving the default indentation that I need to get round to fixing, and I haven't figured out how to surround a block with square brackets yet. But otherwise, very good stuff.