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.ht...
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.
I'd be very interested in some more detailed information about this. For example, I'd like to see a list of the hundred transformations required to edit JavaScript. They also mention that it is a home-row-oriented editor - what does that mean? Are the common commands available on the home row, such as navigation etc?
As the developer of a LISP IDE with structural editing functionality, this looks very interesting - please share more information!
I have heard that ParEdit is a not a toy. I have heard that, if you work in a lisp-type language, it's worth your time.
Screen cast: http://emacsrocks.com/e14.html
More info: http://www.emacswiki.org/emacs/ParEdit
"If paredit is not for you, then you need to become the sort of person that paredit is for. -Phil Hagelberg"
I'm not sure reducing keystrokes is a useful measure. I can't think of a better one, though, so at least it's something quantifiable.
Pure tree editing, with no text editor to fall back to, is important. I didn't even use textual output, while it sounds like these guys did. They also used javascript, which is interesting since it has so much syntax. Lisp seems like a natural choice to me since the tree structure is readily apparent.
Dogfooding is critical, and it's very natural for a project like this. When I got to that point, I learned so much about what was really important in an editor. Like macros -- those helped so much.
Keyboard-based editing of trees is possible, but it takes significant effort to make it feel decently natural.
Collaboration is definitely the most important thing people in this area need to learn. There are dozens of projects similar to this one, and they're generally created by solo programmers (like I did) or by pairs (like Prune). Tree-based editing will never take off until a group of like-minded programmers gets together and makes it happen. I've been pulled away into an unrelated project, but if I were to come back to this, my first move would be to get some collaborators.
https://groups.google.com/forum/#!forum/augmented-programmin...
disclaimer: i joined when the group started, but havent been active. i'm perennially interested in the structured editor concept, so cannot resist responding every time it surfaces on HN.
I am certainly open to the notion of alternative forms of interaction with code, but too often I see this take on the form of an IDE with “designer-like” capacities (this is not to say that IDEs are bad, just not what I am personally interested in) or the more simple interfaces used to teach kids to code (again, not a bad thing, just not what I want to use as my daily driver).
As others have said, it would have been great if they had open-sourced the code or offered a public instance so it could be vetted (even from an early perspective). And while I will do my best to keep an open mind, the macros available in other text editors seem like they may very well be capable of handling some of the functionality demonstrated in the article without much issue.
I too am firmly in a text editor camp, but I've recently been basically forced to use Eclipse while writing Java (ick) at work. The fact that it knows a lot about the code is invaluable sometimes - auto-importing package names as you type, fixing build rules in other files automatically, code completion, type-definitions that appear with inline usage notes, etc. Granted, enterprise Java in a build environment is the ideal use case for an IDE, but many of those features are useful all the time. Now when I write other code, it feels somewhat archaic that my text editor of choice isn't giving me function docs/typedefs and managing dependencies as I write.
As much as I despise the text editor in Eclipse, living without those things is basically impossible. I have "solved" this problem by constantly switching contexts between my editor of choice and Eclipse, whenever I need to do something crafty. What do other people do about this?
For vim, there are several plugins that provide completion functionality (for various languages)[1]. There are things to deal with Java imports specifically[2]. (I don't know what you mean by fixing build rules.) Hey, there are even plugins meant to facilitate whole IDE functionality for some languages[3].
Personally, I avoid things like Java so I have less of a use-case for IDEs anyway. Specifically, I code in C and Haskell (and a touch of by-hand llvm-ir for fun). In C, automatic imports and the like, I do not even wish for (since it is so necessary for me to completely understand the function calls I make, I need to read the docs quite commonly which mention the header for #inclusion). And, for Haskell, I'm constantly prototyping in ghci, so I learn what I need anyway. In neithr of these languages do I feel it is helpful enough for me to desire such things. Having said that, I understand that many people disagree; not too long ago, there was a small uproar that Haskell did not have a proper IDE yet. And I am exposed to IDEs at $DAYJOB, but if anything, that has further soured me towards them.
To all their own, text editors and IDEs alike; I think I'm likely to stick to my text editor :)
[1] https://stackoverflow.com/questions/5169638/autocompletion-i...
Here's my attempt: http://sediment.io
Since moving from the home row has such a massively destructive, measured, and reproducedly measured effect on productivity and geek credibility, I've always thought that editors should accept no other keypresses than those on the home row. Every keyboard key that isn't caps lock, asdfghjkl;' or enter should be a key chord. (And not a key sequence, because that would not be productive: a real key chord.)
The next step is to release a physical keyboard that has exactly 10 keys, since moving the forefingers to press G and H, and moving the pinkies to press caps lock, apostrophe, and return is such a tremendous affront to good taste.
And editors should refuse to accept mouse input, as well. Ideally, touching the mouse would cause an electric shock, but that would require hardware modification.
No love for unAmericans or Dvorak?
My main conclusion—which has a lot in common with the Prune editor—so far, came from asking, "what are we really doing when writing code?" and settling with, "selecting and configuring 'language constructs'". I believe this same thing can be done with generic models of languages/programs, where the source code is generated after the fact as a view (and that ASTs as 'program models' are unfortunately/unnecessarily coupled to a single view). I have a two-part, illustrated essay here: http://westoncb.blogspot.com/2015/06/why-programming-languag...
I had anyfix operators, so it was possible to write a program that read like english. In fact, I once got someone to write the sqrt function (inspired by the SICP) in Japanese: https://youtu.be/vwgvVpCRecE
I think this is really promising to introduce people to programming. How many times have you heard someone say "programming is so frustrating! I always misplace my semicolon." Also, not having syntax means that people can use DSLs without having the pain to learn its syntax.
1) Viewing code in a tree can be much more verbose and require more cognitive load. I would much rather see "x = a + b" than (set 'x (+ a b)).
2) Languages contain syntactic sugar. Trees do not. That syntactic sugar goes a long ways towards making things easier.
3) Text based code can be very compact. Trees tend to require lots of space on the screen. They can be compacted using s-expressions but I've always found them cumbersome to read -- especially when things get nested.
4) Trees follow prefix format. Sometimes infix and postfix styles are much easier to read.
"someString" capitalize map fn
is much easier to read than
(map (capitalize "some string") fn)
Trees require you to descend to the leaf node and read backwards sometimes.
That, and the fact that every environment has a text editor - especially terminal consoles.
You can overcome the second factor, but you cannot overcome the first one that easily.
1) Good ui/ux along with a nice color theme can help a lot.
2) What if it's actually just a lisp variant?
3) Very true.
4) Lisp like macros might help with it?
Concrete does tree based editing with projections (a la Intellij Meta/ Simyoni's Intentional) so you can see visual layouts of state machines, etc that are just as editable as the textual ones.
I haven't had time to come back to it, so I'm very glad to see that other people are working on the idea!
It still feels like a lot of work to get something written since you have to type "EscOPS<text>EscJT" to add "foo":true, instead of just cursor over to a place and just type exactly that string. However, I can see how one could get use to that much as how vim users are used to all those arcane keychords for basic navigation. Also, there's no reason a command string cannot be made into a macro.
Do you plan to open source this at all? Seems like a good start for someone to take and add on to.
Edit: found your github, nm.
Too bad the multi-billion dollar Facebook didn't actually produce any usable code to benefit the community, for a change.
Also, Facebook releases lots of great open source software. Apparently you haven't heard of React? For more see https://code.facebook.com/projects/
I regret that I have not had enough real world experience with MPS to comment on how it might relate to what Facebook is doing.
But as for real world, a JetBrains employee told me that they wrote YouTrack (https://youtrack.jetbrains.com) in MPS, presumably using an "issue tracker DSL" but he wouldn't elaborate further.
Their editors have an Expand Selection command, which, given the initial cursor position on the first line shown below, will result in subsequent executions of Expand Selection highlighting the text shown on each subsequent line.
System.out.println("Hello wor_ld")
System.out.println("Hello #world#")
System.out.println("#Hello world#")
System.out.println(#"Hello world"#)
System.out.#println("Hello world")#
Are you thinking of something else?