My quick review of Acme

A few weeks ago, Russ Cox released a tour of Acme, the Plan 9 editor written by Rob Pike. Since Acme looked so different from what I was used to, I installed Plan 9 from User Space and tried Acme out. Here are some quick thoughts on the interesting text editor. I should note that I have used Acme for maybe a week, and during that time, I was not using it exclusively, and I did not have a real mouse, only my laptop trackpad, so this certainly influenced how I perceived it.

Minimalist

If there is one adjective that comes to mind when using Acme, it’s “minimalist”. Everything about the editor is reduced to its barest minimum. The interface has no menu, no context menu, the scrollbars don’t have little arrows at both ends, the “toolbar” doesn’t use icons, but words, and the color scheme is very reminiscent of the early 1990’s. The editor is not only minimal in its interface, but also in its functionality: it has 28 commands internal commands, the rest of the functionality is provided by external programs.

From the original paper on Acme, this is by design. Rob wanted the program to be out of the programmer’s way. I don’t know if it’s my own habits using Emacs extensively, but I found that Acme was more in my way, mostly because it destroyed some of my long-held habits about editing text. The focus of the project was to make an editor, and anything else that the programmers wanted, they could write external programs and call them.

You probably won’t find anything in Acme that you don’t need, because there is so little. Also, you can probably know most of there is to know about the editor in an afternoon by reading the man page.

Absent features

I won’t call this section “missing feature”, but let’s look at some common text editor functions that Acme does without:

  • Syntax highlighting: all text in Acme is black. It won’t highlight your string literals in one color and identifiers in another. Acme’s proponents claim that the colors distract them.
  • Indenting according to mode: editors such as Emacs and vim allow for automatic indenting that is done according to the style of the languages they support. In Acme, automatic indentation simply copies the indentation of the line above. If you want to indent in a way that’s different from what the Tab key offers, you need to do it yourself.
  • Keyboard navigation: I’ll discuss this further in the interface section, but pressing the Up arrow on your keyboard does not move your cursor to the previous line as you would expect. In fact, there are only 5 keyboard shortcuts.

There are other features that Acme has, but implements in different ways. Searching is quite different, going to a specific line as well. It can’t edit a remote, it can’t spell check a document or count its words, you can’t display line numbers, etc.

Interface

I won’t go too much into details, but let me talk a little about the interface of Acme. First, it’s aqua and yellowish; all windows are separated into two parts, a tag and a body. The body contains the text of a file and has a yellowish background; the tag is a scratch space with some commands associated with that file and it’s aqua. These colors cannot be changed without editing the Acme source code. The scrollbars are brownish, and don’t work as you expect them. Left-clicking will scroll up, no matter what, and right-clicking will scroll down. If you want to go to a certain position in the file, you need to middle click on the scroll bar. The amount that left-clicking and right-clicking scroll up/down depends on how far up the bar you are. Near the top, and they scroll line-by-line; near the bottom and it’s page-by-page.

Beyond what the interface looks like, the most important thing about the Acme interface is that it’s mouse-driven. As I said before, there are only 5 “standard” keyboard shortcuts; for everything else, you must use your mouse. If you want to write something on the line above your cursor, you reach for your mouse, click on the line and start typing. You cannot use the Up arrow or Ctrl+P. Saving is done by middle clicking (I’ll get to the middle click part in a moment) the command “Put” in the tag of the file, no Ctrl+S’ing every 8 keystrokes. Of course, cutting, copying (called snarfing in Acme) and pasting are all done with the mouse, using mouse chords. Mouse chords are going to be familiar to people using the Opera web-browser or using one of the mouse gesture addons for Firefox and Chrome. Basically, but holding down one button of the mouse, and clicking another one, you can perform different actions. Here are the two most important:

  • After selecting some text by holding down the left button, keep it held down and middle click to cut the text.
  • To paste text, hold down the left button and click the right click.
  • If you combine these two actions (Select text, keep left button held down, middle click, right click), you copy text.

This way of manipulating text is certainly different from what I’m used to, and since I don’t have a three-button mouse, but only my Thinkpad trackpad, it was extremely awkward to do those chords. I’m guessing that it’s a little better, but still awkward with a 2-button mouse with a scroll wheel that you can click. It really looks like you need a 3-button mouse if you want to be able to manipulate text easily and without pain.

Speaking of the mouse, the three different buttons have different functions. The left button selects text and positions the cursor (as we’re all used to). The middle button is used to execute commands; you either select some text and middle click on it, or you middle click on a word, and it’ll be executed. If the word/selection is not recognized as an Acme command, Acme will try to execute an external program. The right button is used mainly to open files (if the selected text/word under the cursor looks like a file name) and will search otherwise. In his tour of Acme, Russ showed that it can be extended to do other things, but I was not able to configure my own Acme installation in this way.

