Cirru – An editor for AST
cirru.org
cirru.org
while trying to remember the name I discovered:
https://www.facebook.com/notes/kent-beck/prune-a-code-editor...
https://github.com/cxxtree/cxxtree
http://www.greenfoot.org/frames/
https://github.com/chrisdone/structured-haskell-mode
You may also add these projects:
https://github.com/shaunlebron/parinfer https://github.com/prettier/prettier
They are fixing the same problem Cirru Project was trying to solve, just in a more practical way.
The earliest structure editor was Interlisp's original structure editor for teletypes, which worked on Lisp lists directly. Editing on teletypes is not anything like editing on video terminals - you are basically forced to edit one line at a time instead of viewing the whole file. That's how ed works. Structured editing made a lot of sense for teletypes because you did not have to worry about putting delimiters in the wrong place, which is very hard to spot when you are doing things one line at a time.
There was an Interlisp structured editor (maybe more than one? I'm not sure) written for video terminals in the 1970s. On video terminals structured editing loses a lot of its advantages over text editing and structured editors fell out of style in the 1990s.
Otherwise it really doesn't improve on a text editor. All of these things would require a ton of work, so I stick with Sublime for now. Text isn't that bad.
IDEs are kinda close, but I've yet to see one that could effectively work with dynamic languages. RubyMine is interesting-looking, but seems to want to impose a lot of its opinions on your workflow. I don't really see how RubyMine would really be that much better than Sublime and a terminal.
That is a hard nut to crack, a dynamic language will frustrate static analysis.
BTW, I don't know much about building IDEs, so I won't analyze code by myself and let the editor recognize the code. Could be very tough work.
It's totally free and open source. I was a hard core JetBrains user but vscode has been amazing. They even got minimap like sublime in last release.
Every month they move at an amazing velocity working on features devs ask for. I feel it's the modern democratic IDE
That said, it's not the perfect text editor. I don't know that it really imposes any particular workflow (beyond obvious requirements like having access to the libraries you require), but there are certainly many things that you can do in Sublime that aren't going to work in RubyMine.
It lets you build a language and an editor that forces you to follow the syntax and semantics of your language. Pro tip: Your language can be based on java :)
Not surprisingly the first thing I did when I arrived at PARC in 1984 was write an Emacs for Interlisp.
This is a very neat idea.
For example, in python's builtin ast library, writing the variable
> x
in AST is..
> Expr(value=Name(id='x', ctx=Load()))
while assigning the variable
> x = 1
in AST is..
> Assign(targets=[Name(id='x', ctx=Store()),], value=Num(n=1))
There is a lot packed in there! I looked at the site, and a few videos, but the goal and motivation for this project has gone way over my head (probably my fault!).
Compare with Lisp:
Code: x
AST: x
Code: (let ((x 5)) (+ x x))
AST: (let ((x 5)) (+ x x))
And as for the very little syntactic sugar most Lisps have:
Code: 'x
AST: (quote x)
:).
(actually now that I think about it, R may do something a bit similar)
edit: I'm guessing its probably a bug that is confusing me the most, as I'm getting both a inline tree and a indented tree at the same time for a node
I guess my main thing is I don't know if I should trust my understanding of the tree display or not
Perhaps, as a sort-of training assistant, have the resulting "code" optionally appear beside the editor?
e.g. https://i.imgur.com/92stVmi.png
(I also noticed that you are looking for TCO for python, In some cases Coconut can do TCO, and can compile to python, but its somewhat of an unweildly tool to use
http://coconut.readthedocs.io/en/v1.2.2/DOCS.html#function-d... )
I think reading by a JavaScript programmer, TCO is "Tail Call Optimization".
He transitioned to a laptop soon after joining the company.
(defun x ()
(+ x x)) => (defun x ()
(+ x x))That would not be a good default because some people, like me, like to align their code in columns (for example, things like let clauses).
What I would like to see come as an Emacs default is just-one-space working on regions with the behavior you describe.
And @sedachv, thanks for Parenscript. It makes Javascript almost...well, now I can work it it :) Much appreciated.
Guess I need help from someone because English is not my mother language, and I even got cough these days.
One suggestion: I would implore you to add undo sooner rather than later.
If there were a good language-specific pretty printer, and it looked like regular text in the language, I could probably stomach it.
I've used Paredit, which is similar in concept; I think it's really cool if it can be generalized well to languages which aren't LISP.
https://github.com/jlongster/prettier https://twitter.com/search?q=atom%20prettier&src=typd