A Tour of Acme (2012)
research.swtch.com
research.swtch.com
I've been using Acme for about 15 years now, though. I dimly remember deep frustration when I was still learning it, but now that I'm used to it it's great.
Here's a screenshot that shows my typical work layout, although it's a little "manufactured" to avoid including any proprietary code from work: https://i.imgur.com/Trg79NS.png
Does the lack of "native" support for real-time linting, debuggers, formatters, etc get in your way? Did you manage to integrate such features in your workflow?
Here's a sample workflow: I'm hacking on some code in /home/john/foo. I have a directory window open in /home/john/foo, plus the files foo.go and foo_test.go open. I make some changes in foo.go, then in the directory window I type `go test`, select it with the mouse, and middle-click. This runs `go test`, creating an "Errors" output frame in the rightmost column. If the tests pass, this frame just says "PASS". If the tests fail, it'll say something like `./foo.go:27:10: undefined: xyz`. I right-click on `./foo.go:27:10` and Acme immediately takes me to that like in the appropriate file. I make a change, execute "Put", and then middle-click `go test` again to try the tests once more.
The delve debugger also prints line numbers that work with Acme. I run delve in an Acme terminal, and when I e.g. print a backtrace, I can simply right-click any of the line numbers to jump immediately to that code (Acme will open the file in question if it's not already open).
acmego will run gofmt and automatically add/remove imports as necessary every time you save the file, which is a huge convenience.
There's no syntax highlighting, which is a huge dealbreaker for some people. Personally, I find it distracting to watch huge swathes of my file change colors because I typed ", then change back as soon as I close with another ", so the lack of highlighting is great for me.
Edit: in my sample workflow above, I mentioned typing `go test` right in the directory window, but that's just ephemeral... you'll lose the commands if you refresh the file list, etc. A more permanent thing is to drop useful commands into a "guide" file in that directory; that way you can keep a whole suite of commands to run tests, run benchmarks, build & deploy, etc. right at your fingertips.
Edit 2: There's also a number of Language Server Protocol clients for Acme (see https://news.ycombinator.com/item?id=23782439 and https://github.com/fhs/acme-lsp) but I don't use them... I'm old-fashioned.
I find it curious that a higher-than-one dimensional representation of a program is not present: proper syntax highlighting makes debugging much faster.
Say, I want to see some expression with deeply nested parenthesis (lisp-style, or nested function calling in Python) is matching. I can do that with my eyes, checking the color of the beginning and the ending parenthesis. Same goes for, say, if I want to find a string in my program. I don't have to care about the quotation mark, I can just look at its color being different from the rest.
Executing commands with the mouse is heavily underrated and is a behavior I fail to faithfully replicate in i3 - or even Emacs, for that matter - but only if you guys had syntax highlighting...
When I need to check nesting levels, I use a little acme-trick: double-click on the closing mark (works for parentheses, curly brackets, quotes, probably more) and it'll highlight everything contained within that level. So if I type (some (big (lisp (expression)))) and want to make sure I got the right number of parentheses at the end, I just double-click on the last one and make sure the whole expression gets highlighted. Here's a screenshot: https://i.imgur.com/Qyvv2K9.png
I don't find I need to do it particularly often when writing Go, though, and if I do... well, I start to think about refactoring to make my function invocation less obtuse, or whatever.
* The name of a function being defined
* Comments
* String and character literals
The result is very calm [1], but I can still rely on colors to know orient myself and know when I forgot to close a string literal.
I’d enjoy seeing these parallel workflows happening, and seeing where Acme is a better <xyz>, or where it punts and has a completely different paradigm, besting your coworker (and vice versa).
But having to use the mouse for everything just drives me nuts. It's easier for my fingers to acquire even Emacs keybindings than it is for me to acquire the mouse and point at something with any precision.
I think that says a lot about the fundamental power of dynamic languages in general and Lisp in particular. Plan 9 is in a lot of ways the zenith (or … heh … acme) of what C and Unix can do. It is awesome, it is wonderful, it is better in every technical way than Linux or true Unix. But it pales in comparison to the hacked-together incomplete Lisp machine that is Emacs.
Imagine how much better off we would be with true Lisp machines on our desks and in our data centres!
(in my ideal world this 21st-century Lisp machine would actually take a lot of ideas from Plan 9, and even some from Emacs)
That's what Oberon, Smalltalk and even Emacs Lisp have that's not as good in Unix. Files full of plain text plus executables are a good foundation, but they're also quite unstructured and so is communication between them. Command line parameter parsing is an absolute nightmare. Whereas if you use a language directly, that's just function parameters and you're also not restricted to arrays of strings as your sole communication format.
Not that Emacs is doing all that it can with that, as it's usually used as an intermediary between a high-falutin' language environment and text files.
No, but it is on my list of things to look at when I get some free time. It sounds like another one of those tantalising might-have-beens.
One of my retirement projects will be to write an OS as it should be, given what we have learned from decades of research and use. I imagine that I will never complete it, but it will give me something to do with my time!
No way, acme is just ONE direction for Unix and C. Vi is another direction, as well as a ton of other editors that were made for Unix and C.
But I also disagree with you: acme is strictly more powerful than vi, and vim is just a Greenspunned Emacs. Greenspun's Tenth Rule holds that 'any sufficiently complicated C or Fortran program contains an ad hoc, informally-specified, bug-ridden, slow implementation of half of Common Lisp'; I contend that vim is an ad-hoc, informally-specified[0], bad-taste (seriously, have you ever looked at Vimscript?) reimplementation of Emacs's functionality.
It does, however, have better keybindings than Emacs does by default.
0: outside of the POSIX stuff it gets from vi, that is
That evidence of keys being faster than the mouse are old?
Why would the speed change over time? It's measuring the human, not the machines; and we are no faster.
But we don't need to go that far. I mean, when you were testing during the development of the Mac, it was what, 1983? The mouse was a new thing, CUA didn't exist yet, I doubt that many vim and emacs users were part of the target group.
I doubt that speed changes if you test the same demographic as back then, although it's harder to find people as unaccustomed to mice.
In addition, has there ever been a test that includes mouse chords as used in Acme/Oberon?
As for key binding, it’s pretty easy to add that as external tools, thanks to the 9p interface.
Up and down can't work, because acme was designed for proportional fonts, and many of us acme users use proportional fonts. Up and down are not well defined/not useful with proportional fonts.
It can work with proportional fonts. Word for instance defines it well enough to be useful. Rather than down taking you to the same column on the next line, it just takes you to the character rendered at a similar x coordinate on the next line.
I'd use such a feature if I had to fill a table, and wanted to move to the same column on a different row. But with proportional fonts, the columns don't line up. So yes, it can move to the same x coordinate, but why is this useful?
It's useful for general text navigation, and writing code is an instance of that.
> I'd use such a feature if I had to fill a table, and wanted to move to the same column on a different row. But with proportional fonts, the columns don't line up. So yes, it can move to the same x coordinate, but why is this useful?
"Doesn't work well for use case X" != "not useful [in general]"
If your text is laid out assuming fixed-width fonts, and it's important for you to move to the same column in a different row, then just use fixed-width fonts and the method I described would work as you expect.
Acme is opinionated and it’s a good thing if it fits its userbase. I am actually quite fond of many design decisions and maintain patches to workaround defaults that could drive me insane.
My personal feeling is negative on this matter, just as if I would need to reach to the mouse to delete a character. Up and down mapped to something like page up / page down feels as infuriating as those website that hijack scroll and back button.
however I still think acme is a conflagration of confusion. It has programs, inside of it, it's a text editor, a terminal, but breaks the interface of /dev/draw so it doesn't properly multiplex by rio.
Often stated, and I imagine to be true, acme was to be a full replacement for rio almost, but it ends up falling short of that.
However, I have been maintaining a set of patches, including up/down and additional goodies such as bindings for save, copy, cut, paste. Some of them are actually hard coded for Mac (cmd modifier), but not for Linux. It’s workable.
The golang port, edwood, features the same limitations, in my opinion.
What I'd probably most appreciate in Acme is a shortcut equivalent to / in vi, for those situations where I can see a bit of text I want to get to and it'd just be faster to hit (hypothetically) Ctrl-J and type a few characters vs grabbing the mouse. But I don't miss it often enough to go hacking the source :)
Maybe I am an incorrigible arrow addict !
There’s a patch to jump to the bar from the text using a keychord, to type and right click, as an alternative to “/“.
Some that stuck out were using filenames plus regexes or line numbers to create links in text files, a text file that is also a shell session, things that have been done in vi/emacs but this editor is mouse-centric so it looks very different.
I would add to your list:
- acme is complemented by the plumber, which acts according to user defined rules when receiving a text selection (and context)
- anything in acme is text, which is editable. Menu bar, buffers, shell window... the editable dumb terminal is great.
- acme features a 9p fs "api" to access its state, and modify it, with any program. Go is first class citizen.
Acme cannot be used though ssh in a terminal nor on a iPad though :)
Sure vim is a vastly superior text editor and acme is a better "integrating" text environment. Something as different as a Jupyter notebook.
As for vim limits: poor mouse support, window management, plumber support, notebook like features (emacs org Babel), editable interface, jump to /path/to/file:/search pattern/ and other Sam expressions ...