Acme separates its workspace into columns, and you can split those columns into windows which will contain actual files. The management of these windows is done with the mouse, of course, and I found it to be pretty efficient and easy. Acme also tries to be somewhat intelligent when it opens new windows, acting as a mini window manager in that respect. This management is efficient and minimal enough that I would really like to see it ported to Emacs.

Executing commands

In Acme, all text can be executed. If you look at the screenshot above, you can see in the lower-left corner the command I used to create the screenshot. I simply typed the command into an empty window, selected the text and middle clicked. Any text, anywhere can be executed that way. If you are going to be using a command often, it may be a good idea to put it in the tag of a window so that it is readily accessible.

You can also use the usual redirection operators from Unix as well as the pipe. For example, if you had a list of names, and you wanted to sort them, you would write |sort somewhere, select the lines you wanted to sort and middle click the command and the lines would then be ordered. If you wanted to insert the current date, you’d write <date and middle-click and the command would be replaced by the date. Finally, if you selected some text and clicked on a command that looked like >cmd, it would run the command with the selected text as input, and the output of the command would be displayed in a new window.

The ease of running commands on text is one of the reason that Acme can be kept so minimal. Why write an editor command to reformat C code when you can simply call indent on the content of the file? I find this strategy to add functionality to an editor extremely interesting (and correct me if I’m wrong, but doesn’t Textmate do something similar?) and other editors could certainly learn from it.

Things I didn’t get to try

If you watch the Acme screencast, you’ll see that Acme can have its own mount point and that all the information about the state of the editor is contained in that directory and can be manipulated to directly affect the editor. Russ showed how his “Slide+” command uses this facility. Unfortunately, I was not able to get Acme to mount properly, so I was not able to explore this feature, but certainly this is very cool. By exposing its internals through a file system and not an internal API, it is possible for external programs to modify the editor; using this ability, it is possible to write Acme “plugins” in pretty much any language we want. I feel this goes a really long way towards making the editor extremely extensible while keeping it very simple.

Another thing I was not able to play with is the right button capabilities of Acme. I was able to search, open files, open files at certain line numbers (if the file has the format file.c:16, Acme will open file.c at line 16), but I was not able to track my UPS orders or open man pages this way. I think this functionality depends on Plumber, a Plan 9 facility, but I’m not sure.

Closing thoughts

Acme is certainly very interesting, it has some great ideas and is really snappy. I don’t think it’ll replace Emacs as my main editor any time soon, but I’m hoping that maybe during Christmas break I can try to use it for actual programming for a while, and see how I like it. I’m guessing that it won’t be a success as I have some very deeply ingrained habits, but nobody ever died from trying to do things in a different way.

I’m also hoping that some Emacs über-hackers look at Acme and find some things to steal!

About these ads

