May 13

I saw Brand X live a few hours ago

I saw Brand X live a few hours ago. Great jazz-fusion band from the 1970s, still playing like genius maniacs after all these years. Dropped $200 on tickets, dinner for me and my wife, and a Brand X cap. Worth. Every. Penny.

Yeah, they saved “Nuclear Burn” for the encore…only during the last regular number some idiot managed to spill water on Goodsall’s guitar pedals, making it unsafe for him to play. So that blistering guitar line that hypnotized me as a college student in 1976 had to be played by their current keyboardist, Scott Weinberger. And damned if he didn’t pull it off!

Brilliant performance all round. Lots of favorites, some new music including a track called “Violent But Fair” in which this band of arcane jazzmen demonstrated conclusively that they can out-metal any headbanger band on the planet when they have a mind to. And, of all things, a whimsical cover of Booker T and the MGs’ “Green Onions”.

The audience loved the band – nobody was there by accident, it was a houseful of serious prog and fusion fans like me. The band loved us right back, cracking jokes and goofing on stage and doing a meet-and-greet after the show.

I got to shake Goodsall’s hand and tell him that he had rocked my world when I first heard him play in ’76 and that it pleases me beyond all measure that 40 years later he’s still got it. You should have seen his smile.

Gonna wear that Brand X cap next time I go to the pistol range and watch for double-takes.

“Nuclear Burn” by Brand X

May 12

Draining the manual-page swamp

One of my long-term projects is cleaning up the Unix manual-page corpus so it will render nicely in HTML.

The world is divided into two kinds of people. One kind hears that, just nods and says “That’s nice,” having no idea what it entails. The other kind sputters coffee onto his or her monitor and says something semantically equivalent to “How the holy jumping fsck do you think you’re ever going to pull that off?”

The second kind has a clue. The Unix man page corpus is scattered across tens of thousands of software projects. It’s written in a markup – troff plus man macros – that is a tag soup notoriously resistent to parsing. The markup is underspecified and poorly documented, so people come up with astoundingly perverse ways of abusing it that just happen to work because of quirks in the major implementation but confuse the crap out of analysis tools. And the markup is quite presentation oriented; much of it is visual rather than structural and thus difficult to translate well to the web – where you don’t even know the “paper” size of your reader’s viewer, let alone what fonts and graphics capabilities it has.

Nevertheless, I’ve been working this problem for seventeen years and believe I’m closing in on success in, maybe, another five or so. In the rest of this post I’ll describe what I’m doing and why, so I have an explanation to point to and don’t have to repeat it.

Continue reading

May 09

Embrace the SICK

There’s a very interesting article just out, C Is Not a Low-level Language;. in which David Chisnall punctures the comforting illusion that C is really a “close-to-the-metal” language and relates this illusion to the high costs of Spectre and other processor-level bugs.

Those of us who think seriously about language design have long been aware that C’s flat-address-space model is increasingly at odds with the real world of memory-caching hierarchies. Chisnall’s main contribution is to notice that speculative execution, the feature at the bottom of the Spectre and Meltdown bugs, is essentially a hack implemented to allow C programmers to maintain the illusion that they’re running on a really fast serial machine.  But he has other interesting points as well.

I recommend reading Chisnall’s article before you go further with this post.

It’s no news to my regulars that I’ve been putting increasing investment into the Go language and now believe it a plausible candidate to replace C and C++ over most of C/C++’s range – that is, outside  of kernels and hard realtime.  So the question that immediately occurred to me upon reading the article was: Is Go necessarily productive of the same kind of kludge that Chisnall is calling out?

Because if it is – but something else isn’t – that could be a reason not to overcommit to Go.  The twin pressures of demand for lower security defects and the increasing complexity costs of speculative execution are bound to toll heavily against Go if it does demand massive speculative execution and there’s any realistic alternative that does not. Do we need something much more divergent from C (Erlang? Ocaml? Even perhaps Haskell?) for systems programming to follow where the hardware is going?

So let’s walk through Chisnall’s discussion points, bounce Go off each one, and see what we can see.  What we’ll find implies, I think, some more general conclusions about what will and won’t work in matching language design to real-world workloads and processor architectures.

Continue reading

May 05

Friends of Armed & Dangerous gathering 2018

The 2018 edition of the annual Friends of Armed & Dangerous FTF will be held in room 821 of the Southfield Westin in Southfield, MI between 9 p.m. and 12 p.m. this evening.

If you are at Penguicon, or in the neighborhood and can talk yourself yourself in, come join us for an evening of scintillating conversation and mildly exotic refreshments.

