A History of the Development of C

Someone posted a pointer to an old (1994) paper of Dennis Ritchie on the development of the C language. I haven’t read it in years and it was interesting to revisit it. The paper, along with several others describing aspects of C and Unix, are available on Ritchie’s home page that AT&T still maintains.

I’d forgotten some of the details that he reveals such as why the default name for a Unix executable is a.out and why the precedence rules for the & and == operators are not what you think they should be. If you’re a C programmer, most of the structure of C seems obvious and just what it should be but, in fact, Ritchie struggled with many of the ideas and they were unconventional, if not controversial, at the time.

Most of us know that C is derived from the B language which was in turn derived from BCPL but the paper provides the details of that derivation and how the languages differed. Many of the features that make C so powerful and useful came directly from its predecessors.

C, of course, is credited with making Unix portable but that was not its original goal. The programmers simply wanted a higher order language than assembly in which to build their programs. Indeed, many Unix utilities were first ported from assembly to B and only later to C.

There’s all sorts of interesting historical and technical tidbits in the paper and it’s well worth a few minutes of your time, especially if you’re interested in Unix history or programming languages.

Posted in Programming | Tagged , | Leave a comment

Almost There

As regular readers know, I try to live the digital life as much as I can. By “digital life” I mean eschewing paper and paper processes and running as much of my life as possible with my phone and computers.

One of my goals for that digital life is to be able to leave the house and conduct my affairs with nothing but my iPhone. I’m almost there. My current everyday carry is down to just three things:

  1. My iPhone XR
  2. A Slim Clip Wallet for drivers license and credit card
  3. My House key and, if I’m driving, the car key.

I’m close to eliminating numbers 2 and 3.

These days, most cars use an RFD key fob to open the doors and start the engine. There’s no reason this couldn’t be done from a smartphone and, indeed, Hyundai is planning to do just that on next year’s model. Once Hyundai or some other car maker introduces this, the others are sure to follow. There are, of course, security concerns but Hyundai’s implementation appears more secure than the current key fob solution.

For the front door there are several keyless solutions. I want one that I can use my phone to unlock the door with. One of my (security knowledgeable) family members uses the August Smart Lock (there’s a later version) and swears by it. He can even issue temporary codes for guests and workers. I can install this at any time so I’m theoretically down to two must carries.

The final item to eliminate is the wallet. That means getting rid of my credit card and drivers license. Apple Pay has almost eliminated the need to carry credit cards. More and more big chains are adopting Apple pay; I’m mainly waiting for my grocery store (Publix) and couple other smaller venues to get on board.

That leaves only my drivers license. Happily, Florida has bills pending that would implement a digital license stored on your smartphone. Once passed, I’ll no longer need to carry my license except maybe when flying or voting or something similar.

I expect that in the next year or two I will be able to feel comfortable leaving the house with only my phone.

Posted in General | Tagged , , | Leave a comment

Guess What Day It Is

No, not hump day. It’s the 46th anniversary of the release of Pink Floyd’s iconic Dark Side of the Moon. As I do every year on this date, I’d like to say, “Happy Birthday” to one of the greatest and most successful albums of all time.

As I’ve written before, even though “Money” and “Time” were the two cuts from the album that became hit singles, most observers—at least this observer—consider the last two songs, “Brain Damage” and “Eclipse” to be the enduring masterpieces from the album.

I say something like that every year so this time, I’ll let you judge for yourself:

The video is from 1994. Roger Waters had already left the band but this version is every bit as good as the original from the album. Enjoy.

Posted in General | Tagged , | Leave a comment

Zamansky: A Quick Review of Editors

Mike Zamansky posted a quick review of programming editors and IDEs. It’s actually intended to be about picking a Java Editor/IDE in support of Java programming courses for teachers but it’s more generally useful. Zamansky, of course, is an Emacs guy but thinks that Emacs is not a good tool for beginners.

I see that opinion a lot, often expressed as Emacs is too difficult to learn for beginners and it doesn’t make sense to try to learn it at the same time as a new programming language. I consider that attitude an example of the tyranny of low expectations and grumpily reply that most worthwhile things aren’t easy and if you’re not willing to put in some effort, find another occupation. Still, Zamansky knows better than I ever will how to effectively teach CS to his target audience so, of course, I defer to his judgment on the matter. That’s true even though I know he shares my opinion that Emacs is not really hard to learn or use.

Having decided to not start with Emacs, he considers what editor he should start with. He looks at

  • Emacs
  • Gedit
  • Vim
  • Sublime Text
  • Atom
  • Jedit
  • Eclipse
  • DrJava
  • Geany
  • BlueJ
  • IntelliJ
  • VSCode
  • JGrasp

I must admit that I hadn’t even heard of some of those so it was interesting to see what he had to say about them. Again, his evaluation is mostly in the context of teaching Java to teachers wanting to certify in Computer Science but his remarks are more widely useful even if they won’t necessarily help you choose an editor for your day job.

Posted in General | Tagged , | Leave a comment

Texting and Line Editing

In the past, I’ve written disparagingly about line editing as practiced with the ed editor. That’s not to say that ed isn’t a great editor or that it doesn’t have its uses even today, just that no one (in their right mind) wants to line edit if they don’t have to.

I still think that’s true but the other day, I had a mini-epiphany: almost all of us line edit everyday when we text: you enter a line (or block) of text and commit to it by sending it on its way. Once committed, you can’t cursor back to correct an error. That happens all the time to me when iMessage helpfully “spell corrects” a word changing it into something I didn’t intend. What to do?

