A Chat with Brian Kernighan

Arguably, the third most famous member of the Unix pantheon is Brian Kernighan. Although he did not, in fact, work on the development of the C language (he was the co-author along with Ritchie of the definitive book on C) his contributions were significant and seminal. I think of him as the ultimate tool builder—I have no idea if he would embrace that description—and master of the Unix Way™. After K&R, he’s probably best known for awk, a little language that is still in use today and has devoted adherents.

In a recent Computerphile video, Kernighan and Professor David Brailsford sit down to talk about Kernighan’s career and what it was like to work at Bell Labs in the glory days.

Kernighan talks about the introduction of pipes into Unix and the dramatic difference it made in the way people thought of and performed computations. In some sense, pipes were a necessity. Memory was in such short supply in those days that you pretty much had to stitch together a bunch of small programs to get things done.

If you’re at all interested in our shared history—and you should be—you will want to watch this video. It’s a bit over 28 minutes so you’ll have to schedule some time but it’s well worth it.

UPDATE: Added link to video.

Posted in General | Tagged | 4 Comments

Video on Using Org Mode for Your Init File 2

Two weeks ago, I wrote about Daniel Mai’s video on writing your Emacs configuration as an Org file. He showed how to organize your configuration in a literate programming way. Now he has a second video that ties everything together by showing how to load the configuration in the Org file when Emacs starts.

The idea is to use init.el as a sort of boot loader that does a small bit of preliminary initialization and then loads the config by calling org-babel-load-file. The files are set up so that he can drop this small init.el and his Org configuration file onto a new machine and have it download all his packages. If you find yourself setting up new Emacs installations frequently, that can be a big time saver: just pull the two files from some repository, start Emacs, and everything gets taken care of for you. Very nice.

The video is just 5 minutes, 15 seconds so it’s easy to watch during a coffee break. As I said in my previous post on this series, if you’re thinking of refactoring your Emacs configuration, consider making it an Org file and using Mai’s technique to load it.

Posted in General | Tagged , | Leave a comment

Emacs for Creative Writers

Yesterday I wrote about Emacs for Social Scientists so it’s only fair to mention how creative writers can benefit from Emacs too. I written about this before, of course, more than once but Balle over at I Love Emacs, has a post with some useful pointers for creative writers. He mentions Randall Wood’s guide and cheat sheet that I mentioned in the above post as well as a video on how to export your Org mode to the doc file that your publisher will surely insist upon.

It’s a nice post and worth a read if you make your living writing words and would like to do it in Emacs.

Posted in General | Tagged | Leave a comment

Emacs for the Social Sciences

Ista Zahn of Harvard’s Institute for Quantitative Social Sciences is a long time Emacs user. A year or so ago, a user asked for an Emacs configuration with a specific set of features and Zahn realized that his configuration already had most of what the user wanted. They got together and produced a configuration aimed at Social Science users.

As you might expect, the configuration is heavily slanted towards LaTeX, git, R, Stata, SAS, and Julia. If you follow the link to his dotemacs GitHub, you’ll see that the README (available as markdown and Org) is a nice discussion of what the configuration is trying to do as well as the actual implementation.

If you’re in the Social Sciences and tired of Word and other soul and energy sucking software, be sure to give Zahn’a configuration a try. As many others before you have found, Emacs will make you more productive and probably lower your blood pressure as well1. Even if you’re not a social scientist, you may find something useful in the configuration—many of us write in LaTeX and use R, after all.

Footnotes:

1

Well, at least after you get past the initial learning curve.

Posted in General | Tagged | Leave a comment

Wrap Region

Ben Maughan over at the excellent Pragmatic Emacs has a nice post about the wrap-region package. The idea is that you can arrange to wrap highlighted text with beginning and ending characters. For example, if you’re a C programmer you can arrange for / to wrap the highlighted text in /* and */. If you’re an Org mode user, you can use it to add the markup characters such as /, *, =, and ~.

Take a look at Maughan’s post to see how it works and how to set up your own wrappings. As Maughan points out, this composes nicely with Magnar Sveen’s expand region package. If you often find yourself adding wrapping characters after the fact, this package may be a real help.

UPDATE: *\*/

Posted in General | Tagged | Leave a comment

Remembering Dennis Ritchie

Jason Perlow over at ZD Net has a nice piece on Dennis Ritchie. Ritchie died a four years ago, about the same time as Steve Jobs. Everyone knows who Jobs was but most of the population—and sadly, some of our community’s younger members—don’t know who Ritchie was.

As Perlow recounts, almost none of modern computing would exist today if it weren’t for Ritchie’s work. Although his contributions were legion, he is mainly remembered as the inventor of C and the co-inventor of Unix.

It’s hard to overestimate either. Although many who haven’t bothered to learn it like to mock it as a latter day COBOL, C is, in fact, behind almost all the important software we use. Even “modern” languages like Python and Ruby take inspiration and syntax from C and are implemented in it. If you’re a Unix or Linux user, your operating system is written in it. If you’re a Windows user, your operating system is written in C’s unlovely child, C++. If you worship at the Church of Apple, your operating system is written in another C derivative, Objective C.