May 02

Review: The Mutineer’s Daughter

I greatly enjoyed Thomas Mays’s first novel, A Sword Into Darkness, and have been looking forward to reading the implied sequel. His new collaboration with Chris Kennedy, The Mutineer’s Daughter, isn’t it.

Instead, we get a crossover YA/space-opera that is a bit cramped by having been written to the conventions of the YA form. Also because, if a reliable source is reliable, it was Mays writing to an outline by Kennedy. Where Mays’s heart is – in the space-opera parts – the result has some sparkle and a bit of originality. In the YA parts it is competently executed but strictly from tropeville.

For a plot and setting teaser see its Amazon page -accurate enough, if empurpled. It is also worth noting that this is another book in which the author(s) carefully studied the Atomic Rockets website and gained much thereby.

This is not a bad book; Mays gave it craftsmanlike attention. If you like things going boom in space, you will probably enjoy it even if you are ever so slightly irritated by the insert-plucky-girl-here plot. It proceeds from premise to conclusion with satisfactory amounts of tension and conflict along the way. As long as you don’t set your expectations much above “genre yard goods” it is an entertainment worth your money.

But I’m left thinking that not only can Mays do better on his own, but in fact already has. I want that sequel.

Apr 23

The UPSide state diagram

I think this diagram is now stable enough to put on the record.

UPSide state diagram

UPSide state diagram

Both this diagram and the Go code for the policy logic are generated from this pseudocode:

    render.state("DaemonUp", "Daemon running") 
    render.action("DaemonUp", "ChargeWait", CHARGING)
    render.state("ChargeWait", "Charge wait")
    render.action("ChargeWait", "MainsUp", CHARGED)
    render.action("ChargeWait", "OnBattery", MAINSDROP)
    render.state("MainsUp", "On mains power")
    render.action("DaemonUp", "OnBattery", MAINSOFF)
    render.state("OnBattery", "On battery power")
    render.action("MainsUp", "OnBattery", MAINSDROP)
    render.action("OnBattery", "Overtime", DWELLWARNING)
    render.state("Overtime", "User warned of shutdown")
    render.action("Overtime", "PreShutdown", DWELLTIMEOUT)
    render.state("PreShutdown", "Awaiting power drop")
    render.action("PreShutdown", "ChargeWait", RESTORED)
    render.state("UPSCrash", "UPS goes dark")
    render.state("HostDown", "Host has shut down")
    render.action("PreShutdown", "HostDown", HOSTDOWN)
    render.action("PreShutdown", "UPSCrash", BATTERYDRAIN, unreachable=True)
    render.action("OnBattery", "ChargeWait", RESTORED)
    render.action("Overtime", "ChargeWait", RESTORED)
    render.action("HostDown", "MainsUp", RESTORED_LATE)
    render.action("HostDown", "UPSCrash", BATTERYDRAIN, unreachable=True)

To see the full context of this, clone and explore the docs/ directory.

Apr 11

How many Einsteins per Africa?

In 2008, Neil Turok, an eminent phycisist, gave a talk about trying to find the next Einstein in in sub-Saharan Africa. I was thinking about this a few days ago after his initiative re-surfaced in a minor news story,and wondered “what are his odds?”

Coincidentally, this morning I stumbled across the key figure needed to upper-bound them while researching something else.

Continue reading

Apr 03

Fthagn to you too

I learned something fascinating today.

There is a spot in the South Pacific called the “Oceanic pole of inaccessibility” or alternatively “Point Nemo” at 48°52.6?S 123°23.6?W. It’s the point on the Earth’s ocean’s most distant from any land – 2,688 km (1,670 mi) from the Easter Islands, the Pitcairn Islands, and Antarctica.

There are two interesting things about this spot. One is that it’s used as a satellite graveyard. It’s conventional, when you can do a controlled de-orbit on your bird, to drop it at Point Nemo. Tioangong-1, the Chinese sat that just crashed uncontrolled into a different section of the South Pacific, was supposed to be dropped there. So were the unmanned ISS resupply ships. A total of more than 263 spacecraft were disposed of in this area between 1971 and 2016.

It’s just the place to dump toxic fuel remnants and radionuclides because, in addition to being as far as possible from humans, the ocean there is abyssal desert, surrounded by the South Pacific Gyre so it’s hard for nutrients to reach the place. Therefore there’s probably no local ecology to trash.


According to the great author and visionary Howard Phillips Lovecraft, Point Nemo is the location of the sunken city of R’lyeh, where the Great Old One Cthulhu lies dreaming.