I do what we all do: I issue a separate correction. If I’m chatting with a technical person, I even use the ed notation that all nerds know

s/us/use/

or, if I’m texting with a civilian

us → use

That’s pretty much the exact ed workflow.

None of this is has any great import or reflects deep thinking, of course. I just find it amusing that despite my demurrals, I, along with most of the rest of you, am still line editing.

Posted in General | Tagged | Leave a comment

Another Org-based Writing Environment

John Borwick was looking for a writing environment that suited him. He’d tried Scrivener and some of the other tools but they didn’t work for him. Then he saw Jay Dixit’s video that I wrote about back in 2015 and decided to adapt Dixit’s solution.

Borwick has an interesting post that describes his system for writing in Emacs. The heart of the system is the use of org-panes to provide three panes: a top-level outline of his document, a detailed outline, and the main pane for the actual writing. He also uses Olivetti, which many writers favor because it increases the margin sizes. He uses a few other convenience packages but the environment centers around the three views of the piece he’s writing.

His solution is, in a sense, the polar opposite of the blank page environment preferred by many writers. In that setup, there is nothing but an empty space that you can put words into. In the extreme case, even the mode line is eliminated. Bastien Guerry wrote a post about how to do this with Emacs. The nice thing is that Emacs can provide either environment—and many others, as well—so you’re covered whatever your preferences.

I do all my writing in Emacs—mostly in Org-mode—and wouldn’t consider using any other tool. It’s easy to adapt it to provide just what I want and if some other tool has a nice feature, it’s usually easy to add it to Emacs.

Posted in General | Tagged , | Leave a comment

UC Strikes a Blow for Open Access

The University of California has struck a blow for the Open Access movement by terminating its subscriptions to all Elsevier journals. UC and Elsevier have been in negotiation for some time trying to find a way to make UC research results—about 10% of all US research publications—available to everyone without cost. Sadly, those negotiations failed but UC stood by their principles and dropped their subscriptions.

That’s not like you or me dropping Amazon Prime or using DuckDuckGo instead of Google. Who would notice or care? UC on the other hand spent multiple millions of dollars on Elsevier subscriptions and as a leading university system stands as an example to the other big consumers of Elsevier publications. Their defection has to smart, especially if other universities follow their example.

As I’ve said before, journal publishers are solving a problem that no longer exists. Research can, and should be, distributed on line. That’s mostly what Open Access is all about. The publishers continue to exist and thrive only because universities continue to base their tenure and promotion decisions on a faculty member’s record of publishing in “top flight” journals, which, of course, means that junior faculty must publish in such journals if they want to survive.

Already, though, many senior faculty are refusing to publish in, or referee for, journals that don’t make the research available to anyone without cost. Once the tenure and promotion committees get onboard, it’s hard to see how big publishers like Elsevier are going to survive with their current business models. Of course, there’s hardly any institution more stodgy and resistant to change than such committees so who knows what will happen.

Regardless, we can all cheer UC’s decision and hope that other universities follow suit.

Posted in General | Tagged | Leave a comment

Today I Learned…

…about the delete-horizontal-space command (bound to Meta+\). It deletes all spaces and tabs around the point. You can delete just the white space before the point by specifying the universal argument. I learned about the command from a reddit post by rmberYou that listed some useful Emacs packages.

The post suggested hungry-delete but then added a note about delete-horizontal-space. The suggestion for delete-horizontal-space came from a comment where the command cycle-spacing (bound to Meta+Space) is also discussed. One invocation of cycle-spacing deletes all the spaces but one. Two invocations deletes all the spaces, and three invocations puts things back the way they were.

I use the cycle-spacing command all the time (although only in its single invocation mode; I’d forgotten about the rest) but delete-horizontal-space is new so I’ve learned another useful Emacs command. The day has not been wasted.

Posted in General | Tagged | Leave a comment

Org-mode 9.2.2 is Out

Bastien tweets that the latest Org-mode is available:

After the recent problem with the agenda being broken, I decided to stop living on the bleeding edge and started getting Org from GNU ELPA. Confusingly, the current release there is labeled 9.2.2 but when I run org-version is reports 9.2.1.

I’m a big time user of Org-mode, of course, so I like being up to date but because I am a big time user, I can’t tolerate having it broken so I’m trying getting it from the GNU repository for the time being. If that gets too far behind, I can always go back to using the Org repository.

Posted in General | Tagged , | Leave a comment

Some Wisdom on Pipelines

Over at his blog, Ted Dziuba has posted a valuable piece of wisdom that is easy to forget. The TL;DR on the wisdom is that many tasks for which we instinctively turn to heavy-weight, distributed tools are more easily and safely accomplished with a pipeline of standard Unix utilities.

That can be a hard lesson to learn. When I was young and foolish I would often throw together such a solution but because I was silly would think of it more as a proof-of-concept and go on to build a “real” solution, usually in C. And that was true even though the original solution solved the problem perfectly well and had a perceived run time that was virtually indistinguishable from the one written in C.

Doubtless, I’m still doing silly things but at least I’ve gotten over that particular brand of it. Not all jobs are amenable to a Unix pipeline, of course, but many are and it’s worth looking at each task to see if they qualify before renting a bunch of virtual servers and firing up Hadoop.

Back in the Old Days™, resources were more limited so solutions like those recommended by Dziuba were more natural and pipelines were the go-to tool. That’s less true today where resources are plentiful and the command line is often looked at the same way we look at COBOL. Still, even though it’s an old post it’s nevertheless worth reading and taking to heart.

Posted in Programming | Tagged , | Leave a comment