V7 and the History of Unix

Among Unixheads, the Seventh Edition (V7) holds a special, almost mystical, place. Many consider it the best of the various Unix versions. In his Minix book, Tanenbaum remarks, “It is sometimes said Version 7 was not only an improvement over all its predecessors, but also over all it successors.” The source code has long been available and I have always found it the easiest to read and learn from.

Chris Siebenmann has a blog post with his own take on the importance of V7. He agrees with most of what I’ve written above but notes that V7 is historically important because it is the base from which (almost) all subsequent Unices are derived. If you understand V7, you’re well on your way to understanding everything that came afterwards.

Siebenmann goes further and says that V7 was the last pubic release from the CSRC (the Bell Labs researchers who invented Unix) and thus represents the last release made by those who really understood the Unix way. Those who came later, Siebenmann says, brought their own sensibilities to table and lacked the appreciation and understanding of Unix that its originators had.

If you like Unix and are interested in its history, you should definitely take a look at Siebenmann’s post. It’s interesting and reasonably short.

Posted in General | Tagged | Leave a comment

Tree Sitter and Syntax Highlighting

Mickey Petersen author of the the excellent book Mastering Emacs and the blog of the same name has another of his comprehensive and informative articles on his blog. This time it’s about tree sitter and its application to syntax highlighting in Emacs.

Even though we take it mostly for granted, syntax highlighting is actually a devilishly difficult problem. Emacs and almost every other editor does it with a witches’ brew of regular expressions and ad hoc functions. The results are usually, but not always, good enough. The correct method, of course, is to build a syntax tree of the code and use that to inform the highlighting. There’s a whole host of problems with that approach. In the first place, the code you’re editing probably isn’t syntactically correct because it’s incomplete. Secondly, the naive solution of rebuilding the tree with every keystroke is too slow to be practical and there are other problems as well.

Mickey has a solution: use tree sitter to drive the highlighting. If you don’t know about tree sitter or what it’s used for, head on over to Mickey’s post for the details. Tree sitter can do more than just figure out syntax highlighting. Mickey mentions the excellent ParEdit and its use in Lispy languages. Mickey wanted to extend that capability to other languages, Python in particular.

He’s built a package to do just that. He calls it combobulate. It’s still alpha software but you can try it out if you like. Mickey says he’ll put it on Melpa as soon as he works out a few more issues. Mickey believes that the tree sitter approach is the future for addressing these types of problems.

I know I keep saying this but tree sitter and Emacs’ embrace of it once again puts the lie to the notion that Emacs is moribund technology. The reverse is true. Emacs keeps introducing new capabilities that other editors copy and then use to support their claims of superiority.

Posted in General | Tagged | Leave a comment

Emacs as a Lifestyle

Bozhidar Batsov made an interesting observation that several people have mentioned or commented on. The TL;DR is that Batsov thinks that Emacs can be considered a lifestyle. If you’re an Emacser your reaction is probably like mine: it’s not literally true but it does capture a certain truth concerning how we feel about Emacs.

For me, the essence of that feeling is captured by Stephen Ramsey’s reply to the tweet that started the whole thing off.

I usually express this by comparing my Emacs configuration to a Japanese garden: It’s a work that’s always in progress but never finished. The gardener spends his life improving the garden little by little and striving for a perfection that is never reached. So it is with our Emacs configurations: A neverending search for an ideal never achieved.

Posted in General | Tagged | Leave a comment

Proportional Fonts in the Mode Line

Lars Ingebrigtsen has an interesting post about proportional fonts in the Emacs mode line. His post shows the same mode line in both fixed and proportional fonts. There’s no arguing that the proportional fonts look better and that they allow for the display of more information on the mode line.

Still, the suggestion to move to proportional fonts is an old one and has always been controversial. There are some serious objections. For one, things like the point position are updated with every character typed and that can cause the mode line display to shift right or left.

Ingebrigtsen says that they’re running a month long test on Emacs Master in which proportional fonts on the mode line are enabled by default. They’ve installed a fix for the problems of things like the point position and the developers are hoping that that will address previous objections to using proportional fonts.

Regular readers know that I don’t care much about this sort of thing. All in all, I’m happy with a fixed width font mode line but I don’t find the idea of proportional fonts objectionable either. If you’re tracking Emacs Master, be sure to let the developers know what you think.

UPDATE [2021-11-26 Fri 13:15] Emacs 28 Master → Emacs Master.

Posted in General | Tagged | Leave a comment

Guile Hacker Handbook

I recently came across the Guile Hacker Handbook, a work in progress that’s worth a look for any Guile hackers. After some sections on installing Guile (and Emacs) the handbook considers various Scheme constructs and how to use and test them in Guile.

It’s a nice resource. My only criticism is that it jumps right into using modules and bypasses one of Scheme’s virtues: its simplicity. The R5RS Scheme specification that I learned from was 50 pages long, eminently readable, and told you everything you needed to know. You could spend an hour reading it and start writing Scheme programs. It’s absolutely the easiest programming language to learn that I’ve every encountered. It was amazing how far you could get with this simple language.

Still, it wasn’t really great for “professional development” because it didn’t have many of the amenities that modern languages provide. Subsequent versions of the language added things like modules to address these deficiencies. The additions have been controversial. The purists pine for the R5RS days and those who want to use Scheme for “real” programs wanted to move forward. R6RS Scheme, in particular, was controversial and never achieved traction.

The thing with Guile is that it’s an extension language. The original idea was to replace things like TCL as an extension language for GNU programs. R5RS is perfect for that. The current Guile implements most of R5RS and R6RS and is often used as a primary language for programs. Still, it’s useful to approach Scheme through its simplicity and then move on to modules and all the rest. I believe the handbook would do better to follow that path.

Even so, the Guile Hacker Handbook is useful to those who want to use Guile and is definitely worth a look. Again, it’s still a work in progress but what’s there is useful.

Posted in General | Tagged , | Leave a comment

Campbell’s Law

Back in 2017 I wrote about Goodhart’s Law, the notion that any measure used as a target, ceases to an effective measure. It stops being effective because those being measured learn to game the system in such a way that the measure is optimized rather than the desired result. The canonical example is standardized testing used to determine teacher compensation or school budgets. School administrators and teachers start teaching to the test making the “measure” effectively useless for its intended purpose.

Page Laubheimer and Kate Moran have a very interesting post about the closely related notion of Campbell’s Law, which says the more important some metric is in making a social decision, the more likely it is to be manipulated. Again, a prime example of this is standardized testing but there are many others that can affect any enterprise.

Most of the post is examples of Campbell’s law in action. Laubheimer and Moran end with a short section on some ways to avoid getting bitten by the law. The post serves as a useful reminder not to focus on some specific metric to gauge how things are going in your operation. If you tell people they need to increase some measure or another, you will get what you asked for but probably not what you wanted.

It’s a good post and well worth a few minutes of your time. It’s really easy to forget the lesson they bring but it’s important not to.

Posted in General | Tagged | Leave a comment

Measuring Network Quality in macOS

Sorry non-Appleheads, but this post will probably interest only Mac users. I’ve been running macOS Monterey since it was released but I just learned about an interesting new feature: networkQuality. It’s a command line utility to measure the quality of your network connection. Dan Petrov has a post about it that explains why, while it’s much like, say, fast.com, it also has a few advantages. Take a look at Petrov’s post for the details.

In the meantime, here’s a sample run from my laptop:

networkQuality
==== SUMMARY ====
Upload capacity: 6.400 Mbps
Download capacity: 51.507 Mbps
Upload flows: 20
Download flows: 16
Responsiveness: Medium (305 RPM)

There’s a manual page you can check for all the options and other information. It seems like a nice utility. My only complaint is the silly name with CamelCase name. It’s very un-Unix like and hard to type. Why not just call it nq or even network-quality? The capital Q is unnecessary and annoying. On the other hand, macOS will happily invoke it regardless of case so at least you can call it without the annoying capital Q.

Posted in General | Tagged | Leave a comment

Lisp at Kina

I haven’t talked about Common-Lisp on Irreal for a long time. That’s mostly because the majority of my recent Lisp programming has been in Elisp but I still love Common-Lisp and Scheme and am always happy when I find an interesting article about them. I particularly like articles that show how Lisp is being used to solve real world problems.

For a long time, the canonical example of this has been ITA Software, but there are others and azzamsa and his collaborators have a list. When he saw the list, Alex Nygren told them about his company Kina Knowledge that makes extensive use of Common-Lisp and its homegrown lisp, DLisp, that compiles to Javascript. That led to a nice blog post by vindarel that describes the Kina system and how Lisp fits into it.

You should read the post for the details but the TL;DR is that their technology stack is made up of Ruby/Rails, Javascript, Common-Lisp, and DLisp. Most of their front end is written in DLisp and is available to the end user. The back end is Common-Lisp that does much of the heavy lifting. And, as a bonus, Nygren uses Emacs for his Lisp coding and documentation. It makes sense; if you’re a Lisper, Emacs is a natural fit.

The post is well worth a read if you’re interested in how Lisp is being used today. There aren’t, I’m sure, enough Lisp jobs for everyone who wants one but they aren’t non-existent either. Paul Graham famously described Lisp as their secret weapon at Viaweb and related how they tried to prevent their competitors from finding out they were using it. Perhaps more companies will get the message and the number of Lisp jobs will increase.

Posted in General | Tagged , , | Leave a comment

Git History for Selected Text

Here’s a nice tip for finding all the commits related to some selected text in Magit:

I haven’t tried this in anger but it seems as if it could be useful when trying to figure out how a bit of code has changed over time.

Posted in General | Tagged , | Leave a comment

Red Meat Friday: Take That, Neovim

Posted in General | Tagged , | Leave a comment