One of the most important contributions of C was to provide a portable systems language. Before C, almost all system software was written in the assembly language of the host machine. It was C that made Unix a portable operating system that ran on multiple hardware platforms. None of this would be possible without Ritchie’s C.

Unix, of course, has been so successful that Rob Pike once gave a talk bemoaning the fact that it had essentially killed operating system research. Even Windows, its archenemy for many years, has incorporated large parts of Unix. Today Unix is seen mostly on big iron providing back end processing but it lives on in smaller machines in the form of Linux. These days, any youngster can get a cheap computer, put Linux on it, and have a world class computing environment. At the same time Linux is powering much of the Internet so Unix’s influence extends to all of modern computing. Again, none of this would have been possible without Dennis Ritchie’s work.

Before he died, Ritchie was always adding interesting things to his Bell Labs Home Page—which Bell Labs still maintains—and I remembering checking it regularly for his latest offerings. Give Perlow’s article a look and celebrate one of computing’s heroes.

Posted in General | Tagged | Leave a comment

More Hydras

Speaking of hydras, as we did yesterday, Eric James Michael Ritz has a nice post on some of the hydras he uses. If you’re looking to see some good ways of using the hydra package, Ritz’s post is a worth taking a look at.

He begins by reconsidering abo-abo’s hydra to zoom the Emacs screen by adding a reset option and choosing keys that are more consistent with the default sequences. He has several other hydras that do things like navigate Org buffers, page breaks, and flycheck reports. He also has hydras for things like the Avy functions.

You’ll almost certainly find something useful for your own workflow in the post so it’s well worth taking a look. If you aren’t yet using the hydra package, I urge you to consider installing it. It’s just the thing for easing and speeding your workflow.

Posted in General | Tagged | 1 Comment

Navigation Hydras

John Kitchin has a couple of nice posts on building hydras to ease navigation. In the first, he considers commands that might be classified as “gotos.” They are in the isearch mold. About half of these are from the Avy package. The others make use of helm functionality. In a sense, none of this is new but adding them to a hydra means that you need remember only one key sequence to bring up the hydra menu. If you use a key chord such as 【Super+g】 as Kitchin recommends, then all these commands are only two keystrokes away. That’s pretty handy. Of course, you can still use whatever keystrokes you have assigned to them already, if you prefer, and use the hydra for the less used ones that you can’t remember the key sequence for.

The second post is mostly about “small” cursor movements: move by character, word, lines, paragraphs, etc. This hydra uses standard Emacs cursor movement commands and thus doesn’t require any add ons. The advantage of the hydra is that it makes these commands reachable in a couple of key strokes. Most experienced Emacsers will already have them burned into their muscle memory.

There’s a metapoint to be made here. Steve Yegge changed my life and the lives of countless others by recommending the use of isearch as a navigation tool. The introduction of ace-jump-mode (later replaced by avy) was a refinement of that technique: ways to get your cursor where you want it quickly and easily. They’re all about optimizing your navigation through the text you’re working on. All of the commands that Kitchin captures in his hydras serve this same purpose. It’s definitely worth taking a look at these two posts and using whatever parts you find useful for your workflow.

Posted in General | Tagged | Leave a comment

Emacs for Writers

Regular readers know I’m fascinated by the stories of professional writers who use Emacs. I’ve written in the past about Vernor Vinge, Tony Ballantyne, Randall Wood, Urpo Lankinen, and some non-prose writers who use Emacs for their writing.

Now Jay Dixit, a science writer, has given an excellent talk at the New York Emacs Meetup on Emacs for Writers. Dixit, who is not a programmer, talks about his long search for the ideal editor for writing. He tried all the usual suspects—Word, Scrivener, WorkFlowy—but none of them did what he wanted: an outline in the left hand pane and editable text in the right hand pane all of which was manipulable from the keyboard.

After spending some time in writers’ forums, someone finally told him he could do what he wanted with Emacs, Org mode, and indirect buffers. As a non-programmer, it took him some time to get things configured appropriately but now he has the exact setup he wanted.

The second half of his talk demonstrates how he uses this functionality in his writing. As usual, his particular workflow may not be precisely what you’re after but he’s got lots of good ideas and shows that even someone without programming expertise can get Emacs configured to his liking. If you’re a writer and tired of Word, take a look at Dixit’s talk to see if his ideas make sense for you. Don’t worry about having to deliver your manuscript in Word; that’s easily handled.

The talk is just over an hour so you’ll have to schedule some time.

Posted in General | Tagged , | Leave a comment

Lisp Performance

One of the tiresome things that Lispers keep hearing from the misinformed is that Lisp systems are too slow for production work. Here’s a very impressive counter example to that notion.

JCG over at the Racket Users forum reports that he rewrote a 2,000 line C++ program in Racket Scheme and saw a 20% speed increase. More importantly, I think, is that new server was only 700 lines of Scheme.

So faster, shorter. What’s not to like? JCG does say that the memory footprint is significantly larger (300 megs versus 60) so there is a downside. At least there’s a downside if you’re worried about a 300 MB memory footprint. These days, most of us probably aren’t.

Posted in General | Tagged , | Leave a comment