Hacker News new | past | comments | ask | show | jobs | submit login
Codemirror v3 released (codemirror.net)
94 points by bilalhusain on Dec 10, 2012 | hide | past | favorite | 18 comments



I have just started using Codemirror in a project and it is superb, and easy to use with an excellent API. And thank you thank you thank you for not requiring me to use jQuery to interact with it!

Looking forward to using the inline widgets, those will be very useful.



wow, great work! I can not wait to play with the inline and content widgets!


Codemirror is fantastic. If (like me) you used to think that in-browser code editing/debugging was doomed to fail, look at CodeMirror. It just works, and is comparable to Scintilla; one less reason to do native apps.


Congrats to Marijn, CodeMirror is just fantastic.


Can anyone compare this to Ace [1], if you've used both?

1: https://github.com/ajaxorg/ace


CodeMirror and Ace both have a long history of sane competition, and copied many of the ideas from one another. So much, in fact, that whenever I find myself in front of an Ace editor, I open up the DevTools and change the CSS to make the cursor 1 pixel wide. They have pretty much the same cursor display system!

A great difference, in my opinion, is the syntax highlighting systems. Ace's is more rule-based (as in, regex matches and regions), while CodeMirror's is more programmatic, which helps its JS mode show local variables in a different color.

There are also differences in the data structures used internally, afaik. Marijn can probably talk more about that.

On a different note, CodeMirror is being seriously considered independently in WebKit's and Firefox' DevTools, built-in. You may soon use it every day without even knowing!


Developer for Ace here.

The syntax highlighting rules for Ace were largely derived from tmlanguage files. This allows us to pretty easily import existing definitions. For example, Google had a tmlanguahe file for Dart that I was able to translate in less than an hour.

Could you describe more about what you like about CM's highlight rules? I admit I've never really looked into them. But I'm guessing by "show local variables in a different color" there's some parsing going on?


  > CodeMirror is being seriously considered independently in WebKit's and Firefox' DevTools, built-in.
Whoa, can you cite sources for these?



Wow, so it's already landed in Webkit, presumably behind some experimental flag. This is really neat, thanks.


As Marijn himself said ACE ≈ furniture CodeMirror ≈ timber [1].

Ace is more optimized for code -- multiple selections, indent guides, better folding.

Codemirror is smaller, and have better support for non english text (variable size and bidirectional). Also new features added in v3 -- lines with variable height, arbitrary widgets inside code, are quite impressive.

[1] http://marijnhaverbeke.nl/talks/goto2012/#4


> better folding

I'd argue that's not the case. The folding in CodeMirror v3 is on par with or even more powerful than ACE's.

> indent guides

If you mean the vertical rulers, they're not built into CM, but you can add one with a few lines of custom code.

> multiple selections

Should be coming to CM soon! https://groups.google.com/forum/?fromgroups=#!topic/CodeMirr...


>The folding in CodeMirror v3 is on par with or even more powerful than ACE's.

I agree that CodeMirrors general infrastructure for folding is more powerful than ACE's. But CodeMirror still lacks fold buttons on the gutter.

> If you mean the vertical rulers, they're not built into CM, but you can add one with a few lines of custom code.

True, but still when i use jsbin or cssdeck i wish they were built into CM:)

> multiple selections Should be coming to CM soon!

That's very good!

Also i forgot to mention that one of CodeMirrors advantages is a better name:)


> I agree that CodeMirrors general infrastructure for folding is more powerful than ACE's. But CodeMirror still lacks fold buttons on the gutter.

The folding utility in the distribution does lack them. But adding them (as in the 2.x code folder) is, again, just a few lines of code -- there's support for showing gutter widgets in the core, and the only reason the folding utility doesn't use that that I felt they didn't add much.


Codemirror is much more pleasant to develop with, and also (IMO) much better to use.


Great stuff. This is also the editor that is used in Light Table. I also use it in my pastebin. I evaluated ace for this purpose, but it turned out to be much more of a pain to use, though I can't remember the specifics of why. 4Clojure previously used Ace, but we switched to codemirror a while back.


How can I don't know about such great tools?!




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: