[IPython-dev] Ace versus CodeMirror

Fernando Perez fperez.net at gmail.com
Sun Jan 22 22:29:07 EST 2012


Hi John,

On Sun, Jan 22, 2012 at 7:11 PM, John Fawcett <fawce at quantopian.com> wrote:
> Hi,
>
> I think the long-form edit case is very promising. It borders on full blown
> development, and seems to imply the eventual unification of the cellular
> edit style with the file-oriented style of a typical editor. Is that the
> idea? (Aside: i signed up for c9.io based on the Ace editor project, and it
> is the best online IDE I've tried - they have tabbed editors btw).

The way I think about it (and others may disagree) is that I want the
development features that are relevant to interactive-focused
workflows.  In that regard, I don't focus on competing with tools like
Microsoft's amazing Visual Studio Python plugin or PyCharm, that do
very impressive amounts of project management and introspection, at
what is surely a high cost of development complexity for their
authors.  So things like sophisticated completion for incomplete
classes (that requires difficult background analysis of code as it's
typed) or multi-file refactoring are well outside of our scope.

But while working interactively on code/data problems, I do want solid
editing support.  For years many of us have worked with $EDITOR +
ipython-terminal for this class of problems, but with the notebook
moving us closer to the browse full-time, I also want an editing
experience that is as close to that of a full-time editor as is
reasonable given our resources.  Basically I don't want an editor that
I curse at while I work if I'm in a browser working remotely and
firing up an editor local to the files is impractical/impossible.

> - I tried selecting a block in a cell, and it seemed like tab did indent,
> and shift-tab de-indented. Is that what you meant by indentation support?

Yes, but for me it doesn't work correctly. On Firefox 9 neither indent
nor dedent work correctly, as only some lines get indented (meaning
the code gets mangled). On Chrome only indent seems to work.  On this
front, Ace works fine.

> - the total lack of docstring support in CM is annoying, maybe it is
> feasible to patch CM to support it properly?

Certainly an option, the question is, given our limited resources,
whether it's worth our time instead of just using Ace (which handles
this right).  Obviously having two editors has its own issues, so it's
a valid question.

> - CM has a decent demo of search/replace, that I think is as good as Ace:
> http://codemirror.net/demo/search.html

That looks pretty decent, I seem to remember trying it a while ago and
finding it much poorer; perhaps they've improved recently.  I would
want that to be available in *all* cells all the time, actually!

> My free advice (which is worth what you pay for it :) ) is to aim to have
> one editor for cell and long-form editing. It seems like getting the
> docstring and indentation support in CM would have to be compared to getting
> Ace to support multiple editors on one page.

I *think* for Ace, the hundreds-of-editors option isn't very
realistic, or would at least require a fairly large restructuring of
their code b/c that's a use case that is very far from their original
design intention.  So the question is probably more whether we can
make CM fill all our needs, or find a good way to live with both that
is as seamless as possible for the users.

I agree that having only one editor to deal with would be the ideal
solution all around, both easier for IPython developers and users.
Perhaps as both Ace and CM mature one of them will fit that bill.
Thanks for the thoughtful feedback!

Cheers,

f



More information about the IPython-dev mailing list