Use The Profiler!

For the last year, Matus Goljer (fuco1) has been working on a static analyzer for Elisp. Although still in its early stages, the project is promising and I’ve been following it with interest. Goljer has made good progress and can now analyze the main file in the smartparens code base. There was a problem, however.

It was slow. Very slow. Analyzing smartparens took about 42 seconds even though the smartparens.el file is only about 9500 lines. Goljer was expecting it to be a bit slow because he used EIEIO and CL generics. While they’re a natural fit for the problem, they have notorious performance issues. What to do? Goljer did what we all do: he assumed the problem was with EIEIO and generics and started changing his code. That turned out to be a mess so he did what we all promise ourselves we’re going to do in situations like this but rarely actually do: he fired up the profiler to see were all the time was going.

The answer was surprising. The problem turned out to be in a function that he would never have thought would cause difficulties. I won’t spoil the surprise by telling you what it was; you’ll have to read his post to see. In any event, he replaced the problem function with some code that accomplished the same end and reduced the running time to 5 seconds.

The moral here is what it always is: don’t assume you know where all the cycles are being spent. You’re probably wrong. Almost every environment has a profiler and they’re the go-to method for determining where your application is spending its time.

Be sure to take a look at Goljer’s post. It’s an interesting story and a nice illustration of the power of profilers.

Posted in General | Tagged | Leave a comment

Emacs for the CEO, Part 2

Almost three years ago, I wrote about Josh Stella, a former programmer who had become the CEO of his company. Stella found that he really hated all the context switching required as he moved from application to application. So he decided to return to Emacs but as a CEO rather than technical user. His original post discussed why he was doing that and what his experience was like.

Now, Stella is switching roles and becoming the CTO of his company and decided to revisit his Emacs post in light of the 3 years experience he’d had using it as a company officer rather than one of the technical staff. All-in-all, he concludes that the experiment was successful and that using Emacs made him happier and more productive. He liked the way Emacs stayed out of his way and wasn’t constantly demanding his attention.

He also liked that Emacs was more ergonomic than other applications. We Emacsers don’t often hear that but Stella says that using an ergonomic keyboard combined with a much reduced reliance on mouse operations cured the RSI problems he was having. He discusses that at some length so if you’re an Emacser who’s suffering from RSI problems, you should take a look at what he did.

He also wrote that he gave up trying to use Org mode to keep his calendar and TODO lists. That, he said, was because he shares that information with many people who weren’t Emacs users. There are, of course, packages that move entries between Emacs and Google/Apple calendar but he decided it was simpler to just use Google calendar like everyone else at his company.

The post is an interesting retrospective on the experiences of a CEO using Emacs and well worth a read.

Posted in General | Tagged | Leave a comment

Emacs Podcast

Rakhim Davletkaliyev is a new Emacs user who has decided to document his journey into the world of Emacs with a series of podcasts. Using a podcast for this might seem like an odd choice given that the subject matter is intrinsically visual but it turns out to work pretty well.

So far, there are two podcasts. The first doesn’t really discuss Emacs but serves as an introduction to Davletkaliyev and why he’s making these podcasts. Davletkaliyev is an experienced developer who uses Sublime in his day-to-day work. Lately, though, he’s been experimenting with Emacs and learning how to use it effectively. He’s still in the learning phase and not even certain he’ll switch in the end.

The second podcast is about his configuration. He’s already using an Org file for his configuration but, so far, has loaded only a few packages. This is in keeping with his experimental approach to Emacs; he trying things out and seeing what works for him.

One of the most interesting aspects of his configuration is his choice of key bindings. While he’s pretty much content to go with the defaults, he made some choices that I never would; you can listen to the podcast to discover what they are. This merely shows that Davletkaliyev has discovered early on that Emacs lets you have it your way. He can make what you or I might consider outlandish choices without affecting the rest of us.

The podcasts are 21:59 and 25:26 minutes long so you’ll need to schedule some time if you’d like to listen.

Posted in General | Tagged | Leave a comment

The Machine that Builds Itself

Bohdan Khomtchouk, Edi Weitz, and Claes Wahlestedt have an interesting paper that argues for the use of Common Lisp in bioinformatics and computational biology. Lispers will recognize Weitz from his many contributions of outstanding Lisp packages, including the unrivaled CL-PPCRE for regular expressions.

The paper makes the case for why Common Lisp is an excellent choice for developing software in bioinformatics and computational biology. Oddly, though, you could apply those same arguments to most fields, an indication of how flexible and useful Lisp can be for developing serious software.

The authors believe that the biology/Lisp community is set to take off and expect that it will soon reach critical mass. Those of us who are Lispers can only hope that’s true. In any event, if you’re a Lisper or wondering why you should become one, take a look at the paper; it gives plenty of reasons and you don’t have to know anything about biology to follow their arguments.

Posted in General | Tagged , | Leave a comment

Another Emacs/Vim Survey

If you care about this sort of thing, there’s (yet another) survey on whether folks prefer Emacs, Vim, or something else. I wouldn’t bother linking if it were just another “what do you prefer” quickie but the poll asks additional questions and the results are summarized in a spreadsheet.

