Bumper-Sticker Computer Science

Back in the 1980s, Jon Bentley wrote a column for Communications of the ACM called Programming Pearls. The columns typically considered a programming technique or problem and were very popular. The columns were later published in book form as Programming Pearls and More Programming Pearls. If you haven’t read these books, you definitely should. Programming Pearls, at least, appears to be available for free download.

I just came across a pointer to one of those columns, Bumper-Sticker Computer Science. I remember reading it in More Programming Pearls and I’m pretty sure that’s where I first learned the rule of thumb that π seconds is a nanocentury. The theme of the column is short computer science aphorisms—such as Duff’s remark about π seconds—that could conceivably be printed on a bumper sticker.

If you haven’t seen that column, you should take it look. It’s entertaining but, more importantly, distills a lot of our profession’s traditional wisdom. It will take only 5 or 10 minutes to read and you’re sure to enjoy it and probably learn a thing or two as well.

Posted in General | Tagged | Leave a comment

The Emacs Community

James Gill has a nice tweet about the community of Emacs users:

Like most of you, I belong to several tech communities. Not all of them have as nice a reputation. The Lisp community, for example, can be notoriously hostile to n00bs. A lot of that is residual grumpiness about the fact that the first thing many n00bs do when they arrive is suggest some scheme for doing away with parentheses. If you heard that as often as the typical Lisper, you’d be grumpy too.

Still, there’s no denying that the Emacs community is exceptionally welcoming to n00bs and that, as Gill says, we have a lot of people with extensive experience who are willing to help n00bs as well as more seasoned users. We also have folks like Mike Zamansky, Sacha Chua, and Rainer König who spend hours of their own time making instructional videos and doing other chores that benefit us all.

I think Gill has it exactly right: We’re old school and modern at the same time. Old school because we’re employing an editor that’s older than many of its users and modern because that same tool is more powerful and adaptable than its more “modern” competitors. In any event, it’s a great community and I’m proud to be a member.

Posted in General | Tagged | Leave a comment

A Lisp Machine

Sorta. Kedalion Daimon has a really interesting project in which he takes an old Brother EP 44 adds an Arduino Due and the very definition of a Rube Goldberg power supply to build a makeshift Lisp machine. It’s a Lisp machine because the Arduino is running David Johnson-Davies’ uLisp and the EP 44 is serving as a terminal.

This is, of course, by no means a “real” Lisp Machine. Daimon even had to write his own editor for the machine. Even if it’s not Emacs, it was powerful enough to allow the entering of simple Lisp functions, which the uLisp would then execute.

Daimon produced a video showing the machine and demonstrating its use. It’s unlikely that you could use the machine for serious work but it’s awesome as a side project. After all, how many of us can say we built our own Lisp Machine?

Thanks to Wilfred Hughes for the link.

Posted in General | Tagged , | Leave a comment

The Many Uses of Org Mode

It’s almost a cliche that “I came to Emacs for X but stayed for Org mode.” Org really is the killer app for n00bs, although I believe it’s more of a gateway drug. After you’ve been here for a while, Org is still really nice but it’s all the other benefits that really matter. No matter; there’s no denying that Org really is reason enough to move to Emacs.

Sid Raval has an interesting post in which he exclaims the wonders of Org. He came to Emacs for its Haskell support but it was Org mode that convinced him to stay. His journey is like many others: Org and Emacs just make life so much easier that he started building his workflow around it.

You probably won’t learn anything new from Raval’s post but it serves as yet another reminder why we’re all here. Emacs, provides an unusually rich environment for getting your work done. Some of us think that that’s because it recapitulates the Lisp Machine experience, others because it’s just a really nice work environment that happens to include an editor. Whatever your reason, Emacs is a clear win. Raval’s post is yet another affirmation of that fact.

Posted in General | Tagged , | Leave a comment

Storing Energy with Concrete Blocks

One of the big problems with alternative energy sources, such as wind and solar, is that they can’t generate electricity all the time. That means that that they need a way to store the excess energy they generate when they’re operating for times when they aren’t. The obvious answer—to most of us nerds—is to use batteries. The problem is that that solution doesn’t scale very well. In fact, 96% of energy storage is by “pumped hydro” where the excess energy is used to pump water up to a dam where it is stored until energy is needed. Then the dam is opened and the water flows against turbines to regenerate the electricity.

That solution also has problems, though. In the first place it requires the right geographic environment. Secondly, in some places water is too valuable a resource for this use. That’s why 75% of pumped hydro facilities have been built in just 10 countries. Still, the idea is a good one: store the energy as potential energy.

