Paleotech, through the eyes of a Millenial…

What happens when you give a modern teenager a Walkman? You get some interesting insights about technology. It’s amazing how far technology has come — and a reminder that yes, there really is such a thing as paleotechnology. (For us children of the 70s, the fact that cassette tapes have two sides is completely intuitive. For someone seeing a Walkman for the first time, perhaps not.) For how many other forms of technology might we forget some of the nuances, or even some of the important things?

Fellow paleotechnology expert DOSquatch writes about the subtle yet extremely important art of troubleshooting. He definitely has a point. I would also add that it’s important to document technologies as they are developed, lest we end up having to reinvent them all over again to get them to work (or end up breaking them inadvertently).

Actually, the comparison between a Walkman and modern mp3 players is a good example of how technology is not only progressing, but accelerating. When my grandparents went on a trip to Japan and brought back one of the first electronic calculators, it was definitely new — but easily understood in a few minutes. When cassettes started to take over some of the role of record players*, they too were relatively easily understood. Increasingly, though, the capabilities of new devices are breaking down old barriers and requiring new ways of thinking about things. (This isn’t necessarily a Bad Thing, but it bears mentioning.)

For instance, try explaining the subtle relationship between mp3 files and playlists to someone who doesn’t truly grok filesystems, shortcuts, and links. You might be able to explain it, but it will take a lot of explaining. Try a more advanced topic, like why a satellite-modem connection works fine for streaming audio but is horrible for interactive websites — and the explanation can take much longer. Bring DRM, P2P, streaming, file sizes, bitrates, codecs, protocols, IP addresses, connectivity, lag, bandwidth, Bluetooth, AC3 and oversampling into the conversation, and suddenly you’re speaking a foreign language.

Technological progress is definitely accelerating, and every year, I hear more and more people talk about the Singularity. I’m even starting to believe it myself. A lot of it does sound farfetched — yet technical progress in many fields is starting to look asymptotic. We definitely live in interesting times: they say that by 2025, supercomputers should be sufficiently powerful to run realtime simulations of the human brain. With computer speeds doubling every year or two, we could well end up as spectators to the fastest and most profound changes in history.

As long as we can control the direction things take, though, I, for one, welcome our new robotic overlords.

* Yeah, yeah. Nobody, least of all me, is going to claim that cassettes beat LPs for audio quality. I draw the line at CDs, though. Maybe 44.1kHz/16bit isn’t optimal, but it sure beats dragging a rock through a plastic groove.

Posted in Analog, Digital, Nostalgia | Leave a comment

Digital blasphemy?

When is a 555 not a 555?

When it’s really a PIC!

The design of the DrACo/Z80 computer calls for a 555 timer (a great piece of paleotech, even if it still isn’t sure after 38 years whether it’s really a digital or analog part.) However, for running higher-speed programs on the DrACo, I wanted to have the option to, as Emeril might say, “kick it up a notch.” I figured that a PIC12F683 would do nicely, since it could be programmed to provide a nice, stable TTL clock output without any external components.

The only problem was, the PIC’s ground lead is on Pin 8 and its power lead is on Pin 1; the 555 has the opposite configuration. The solution? Possibly the single ugliest soldering job I’ve done in a long time (and that’s saying something, folks.)

Yet, it works — and is a nice, drop-in replacement for the 555, swapping the astable oscillator mode for a much faster 2MHz clock output.

This is also the single shortest program I’ve ever written for a PIC:

   org 0x00
   banksel OSCCON
   movlw 0x70
   movwf OSCCON

   goto $

It sets the clock to 8MHz, then sits in a single-instruction loop and contemplates its navel. So, for that matter, when is a PIC not a PIC? When it’s not doing any computing at all — but just providing a 2MHz CLKOUT signal.

But sometimes, the smaller the MCU, the more creative the applications. I’ve heard of people using microcontrollers in fireworks to provide split-second timing for the pyrotechnics. At 30 cents each for something like the 10F200, it only sounds crazy until you think about it.

…and yeah, this project could have been very easily done with a less expensive PIC — but 12F683s are so versatile that I keep a couple dozen of them on hand for various things. They’re like digital LEGO…