As I’ve said many times, the best editor is the one that works for you. Depending on what you’re looking for, that may be Vim or it may be Emacs. It may even be something else. Still, these polls can be fun if only to validate what we already believe or to provide another example of how worthless these polls are.

Posted in General | Tagged , | Leave a comment

Keyboard Macros: A Reason to Use Emacs

Bill over at ATMakers has a short video on Why I Use Emacs. He’s a long term user and the reasons are many, he says, but the video is just one example showing how Emacs can make repetitive tasks easier.

The problem is that he has a list of two columns that he wants to mark up with HTML. The video shows how to do this using keyboard macros. It’s a natural solution and the video shows how easy it is. To be sure, it’s an elementary application of keyboard macros so the video is most suited for someone asking “Why do you use Emacs?” Still, even more experienced folks may enjoy it.

The video is only 6 minutes and 15 seconds so it should be easy to find time to view it if you’re interested.

Posted in General | Tagged | Leave a comment

Solving 10 Common Git Problems

Michael Kohl has a post on 10 Common Git Problems and How to Fix Them that new or casual Git users may find useful. There’s a lot of useful information in the post so it’s definitely worth reading.

Unfortunately, for technical reasons all his examples are links to gists. Each example is typically 2 or 3 lines so it would have been easy to just to copy and paste them directly into the post. But that’s just a nit. Unless you’re a seasoned Git user, you’re apt to learn something from the posts even if you have to follow links to see the examples.

Posted in General | Tagged , | Leave a comment

Using Emacs at School

Over at the Emacs reddit, shackra asks if people use or used Emacs at school. By “school” he appears to mean “at college or university” so this isn’t about whether we should teach 8th graders to use Emacs. So far, there have been only a few (eight as of this writing) answers but the discussion is already interesting.

The thing that struck (and delighted) me the most was that all but one of the commenters were from disciplines other than computer science. The one developer was Mickey from Matering Emacs so, of course, his answer is interesting too. There was also a physics major and a civil engineer representing the technical fields.

The other respondents were from History and English. It’s not news that people from the liberal arts use Emacs too, of course, but even though I know better I’m always surprised. Of course, I shouldn’t be. Folks in fields like English and History do a lot of writing and probably wrangle just as much or more text than we engineers do. Why wouldn’t they want to use the best possible tool to do that? There are plenty of people in those fields—just as there are in ours—who are too lazy or unconscious of the possibilities to look beyond the default answer of Microsoft Word but the wiser of them invest a bit of their time in learning a tool that will pay dividends throughout their career rather than frustrate them at every turn.

The nice thing about using a tool like Emacs is that although the gatekeepers at journals and professional organizations insist of Word documents, you can still use a decent editor and export to the desired format with Pandoc. Of course Pandoc doesn’t convert between every possible format but it does accept Org Markup, Markdown, and LaTeX and will happily output docx formatted documents, which is probably the only target that non-STEM people need to worry about.

So the answer to shackra’s question is: Yes, Emacs is used by people at school all the time and some of their uses may surprise you.

Posted in General | Tagged | Leave a comment

Diceware Video

The idea of choosing a list of common words as a password is fairly common and can lead to very secure passwords if the selection process is done randomly. The idea entered popular culture with the famous XKCD correct horse battery staple cartoon but is really much older. One of the first systematic ways of choosing the words is Diceware, a method that uses a die and a list of 1776 words. Each word takes 5 rolls of the die (or a single roll of 5 dice) but even a 5 or 6 word password can be chosen reasonably quickly.

I’ve written about Diceware many times in the past and have even provided two computer implementations, one in C and another in Lisp. Both use cryptographically secure random number generation and should be at least as secure as rolling a die.

Over at <Computerphile>, Mike Pound has a video that explains and demonstrates Diceware. He shows how a password is picked and explains why the result is secure. That security remains intact even if an attacker knows you are using a Diceware-like scheme and has a list of the candidate words.

The video is just short of 11 minutes so you’ll probably have to schedule some time or fit it into a coffee break.

Posted in General | Tagged | Leave a comment

Now: Open Offices; Next: No Offices

Over at Second Nexus there’s an article that discusses the Harvard Study on open office spaces that I wrote about previously. If you missed that post, the TL;DR is that the study showed that far from improving collaboration, open offices actually decrease employee communication and effectiveness. The Second Nexus article covers those details and further notes that besides being significantly cheaper, open offices also enable continuous surveillance of employees. It’s no wonder management loves them.

The most interesting part of the piece, though, is their judgment of what’s coming next. They believe that the open spaces are merely a transition phase until offices all but disappear. Some employers are already trying to “bring nature into the workplace” but that’s expensive and out of the reach of most employers. Rather, the authors believe that virtually everyone will become a digital nomad. You should read the article for the details.

Doing away with offices seems attractive to me and even employers should like it because it will be even cheaper than open spaces. Of course, that will make employee surveillance much harder but aside from those addicted to micromanagement, ROWE should prove to be a better alternative.

There’s been a spate of articles on open offices lately and they all make the point that they’re not delivering their promised benefits. Those who suffer in the environment can only hope that those articles presage the end of this deplorable trend.

Posted in General | Tagged | Leave a comment