A startup named Energy Vault is leveraging the idea by storing energy by using cranes to lift concrete blocks and recovering the energy by letting gravity lower the blocks against the cranes’ motor to regenerate the electricity. Surprisingly, the system is almost as efficient as lithium-ion batteries.

Quartz has a nice article on the system. Energy Vault has built a demonstration plant—about one tenth the size of a production plant—to demonstrate the system. The concrete blocks for a production plant would weigh about 35 tons but the demonstration plant, which was built in 9 months and cost only $2 million, used blocks weighing 500 kg. A production plant could store about 20 megawatt-hours, enough to power to 2,000 Swiss homes for a day.

I love this solution. It’s low-tech in a way but about as efficient as more glamorous high-tech solutions. Read the article. It’s really interesting and illustrates how even simple ideas can yield huge benefits.

Posted in General | Tagged | Leave a comment

Why Emacs is a Great Editor

Ayrat Badykov has a short post on Why Emacs is a great text editor. The post is really about why he switched to Emacs and why he’s sticking with it. Although you won’t find anything in the post to convince a n00b, there are a couple of interesting points worth commenting on.

First, Badykov says that he was convinced to move from Sublime to Emacs when he pair programmed with a Vim user. He was, he says, blown away by how much more productive the Vim user was in his editing compared to his. The Vim user never used the touch pad; he did everything with shortcuts and had shortcuts for everything. He chose Emacs instead of Vim because Emacs was “popular” in his community and there were lots of videos and blogs about using it.

This really resonated with me. Most of you know that I’m strictly laissez-faire about what editor people use. It’s not that I don’t have strong feelings about the matter, it’s just that I wouldn’t think of imposing my views on others. I’m happy to let people use whatever editor they find is best for them. All that said, I have to admit to a bit of annoyance when people who have never used Emacs or Vim or, in fact, have never used any editor other then some menu/mouse driven abomination complain that Emacs/Vim are “old technology” and don’t look as nice as whatever it is they’re using. Badykov provides the perfect rejoinder: those Emacs/Vim users with their old editors are much more efficient than you are. They save a second or two on each operation and that can add up to hours a day. Whether or not Emacs/Vim users can actually save hours every day, there’s no doubt that we are a lot more efficient.

The second thing I found interesting about the post is that under “disadvantages of Emacs,” Badykov notes that there’s a steep learning curve and that it might take you a couple of weeks to become proficient with it. I’m as much in favor of instant gratification as the next guy but it would never occur to me that I could install Emacs and instantly become proficient. After 10 years I’m still learning and it’s not unusual for me to think, “How did I not know that?” after learning some new feature or trick.

Like anything else worthwhile, Emacs requires a commitment to become even reasonably adept at its use. If you aren’t prepared to make that commitment, there’s always nano or whatever mouse/driven editor you’re using now. Just don’t expect to be as efficient as those of us using those “outdated editors.”

Harking back to my old post on Using Emacs, I expect that Badykov is or is going to become a first rate developer. Not because he uses Emacs but because he cares about his tools and is willing to put in the effort to master them.

Update [2018-08-19 Sun 09:56]: Batsov → Badykov

Posted in General | Tagged | Leave a comment

The Ferret Lisp System

Nurullah Akkaya has an interesting project, Ferret, that compiles a Lisp dialect into C++. It’s very portable and can compile code not only for the major platforms but for embedded systems as well. Basically anything that can support C++ can be used as a target.

The system is written in Clojure so it would normally fall outside of Irreal’s interests but it has one feature that makes it very interesting to Irreal: The source of the whole system is a single Org mode file. If you had any doubts as to whether Org could support a literate programming approach in a non-trivial project, you can put them aside. If you follow the above link, you’ll see a beautifully rendered manual complete with the source code presented in literate form. For example, if you click on the Compiler section, you’ll see the actual compiler code along with an explanation of what it’s doing.

All of this is generated from the ferret.org file (which I’ve linked to in RAW format so you can see how it works). If you look at the Makefile, you’ll see that it calls Emacs in batch mode to tangle the ferret.org file into the various files needed for the runtime and compiler.

This is an outstanding example of literate programming made all the better by leveraging the power of Emacs and Org mode. Take a look even if you aren’t interested in Lisp or Clojure. The way Akkaya ties everything together in a single Org file is instructive and worth study.

Posted in General | Tagged , , , | Leave a comment

The Past Comes Around Again

Many (many) years ago in the age of MS-DOS when Unix on the PC was still a dream, there was an editor called Brief. It was far and away the best editor available for DOS. It was fast, had multiple windows, regular expression search and replace, multiple undo/redo, could deal with rectangular regions, and could even call and interact with your compiler directly from the editor.

