Sunday, March 25, 2007

They're Watching

Reading an article in the paper today I was struck again by the credulity of journalists, who are capable of being sold any story, no matter how ridiculous, provided it's framed so as to reinforce their belief in their own cynicism. The particular case in point was a claim that the British secret service have developed a device that allows them to read the information on a computer screen using nothing more than the reflections on the user's face. From, oh, half a mile away... Hmmm... I suppose you could get a specular reflection from the... No. Forget it - there are much easier ways to do this.

But it did have me wondering why the spooks would bother putting out such a story, assuming they did. Presumably to cover up the way they really do it...

And thinking about the number of different ways you could do it got me wondering about computer security in general, and the great unanswered question of why the hell any sovereign government other than the US would allow Microsoft to sell Vista to their citizens, let alone use it in their government departments, when MS or anyone else who has access to the relevant codes can use the content protection (ha ha) features to pull the plug on any Vista machine whenever they want.

It seems to me that there is a strong case to be made for all 'essential' computing to be done using open source software on open sourced hardware, unfortunately there's a much stronger case to be made that all politicians are incompetent to even understand the problem.

Of course, you don't have to worry about this if you believe his Billiness is a nice guy who won't ever use them maliciously or to gain a commercial advantage, and that the US government doesn't have access to them, and that no hacker will ever have access to them, and no virus will ever be written that 'bricks' your computer using them, and so on.

(Bricks means to turn your computer into a brick, ie, stop it functioning. Vista has introduced ways to do this remotely, and not just by causing the software to malfunction through the usual programmer incompetence, hard as it may be to believe Vista certified hardware can be told to stop working, and it then becomes permanently useless. Bet it doesn't mention that on the box...)

But maybe I too suffer from excessive cynicism, because I suspect that behind all this submission is a naive government that has been fed a few crumbs allowing them back door access to Windows, and they're so fucking stupid they've sold the rest of us down the river to a foreign power in exchange...

Not that I don't admire MS for trying; in one stroke they stand to make the PC a closed-architecture machine and so kill off Linux, a master-stroke of industrial ruthlessness. Pity they're being allowed to get away with it, though ultimately I suspect that a few billion Chinese won't give a fuck and all MS will achieve is to slightly speed the end of western domination of the IT industry. I'm tempted to say good riddance...

Think I'm too paranoid? See

Wednesday, March 21, 2007

Programmers Can't (part deux)

Wrote this for another conference, but I just can't be bothered any more.

> ISTR the core of a 3D modelling app in the 90s was written in
> assembly.

Shock! Horror! Never! Not the 90s!

Sorry, but this thread is becoming increasingly surreal; it's true enough that most programmers these days are writing non-critical applications for absurdly fast machines and so don't need to care much about efficiency, but there's still plenty of assembler being used where performance and reliability do matter.

For all the exaggerations put about the difference between compiled code from an efficient language (C, for example) and competent assembler is very rarely less than a factor of three (execution time) and can be several orders of magnitude. A sensible rule of thumb is that on average a bloody good compiler will emit code that runs about three times slower than bog-standard human assembler. It's meaningless to discuss the ratios for optimised assembler; it depends too much on specific circumstances. Besides, outside the fevered imagination of other programmers the reality is that assembly programmers very, very rarely bother to optimise their code; bog standard assembler is usually fast enough.

The performance difference between compiled code for an inefficient language, as most are these days, and assembler is correspondingly greater; frankly only a fool would consider them comparable, so I find it fairly disturbing that so many programmers are ignorant enough of the basics to talk about compiled code and human produced assembler without understanding that the two things are really poles apart.

Now, every time the subject comes up on cix it gets bogged down in irrelevancies - "I don't use assembler because it makes the dog throw up", or "It took me five years to write a Hello World program in BASIC, I wouldn't live long enough to do one in assembler", or "I knew someone who knew someone who had a friend who wrote everything in assembler, even love-letters, but they gave up when compilers started producing better code" without mentioning this happened after they'd become so senile they couldn't remember their own name, or whatever, so don't expect me to do more than this one grump. If anyone needs a reality check have a look at some of the compiler code dumps in cix:avr, or cix:zeitgeist/mp3vsassembler:8 where I've looked in some detail at the code emitted by compilers (mainly C/GCC). I might be persuaded to argue the case in mp3vsassembler, I suppose, but frankly I doubt it.

Still, this is a beginners topic, I suppose. Perhaps for our next excursion into profound ignorance we could round up a few virgins and get them discussing sex? I'm sure we could find a few who'd consider themselves Don Juan on the basis of their first fumble; be much more fun to read and maybe more relevant to linux than the ramblings of a few programmers who "saw some assembler once" and believe that makes them experts in computer science. Just a thought...


(cix: August 2006)

RAD tools aren't a new thing...

Someone asked me why this wasn't republished in grumbles, I though it had been.

The comment was originally inspired by a thread where some poor sod was discussing a god-awful vax cross-assembler that used to assemble Z80 code at the rate of a couple of lines of source per second. This was back in the 80's, and even then that sort of performance was laughably slow. Not that I have much sympathy with programmers who put up with garbage development tools - we always wrote our own, and as a result while that idiot was waiting half an hour or so for each build we'd have been long finished and off down the pub. Each to their own, I suppose...

From cix:flying_gerbils, Nov 2001. This was a glimpse of what life was like in the fast lane of software development way back when we were fab, not flab ;)

It is the mid 80's. In a bedroom in Manchester crem leans back from his computer and idly fondles his sleeping girlfriend**. ParaSys, his IDE, notices he's stopped typing and assembles several thousand lines of Dark Star source, links it and sends it across the network to the target machine. Debugging windows open, soft-scrolling command histories in the couple of seconds this entire process requires. The game starts. ParaSys emulates user interaction until a watch point event fires and traps the application. The editor window moves to the offending line and register displays slide into place. Crem groans. Lesley stops groaning. He leans forward and single-steps through a few lines of code, then changes one with ParaSys automatically updating the syntax-highlighting and error markers as he types. He leans back and seconds later both games continue with renewed enthusiasm... Twenty seconds have passed...


It is nearly twenty years later. In an office in wales crem leans back from his computer and idly fondles himself. Ameol doesn't notice. Lesley is long-gone and the only thing groaning is his chair...

** Games weren't written in bedrooms for nothing, y'know.

Monday, March 19, 2007


I have long cherished the ambition to stop working on tedious industrial products and get involved in something more satisfying, something with human interest, something that increases the sum total of human happiness... In short, sex aids.

The opportunity arose last week. One of my friends managed to wear out her favourite toy and asked if I could fix it; reluctantly, after several fractions of a second of arm-twisting, I agreed.

On inspection all that was wrong with the poor thing was that the wires were broken - it was one of the ones that has a control box and a variety of plug-in, erm, attachments. These had all been used to the point where they were intermittent; a simple enough fix - some more flexible cable, some heat-shrink tubing, some user-testing [cold shower] and the job's done. Unless, of course, you have the sort of mind that opens the control box, looks at the inevitable 12C508 PIC, and thinks "PIC? I'm not having any of my friends having sex with a fucking PIC..."

So, a couple of hours later we have a new improved AVR version. From eight 'programmes' to forty; pulses, sequences, sawtooths, triangle waves, variable speeds...

Source (Zeus) code for the AtTiny15 can be found at

Enjoy ;)