Internally, I’ve been toying with the idea of using Gingko as a Lisp editor. We’ve already tested exporting a Gingko tree to lisp (with parentheses inserted in the correct places), so the only thing missing is having more than three columns (the current limit).
I believe Gingko is a natural way to write Lisp, for the following reasons:
- Nesting is visual, rather than parenthetical. You no longer need to be a Lisp expert to “see past the parentheses”.
- One-to-one mapping. The tree maps directly into source, and can be mapped back. There is no ambiguity.
- Optional depth. For short forms and lists (such as (/ 1.0 sum) in the figure), it’s clearer to leave them as is. With Gingko, you can choose how much of the syntax to expressed using the tree structure, and how much to express with parentheses.
- Drag-and-Drop. It is now trivial to extract a deeply nested portion of code… just drag it out. Reordering of arguments, function extraction, all are much easier.
This is still a work in progress, and I am still a Lisp novice, so I would love to hear from more experienced Lispers: What do you think of this approach?
Let me know in the comments below.
Hi,
I used to teach LISP at Symbolics back in the 80’s.
LISP without an editor that understands it is a lost puppy. Humans do get lost in the nested parens without indents and other subtle visual hints that this “(” paren is closed by that “”)” paren. But, this is not the parens fault. Don’t fear the parens.
Although there is not enough of a sample here for me to get a clear idea of what you’ve built, I’m concerned by the promise “You no longer need to be a Lisp expert to “see past the parentheses”.” Like any programming language you’d better know what you are doing or the results are bad.
I’m also concerned (if I understand it correctly) about the “optional depth” feature where sometimes it’s the indent and sometimes it is the parens that shows the list. I could see where that would lead to code that would be hard to write and debug.
I’m delighted that people are still learning and experimenting with LISP. Keep at it.
Bob
Hi Bob,
Thank you for your thoughts on this. As I am a LISP newcomer, I’m working mostly on intuition here.
I am glad that we agree that an editor needs to have visual clues as to the nesting of parens.
As for your concerns, I understand them, and will think deeply about these points. One thing to note, though, is that I intend Gingko to be used as a means of reading & writing LISP, but only as an intermediate. The underlying code is, and will always be, straight-up LISP without any ambiguities.
Thanks for your thoughts on this, Bob. I’ll post again when we have some more LISPy features for Gingko.
All the best,
Adriano