8 thoughts on “My quick review of Acme

  1. Select a word or some other “extent” of text in Acme, then hit backspace. Or hit left arrow or right arrow. The behavior is different from the behavior that has been standard on most Windows, Mac, Gnome or KDE applications written in the last 25 years including Firefox and Chrome. (Acme deletes the selection, then deletes the character before the insertion point whereas all of the Windows, Mac, Gnome and KDE apps just delete the selection. Well, it is worse than that because if you select the entire buffer and hit backspace, left arrow or right arrow, you get an error (nothing happens), which is clearly less useful than the standard behavior.)

    Although the difference might sound subtle, it would probably slow a person new to Acme down quite a bit because it is so surprising to someone used to the way Windows, Mac, Gnome and KDE do it. Swapping the A and S keys is also a “small” change, but it would slow you down a lot.

    It would also slow down someone who switches between the Plan 9 ecosystem and one of the other ecosystems (e.g., Windows, Mac, Gnome or KDE) — and that constitutes almost every potential user of Plan 9 software.

    The exception was the researchers at Bell Labs — they could remain in the Plan ecosystem all the time — so they DID NOT CARE that others would be slowed down and stymied by Plan 9 insular way of doing things.

    This is the fatal flaw of the Plan 9 ecosystem: it is so tiny and limited (not even having a web browser capable of viewing most modern web pages) that anyone who enters it will also have to keep one foot in some other ecosystem, but Plan 9’s designers and maintainers have no interest in attending to those little details that other ecosystems attend to that makes things smoother for newbies or “ecosystem part-timers”.

    The fatal flaw of Plan 9 in other words is an almost complete lack of any ethic of HOSPITALITY. Plan 9 has a much better reputation among Hackers than it deserves to have IMHO.

    So, one more example to drive the point home. The way you create a new window in Rio is to activate a command (“New” I think it is called) which does nothing but change how the mouse cursor looks. Then if you drag the mouse, a window is created with one corner where the drag action began and the opposite corner where the drag action ended (i.e., where the user released the mouse button). Well, I suppose that might be a SLIGHTLY more efficient way of creating a new window than the ordinary way (in which a window shows up immediately and the you drag the title bar or a corner or an edge to get the position and the size of the new window the way you want it), but for newbies and part-timers (which again represents essentially EVERYONE who is considering letting Plan 9 into their lives) the slight increase in efficiently is not worth the substantial increase in initial learning curve or IMHO having to keep on one’s toes because the Plan 9 way is different from the way everything else works.

    • You really need to put Plan 9 into historical context before you criticize its user experience too harshly. It was originally written in 1992. Inferno was started in 1995, taking the key developers away from the project.

      1995 was the year that Windows 95 was released & the Windows GUI & its conventions became commonplace. In 1995, Mac OS was firmly attached to a single mouse button & still didn’t have preemptive multitasking. Neither KDE nor Gnome had even been conceived & the state of the art of Unix desktops was CDE. The web was still in its infancy & Netscape was still just a bunch of patches to Mosaic & IE wasn’t even on the table (even proper TCP/IP was rare on PCs). Prior to 1995, most computer users were still using console interfaces or, if they wanted bitmapped graphics, single applications that each had their own home-grown GUIs & conventions.

      In 1992, releasing a multitasking OS with a fully integrated, always on, GUI was still a big deal. Doing so while retaining all the power of a Unix-like shell was an even bigger deal. In these days, prior to Windows World Domination & x86 CPUs being performance leaders, it wasn’t uncommon for the hardware & OSes being used for Real Work to be different than those used for mere desktops. VMS and AS/400 were still market leaders & the Unix Wars were still going on.

      This isn’t to say the Plan 9 is perfect, it’s far from it. It’s a fairly minimal, experimental, industrial OS – never really intended for widespread consumer consumption (and probably never once had a UX or graphic designer ever look at it). It’s rough around the edges & you should probably wear a hard hat if you’re using it. What people get romantic about is the (still novel) ideas that underlie the system & how it represents a rethinking of Unix – the OS many of us still use today.

    • So basically, Plan 9’s fatal flaws are “it’s not like Windows, Mac, Gnome, or KDE” and “it doesn’t have a web browser”? Sounds fine to me.

      • I would say that it’s ‘fatal flaws’ were that it never made any effort to be easy to use, and it’s web browser was barely functional after the late 90’s – and that it’s owners decided to let it wither on the vine.

        I used Plan9 in the early days; the standard advice for new users was ‘read these 4 papers about the design of the system’. They were very interesting papers, if you we’re interested in os or ui research, but they were never intended to teach. Not having a full or even weak web browser during the launch and ascendency of the web WAS a huge deal (inferno with Charon was the closest you could get). That alone caused most curious newbies to eventually retreat after playing; few ever became comfortable enough with Plan9 for it to stick.

  2. Some things you might like to look at:

    Wily, an Acme look-alike written from scratch for Unix systems. The look and feel is Acme, but there’s an API rather than a Plan 9 file system

    wmii, an Acme-style window manager for X (I haven’t used this).

    9vx, a sandboxed version of the Plan 9 kernel that runs in a Unix userland and is considerably more lightweight than regular VMs. Be sure to load a regular Plan 9 file tree on top of the minimalist one that 9vx supplies.

  3. I use the plan9 wm on linux, and love it. for a few years before I was using fluxbox, which was simplistic, but not as simplistic as I would like. I have been using it as my window manager for about 2 years now, and have written many extensions to my system built around it’s brand of functionality.. the ideas from plan9 are solid, but you have to be very much open to change.

    I don’t think any of the plan9 “ecosystem” are for the “new_user”, since if you are using any of the more “slimmed down” wm then you are no doubt at the command line for most of the day — which leads me to the fair assumption that you know what you are doing. which negates most of the complaints. If you don’t like the way it works rewrite it; and if you can’t rewrite it/modify it, then you should probably be using KDE, GDM, etc…

    • >I don’t think any of the plan9 “ecosystem” are for the “new_user”

      I meant users new to Plan9, not users new to computing.

      I have not used the plan 9 wm on Linux. My objections might not apply to it. It does apply to Acme.

  4. Pingback: Using Acme | Irreal

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s