The conclusion is obvious. The world’s space programs are secretly run by a cabal of insane Cthulhu cultists who are dropping space junk on Cthulhu’s crib in an effort to wake him up. “When the stars are right”, hmmph.

EDIT: I was misled by an error in Wikipedia that claims Tiangong-1 was deliberately dropped there, and jumped to a conclusion. Now corrected.

Mar 16

UPSide needs a battery technologist

The design of UPSide is coming together very nicely. We don’t have a full parts list yet, but we do have a functional diagram of the high-power subsystem most of which can be expanded into a schematic in a pretty straightforward way.

If you want to see what we have, clone the repo, cd to design-docs, make transactions.html, and view that in a browser. Note that the bus message inventory is out of date; don’t pay a lot of attention to it, one of the design premises has changed but I haven’t had time to rewrite that section yet.

We’ve got Eric Baskin, a very experienced power and signals EE, to do the high-power electronics. We’ve got me to do software and systems integration. We’ve got a lot of smart kibitzers to critique and improve the system design, spotting problems the two Eric’s might have missed. It’s all going well and smoothly – except in one key area.

UPSide needs a battery technologist – somebody who really understands all the tradeoffs among battery chemistries, how to spec battery types for different applications, and especially the ins and outs of battery management systems.

Eric Baskin and I are presently a bit out of our depth in this. Given time we could educate ourselves up to the required level, but the fact that that portion of the design is lagging the rest tells me that we ought to recruit somebody who already knows the territory.

Any takers? No money in it, but you get to maybe disrupt the whole UPS market and and certainly work with a bunch of interesting people.

Mar 11

How to get started on the UPSide project

The current state of play is: We have a high-level system design and a map of the behavior states. We have a capacity target (300W for 15 mins) and a peak-continuous-load spec (400W) We know we’re going to build a double-conversion design and we’re considering a couple of alternative topologies. We pretty much know the external-interface specs (some details may change).

I’m expecting both my prototype copy of the forebrain Unix SBC (an Olimex LIME2) and the interface contract for the high-power subsystem to land on my desk tomorrow.

Interest in this project continues to be huge. Another company wants in as of this morning. The volume of feature requests is high enough that I’m buckling under the editing load.

The rest of this post is instructions to potential contributors about how to get on board.

1, Get an ID on GitLab. Tell me what it is so I can add you to the project group.

2. If you have a feature request, please Don’t post it on this blog. Add it to the “General feature request thread” on the tracker.

3. Read the wiki. Read the tracker issues. I try to keep both pruned so the volume is not overwhelming. Read the Rejected Ideas page on the wiki, too.

4. Read the design documents in the project wiki. The important one is the transaction design; the I2C message inventory will change, but the basic state diagram probably won’t.

5. Participate in the design discussion. This takes place in tracker threads.

6. When we’re ready to breadboard a prototype, throw some parts money in the tip jar we don’t have yet. If you must contribute before then the PayPal blogbutton works fine.

7. Prototype builds will probably go down at PA Makerspace in Phoenixville, PA. If you are within driving distance and a competent electrics tech, consider joining us for a build.

8. Once we have a full design with a PC board and enclosure: if you have a shop facilities for it, try to replicate the build. We’ll know we have the build recipe debugged when other people can do it.

9. If your favorite hardware feature request doesn’t appear in the version 1 prototype, relax, We may think it’s a good idea but be holding off till v2 out of a desire to keep v1 simple and launch fast.

10. If your favorite software feature request doesn’t appear in the version 1 prototype, pitch in and make it happen. A Unix SBC is not a difficult programming environment – the OS on this one is a Debian port.

After step 10 and a couple of design iterations the future becomes less clear. maybe try to get it into volume manufacturing through a partnership with an established vendor.

Mar 06

Stop logging in local time!

Inertia is a powerful force. The computing world retains a lot of practices that are odd little dysfunctional relics of past stages of its technology. The one I’m here to talk about today looks like this:

Mar 6 15:11:07 snark postfix/qmgr[3927]: 0422513A6C53: removed

That’s a log message hot’n’fresh from my /var/log/mail.log file. It’s entirely typical of traditional log formats on Unix systems, and these things offend the bejeezus out of me every time I see them. Now let me show you how this would look in a sane universe:

Continue reading

Mar 05

All of his complexion…

Andrew Klavan has a thoughtful essay out called A Nation of Iagos. In it, he comments on William Shakespeare’s depiction of Jews in a way I think is generally insightful, but includes what I think is one serious mistake about the scene from The Merchant of Venice in which the (black) Prince of Morocco woos Portia.