Posted in 555, Analog, Digital | Leave a comment

Thatsa lotta beer!

The statute of limitations is up on this by now, I think…

Back in the day, several ne’er-do-well CS students were enrolled in a certain CS150/151 class/lab, taught by a certain D. Ray with a certain M. Ghose as a lab TA. As the legend goes, they were bored in lab one day (having finished the ridiculously easy assignment in a few minutes, but not being allowed to leave early). They got the idea to put into practice their newfound knowledge of unsigned long integers (32 bits of nonnegative goodness, on those machines) by writing a technological take on the age-old “bottles of beer” song known and loathed by school-bus-drivers everywhere.

The technological take was to make the computers “sing” the verses of “Four billion bottles of beer on the wall” by writing the verses out to a disk. The code looked something* like the following:

#include <stdio.h>
int main(){
   unsigned long long beernum;
   for(beernum=4000000000;beernum>0;beernum–){
      printf(“%llu bottle”,beernum);
      if(beernum!=1) printf(“s”);
      printf(” of beer on the wall,\n”);
      printf(“%llu bottle”,beernum);
      if(beernum!=1) printf(“s”);
      printf(” of beer,\n”);
      printf(“Take one down,\n”);
      printf(“Pass it around,\n”);
      printf(“%llu bottle”,beernum-1);
      if(beernum!=2) printf(“s”);
      printf(” of beer on the wall…\n\n”);
      }
   return(0); //Outta beer, outta here!
   }

They finished writing it, so the story goes, just before the lab period ended, and set it in motion, telling their friend in the next section that it might be a good idea to save his work. Apparently the sysadmins hadn’t heard of disk quotas, because the drives rapidly filled up with the verses of what had to be the world’s longest song. According to aforementioned friend, one of the sysadmins ran into the lab about halfway through the next section, asking for certain students by name.

The interesting thing is, Moore’s Law being what it is, while such files might not fit in a user’s disk quota, they probably wouldn’t crash the server, either; at about 124 bytes per verse, the “song” would take up about 496GB (depending on whose definition of a GB you use.) This would actually fit on the free space on my 1-TB drive on my workstation at home (MSRP of just under a hundred bucks.)

Moore’s Law rocks.

* OK, so this isn’t the original code by a long ways — but it gives the flavor. The original:

  • was written in Pascal, not C;
  • wrote to the disk instead of standard I/O, and
  • probably didn’t have the fancy “bottle” / “bottles” code
Posted in Coding, Humor, Nostalgia | 1 Comment

Linus Has Spoken

I was reading a recent article (“Real Men program in C”) recently, and came across a link in the comments to Linus Torvalds’ opinion on the whole C-vs-C++ thing. Let’s just say he doesn’t mince words. (This is an excerpt, but it captures the flavor of the original post.)

What Linus said.

C++ is a horrible language. It’s made more horrible by the fact that a lot of substandard programmers use it, to the point where it’s much much easier to generate total and utter crap with it. Quite frankly, even if the choice of C were to do *nothing* but keep the C++ programmers out, that in itself would be a huge reason to use C.

In other words: the choice of C is the only sane choice. I know Miles Bader jokingly said “to piss you off”, but it’s actually true. I’ve come to the conclusion that any programmer that would prefer the project to be in C++ over C is likely a programmer that I really *would* prefer to piss off, so that he doesn’t come and screw up any project I’m involved with.

C++ leads to really really bad design choices. You invariably start using the “nice” library features of the language like STL and Boost and other total and utter crap, that may “help” you program, but causes:

– infinite amounts of pain when they don’t work (and anybody who tells me that STL and especially Boost are stable and portable is just so full of BS that it’s not even funny)

– inefficient abstracted programming models where two years down the road you notice that some abstraction wasn’t very efficient, but now all your code depends on all the nice object models around it, and you cannot fix it without rewriting your app.

In other words, the only way to do good, efficient, and system-level and portable C++ ends up to limit yourself to all the things that are basically available in C. And limiting your project to C means that people don’t screw that up, and also means that you get a lot of programmers that do actually understand low-level issues and don’t screw things up with any idiotic “object model” crap.

Posted in Coding, Humor | 1 Comment