It was, in short, very Emacs-like and even had a Lisp extension language. Later, they added a C-like extension language. I recall the developers saying that it was inspired by Emacs. For example, a lot of the editor was implemented in the extension language(s). Of course, it wasn’t as powerful as Emacs: you couldn’t do things like listen to music with it or any of the many other things that we do from within Emacs but it was a darn good editor and had a fanatical following.

I remember it fondly and regret that it died with DOS (although there were OS/2 and Window versions). It turns out, though, that it hasn’t quite died. One of those fanatical followers, Luke Lee, has been working on emulating it under Emacs for over 17 years. Now, finally, he feels that it’s ready for official release.

There probably aren’t a lot of people who still have Brief muscle memory or who would prefer the Brief emulation to normal Emacs but if you are such a person, Lee has just added it to the ELPA package master branch. Lee’s announcement on emacs-devel is detailed and describes the changes and enhancements he made. If you were a Brief user and would like to relive the old days, give it a try.

Posted in General | Tagged , | Leave a comment

Emacs Podcast #3

Rakhim Davletkaliyev is back with another Emacs podcast. As I said in my first post about his podcasts, using a podcast to discuss Emacs may seem odd but it actually works pretty well.

Davletkaliyev starts by telling us what’s changed in his configuration and approach since the last podcast. The major changes are the addition of Helm and Projectile. With them he was able to recreate some of the functionality that he likes best in Sublime. In one case he was even able to expand on that workflow. Another example of how you can make Emacs work your way.

The majority of the podcast is about Org mode. I was a bit surprised at how much Org functionality he was able to harness as a n00b. It certainly took me a lot longer. Of course, as he makes a point of saying, there’s no need to be intimidated by the vastness of Org. You can start off with just a few of the basic functions and discover new capabilities as you need them.

The first thing he liked about Org is its ability to link to other files (or parts of other files). That makes it easy to tie together related files and topics in the usual hypertext way. He reminds us several times that the magic of Org is that it has all these capabilities but is just plain text. You can read it—or even create it—with any editor.

He especially likes Org tables. They’re easy to use and create and bring along spreadsheet capability for free. That seems like almost a throwaway but almost every Org table I create uses that functionality in some way. It’s just too convenient to ignore.

Like me, he really likes the Babel functionality. The ability to add code blocks and export (or not) the code and embed the result in your document all without leaving Org mode can not be overpraised. It’s one of the centers of my workflow.

He also talks about TODOs, one of the fundamental functions of Org. He likes how they can distributed among many different files and summarized in the agenda. He also likes that it integrates the functions of three other applications that he was using for the same thing: Things, the Mac Notes app, and iA Writer. He especially likes how all the information is available to each of the three functions in Org, which is not the case with the three separate applications.

Finally, he describes how he implemented a list of browser links and automatically exports it to HTML so that it is available to his browser. He finds that much nicer and easier to navigate than using the native browser bookmarks.

The podcast is a bit over 29 minutes so you’ll have to schedule some time. I enjoyed it; perhaps you will too.

Posted in General | Tagged | Leave a comment

Karl Voit on Security

Karl Voit has an useful post on good password security practices. There’s not really anything new in the post but it brings together most of the best practices in a single place.

The main problem is that you no longer have to be a nation state to build a machine capable of trying millions of passwords a second. Throw a few GPUs into a pretty much standard PC and you’ve got an excellent password cracking machine. Given that fact you absolutely can’t afford a weak password. Even worse are the common 123456 and password type passwords. Voit points out that the top 10,000 passwords are used by 98.8% of users. Don’t be one of those users. It probably takes less than a second to recover your password if you are. Brute force isn’t the only way to discover your password, of course, and Voit discusses some of the others.

Passwords are never going to be absolutely secure but you can do better than almost everyone else (remember that 98.8 percent?) by following a few simple precepts. That mainly means:

  • Getting and using a password manager that will generate long, random, unique passwords for you.
  • Never, ever, reusing a password. That way even if one of your passwords is recovered it effects only a single site instead of many.
  • Using secure software that won’t leak your passwords. This is harder than it seems. Voit suggests using only open source software to help with this.
  • Staying alert and aware. That means don’t click on any email links. Always use your bookmarks to open a site. The next time you get an email from big company XYZ thanking you for your order and, by the way, if you want to cancel click here, hover over the link; there’s a good chance it won’t point to XYZ’s domain.

All of this is a bit of trouble but necessary to stay safe. As Voit says, security is pretty much the opposite of usability. Read Voit’s post. If you do and follow his advice you’ll be safer than almost everyone else.

Posted in General | Tagged | Leave a comment