He chooses poorly, fails her father’s test, and as he leaves Portia mutters “May all of his complexion choose me so.”, which Klavan reads as a racist dismissal. I winced.

I tried to leave a comment on the essay only to find when clicking “Post” that it required a login on the accurséd Facebook, with which I will have no truck.

Here it is:

Continue reading

Mar 03

upside wants a firmware dev

The UPSide project, announced here two weeks ago, has come together with amazing speed.

We now have:

* A hardware lead – A&D regular Eric Baskin – with thirty years of experience as a power and signals engineer. He is so superbly qualified for this gig that my grin when I think about it makes my face hurt.

* A high-level system design (about which more below) that promises to be extremely capable, scalable, flexible, and debuggable.

* A really sharp dev group. Half a dozen experts have shown up to help spec this thing. critique te design docs, and explain EE things to ignorant me.

* Industry participation! We have a friendly observer who’s the lead software architect for one of the major UPS vendors.

* A makerspace near me where the owner recruited himself onto the project and is looking forward to donating bench time and skilled hands to the hardware build.

All this helpfulness almost – but not quite – fills in my deficits as a designer/implementer. I don’t really know from hardware design, so I’m attacking the problem with the modularity and information-hiding principles I know from software.

Here is how the design looks:

An I2C bus that ties together a “forebrain” which is a Unix SBC, almost certainly at this point an Olimrx LIME2, with a “midbrain” that is an Arduino-class microcontroller.

The midbrain is mechanism – a simple state machine whose job is to control the high-power subsystem (inverters, battery, AC input and output). Policy decisions and stuff like battery state modeling will live in the forebrain. It will also run the USB and Ethernet interfaces, and host the development environment for the firmware

The forebrain will talk to a 20×4 LCD panel over I2C, and various other controls like alarm mute and self-test buttons via GPIO pins.

I’ve actually written the spec for the I2C bus messages already. And here’s your cute hack for the day…

I realized early on that one of the first things I needed to do was draw a state/action diagram for the system so I could pin down its behavior in response to any given transition in its environment (mains power up, mains power down, battery dwell limit approaching, those sorts of things). So I reached for one of my favorite tools, a graph-drawing DSL called dot.

Only when I write the first version of the graph, I found the dot markup cluttered and repetitive. So I wrote a couple of cpp macros named “state” and “action” that expand to dot markup, and expressed the graph as a sequence of macro calls.

Then I blinked, looked again, and realized…hey, I could compile these calls to C source code for a state machine! And now it is done – I can already generate the tricky part of the application logic for the midbrain directly from the state/action diagram. (The action functions are stubs but the control flow is all there.)

(If the fact that I just solved a design problem by writing a DSL to generate code in another DSL and provably correct equivalent C application logic seems weird to you, you must be be new here. This is how I think all the time. It is obedience to the Unix wisdom: never hand-hack code you can generate from a higher-level description.)

This, however, does not solve the entire firmware problem by any means. The midbrain’s going to need system logic to do things like receive and send I2C messages, poll A2D converters from sensors watching the mains and battery voltage, and so forth.

Accordingly, we need a firmware developer. I’ll learn how to do this if nobody steps up (which is why I said “wants” in the post title) but the whole process will doubtless go faster and more smoothly if we have someone with experience. So:

WANTED: One firmware hacker. Must be familiar with AVR-class microcontrollers and the Linux toolchains for them. Experience with I2C and low-level programming of USB endpoints would be a plus. Perks of the job include getting one of the first UPSides made, your name in lights, and working with a dev crew that is impressive even by my elevated standards.

EDIT: Well, that didn’t take long. A&D regular Jay Maynard has signed on.

Feb 26

How elites are blind about immigration

I had been thinking about posting about immigration recently, because some facts on the ground have caused me to move away from a pure laissez-faire position on it. A few minutes ago I wrote a long comment on G+ that I realized says a lot of what I wanted to. This is a slightly revised and expanded version of that comment.

I am asked, by another member of the educated white elite, why we shouldn’t simply end border enforcement entirely rather than buid a wall or tolerate Joe Arpaio’s squalid detention camps.

Both here and in Europe there’s been a significant spike in communicable diseases that can be traced back to low immunization rates in what Trump may or may not have called “shithole” countries.

Crime is a real issue. Legal immigrants have a slightly higher criminal propensity than the native born (the difference is small enough that its significance is disputed) but illegals’ propensity is much higher, to the point that 22% of all federal incarcerees are illegals (that’s 92% of all jailed immigrants).

But the elephant in the room is the impact of illegal immigration on social trust.

Continue reading