Thursday, June 28, 2012

Chocolat 1.0

Chocolat is a new programmer’s text editor. I’m not tempted to switch from BBEdit, but it does have some interesting ideas. The language support seems to be wide but shallow. The demo animation shows Haskell, Erlang, and Lisp. It even supports my beloved reStructuredText. Yet, for a common language such as Objective-C, the symbol list doesn’t include the methods—just C functions, defines, and the like.

7 Comments RSS · Twitter

The name of the app is actually 'Chocolat' without an 'e' ;-)

(probably because they decided to use a French word for the app name).

Yeah, doesn't seem quite there yet for me either. The features that look appealing are ack integration (I use full-ack in Emacs, but it's kind of clunky, or more commonly just use it from the command line) and documentation integration (though these days I use Dash, which is rapidly improving).

In the past few months, I've gone from about 95% Emacs and 5% BBEdit to 85% Sublime Text, 5% Emacs (for diffing/merging and version control integration) and 5% BBEdit (for its multi-file search/replace and some Text Factories I haven't ported anywhere else.) Sublime Text 2.0 final was just released; it's worth checking out. I never thought anything would break me from 16 years of Emacs use, but it did it.

@Nicholas Were you using Emacs in Terminal? Or via X11? Sublime also seems to have little in the way of method navigation; it’s a small window with no indentation.

I'm using the native Mac version of Emacs, specifically Mitsuharu Yamamoto's "Mac port". Despite being really beautifully done and nearly perfect in my estimation, it's been marked as "experimental" for ages, so it was only available from his FTP site. There's now an unofficial Git mirror here, which is a bit easier to use:

https://github.com/railwaycat/emacs-mac-port

Sublime Text has terrific method navigation, including indentation. I still use Xcode (3) for Objective-C, but I use Sublime Text for Python, JavaScript and other Web stuff. If you look on the main page of the Sublime Text site, item 5/6 in the graphical tour shows navigating in a Python file with nested functions, or here's an example of something I was doing this afternoon:

http://sabi.net/temp/sublime.png

@Nicholas I like the live filtering of the list, but I couldn't find a way to drag the list taller (to browse rather than search), and there was no indentation for Objective-C.

Ah, yeah. I essentially never use browsing for method names. There's an Emacs feature for it (Speedbar) which I've tried many times and never found useful. In Xcode I do use the method popup (though I really dislike the filterable menus in Xcode 4, which preempt the type-selection behavior)—but I never use the class browser.

You might find some use in folding everything then using the source code file itself for browsing (e.g., Command-K, Command-1). Unlike Xcode you don't have to have the insertion point on the fold marker itself to unfold (why is that still not fixed?), you can unfold from anywhere on the line.

The language definitions are just plists — they're a derivation of what TextMate used (incidentally, I never really liked TextMate). They're primarily declarative — a bunch of regular expressions and nested scope definitions. The scopes they match can be used outside the definition itself to restrict autocompletions, in Python code, etc.; they're amazingly useful. If you press Command-Option-P at any point in the file you'll see the matching scopes displayed in the status bar.

This is one reason Sublime Text is so fast at syntax highlighting, unlike the more imperative model of Emacs. I think BBEdit's codeless language modules are similar if less flexible, though I've never poked around them.

Looking at the Objective-C support, it definitely looks incomplete. The method list lacks the +/- prefixes and seems to lose everything after the first colon!

The lack of resizability has bugged me once or twice but it never really bothers me much day-to-day; I imagine it's coming, this is really just 1.0.

Leave a Comment