Twenty years after

I just shipped what was probably the silliest and most pointless software release of my career. But hey, it’s the reference implementation of a language and I’m funny that way.

Because I write compilers for fun, I have a standing offer out to reimplement any weird old language for which I am sent a sufficiently detailed softcopy spec. (I had to specify softcopy because scanning and typo-correcting hardcopy is too much work.)

In the quarter-century this offer has been active, I have (re) implemented at least the following: INTERCAL, Michigan Algorithmic Decoder, and a pair of obscure 1960s teaching languages called CORC and CUPL, and an obscure computer-aided-instruction language called Pilot.

Pilot…that one was special. Not in a good way, alas. I don’t know where I bumped into a friend of the language’s implementor, but it was in 1991 when he had just succeeded in getting IEEE to issue a standard for it – IEEE Std 1154-1991. He gave me a copy of the standard.

I should have been clued in by the fact that he also gave me an errata sheet not much shorter than the standard. But the full horror did not come home to me until I sat down and had a good look at both documents – and, friends, PILOT’s design was exceeded in awfulness only by the sloppiness and vagueness of its standard. Even after the corrections.

But I had promised to do a reference implementation, and I did. Delivered it to the inventor’s friend. He couldn’t get it to work – some problem with the version of YACC he was using, if I recall correctly. It wasn’t something I could fix remotely, and I left it to him to figure out, being pretty disgusted with the project. I don’t know if he ever did.

I did fix a couple of minor bugs in my masters; I even shipped occasional releases until late 1996. Then…I let the code molder in a corner for twenty years.

But these things have a way of coming back on you. I got a set of fixes recently from one Frank J. Lhota, forward-porting it to use modern Bison and Flex versions. Dear sweet fornicating Goddess, that meant I’d have to…issue another release. Because it’s bad form to let fix patches drop on the floor pour discourager les autres.

So here it is. It does have one point of mild interest; the implementation is both an interpreter and a compiler (it’s a floor wax! It’s a dessert topping!) for the language – that is, it can either interpret the parsed syntax tree or generate and compile corresponding C code.

I devoutly hope I never again implement a language design as botched as Pilot. INTERCAL was supposed to be a joke…

59 comments

    1. >Can you do LISP 1.5?

      I could, but it’s not like Lisp implementations are thin on the ground.

      I prefer doing weird old languages nobody has thought about in decades.

  1. You touched it, you own it.

    Forever, or until you can foist it off on some other sucker get someone else to take it.

  2. I can remember seeing Pilot in action (demonstrated at a show) in about 1978, but never got around to having a platform that could run it. There was also a magazine article with a substantial CAI program listing – longer than the examples in your tarball, maybe about half a dozen printed pages – taking the user through a reasoning problem with a sort of Arabian theme. I may even still have a copy of that magazine, so will try to locate it.

    Your CUPL is obviously the original (and also with the distinction of having the first ever Wikipedia page that I’ve seen using the word “chrestomathy”). Presumably you know, though, that the same name/acronym was used in the mid 1980s for a programmable logic design language. It was well used in the electronics industry at the time, up until the advent of VHDL and similar.

    1. >(and also with the distinction of having the first ever Wikipedia page that I’ve seen using the word “chrestomathy”)

      They copied that from my documentation for the package.

  3. >the silliest and most software release of my career

    So silly, much software, wow.

    > [empty post]

    And here students we see the hacker channeling the great Zen Master Foo himself to demonstrate the traits of an efficient program.

  4. I wrote a Pilot interpreter for the B7700 back in 79-80. I used it at a University and a College to do limited courseware and a lot of drill and practice. It wasn’t a big deal as I recall but I’ll need to look at ESR documentation to see what I may have missed.

    It did have some graphics support for the Tektronix terminals so there wasn’t really any animation. Graphics got ported to a version of the Plato “orange” screens and that gave us some better animation abilities.

    1. >In proper French that’s “pour décourager les autres”, but
      “discourager” has a nice ring to it :)

      I know. I was deliberately mangling the Voltaire quote from Candide – the misspelling was intended to lampshade the mangling.

  5. esr:

    Missing adjective restored.

    Yes, but your empty post – which Foo pointed out as well – is still empty.

    Also, you wrote: “…had a good at both documents…”. Did you mean “had a good look at both documents”? (Interestingly, the idiom “to have a look” – as opposed to “to take a look” – appears to be British. I seem to recall that you lived in England for a time, and that this isn’t the first time you revert to that dialect. In my book, that’s a good thing. ^_^)

    …the misspelling was intended to lampshade the mangling.

    When you write “le trahison” instead of “la trahison“, is that deliberate as well?

    1. >When you write “le trahison” instead of “la trahison“, is that deliberate as well?

      No, that was an error. My French is rusty.

    2. >Yes, but your empty post – which Foo pointed out as well – is still empty.

      I don’t see it. URL, please?

    3. Mangling French genders has been a special privilege of anglophones at least since Thomas Malory’s Le Mort Darthur in 1485.

  6. esr:

    Fixed.

    Yes, but now you have two consecutive posts that say almost exactly the same (about Lisp 1.5).

    This is a lot like Life Stinks‘ corn scene, eh? ;-)

  7. I remember mentioning to you that your MAD implementation should generate Fortran instead of C, since MAD is just a hacked up Fortran 66 that included some features of Fortran 77.

    1. >I give you… COMIT

      Now that is weird enough to pique my interest. Can you turn up any actual COMIT prgrams? Other than the toy examples in the paper, I mean.

  8. esr:

    Fine, leave the corn on your face. Could you at least explain what “to have a good at X” means, please? I searched the Web, but to no avail.

    Say, ever heard of Refal? I’m not sure it’s unmaintained, but it seems obscure enough for this thread. Why, it’s never been mentioned here and there’s no implementation of it in Canonical’s repositories.

    Hope you find it interesting.

    1. >Fine, leave the corn on your face. Could you at least explain what “to have a good at X” means, please? I searched the Web, but to no avail.

      I think the verb “look” is missing. The refresh troubles with the site have made proofing and editing trickier than usual. And now I’ve lost track of where this was. URL, please?

  9. esr:

    I think the verb “look” is missing.

    Isn’t it a noun in this case? :P

    The refresh troubles with the site…

    Ah, so you’re experiencing those as well. I’d dismissed them as perhaps a problem of mine. Any idea what could be causing them?

    URL, please?

    It’s in the OP. You wrote: “…I sat down and had a good at both documents…”

    And by “the corn on your face” I meant your nearly-identical comments on Lisp 1.5 – you may want to delete one of them. (The corn metaphor, of course, was inspired by the aforementioned Mel Brooks film.)

    1. >Any idea what could be causing them?

      Best guess is that ibiblio’s Apache instance is feeling a bit colicky. It doesn’t seem to be browser-specific and wasn’t fixed by a WordPress update.

  10. Best guess is that ibiblio’s Apache instance is feeling a bit colicky.

    That’s a shame. I hope they manage to fix it.

    Anyway, thanks for correcting the mistakes that remained, including one I hadn’t pointed out (“in the paper. I mean” –> “in the paper, I mean”). I guess Bill Clinton was right: “If things don’t go your way, just keep complaining until your dreams come true.” :-)

  11. One of the things I want to implement for my programs is a better input-script type language for my engineering programs. I haven’t quite made the mental leap needed to understand how to write an interpreter for a fully general language (say, something like Python, though I don’t need anything nearly that complex).

    (It’s probably not a question that can be answered in a single post, but..) How do you go about thinking about this sort of problem?

  12. @MadRocketSci:

    One of the things I want to implement for my programs is a better input-script type language for my engineering programs. … How do you go about thinking about this sort of problem?

    Answer 1: Please don’t reinvent the wheel. There are plenty of guides on how to hook pre-existing languages like Lua or Python into your application. If you need “something like” an existing language, first see if there is any sort of API you can use to include it in your program.

    Answer 2: This is certainly something that can’t be answered in a single post, because the topic is pretty much an entire course path in college / graduate studies. I would suggest OCW as a good stock of courses you can view online as a starting point.

  13. Eric,
    This is an off topic question but, have you ever shared your opinion on the Go programming language?

    1. >This is an off topic question but, have you ever shared your opinion on the Go programming language?

      No. I might post about this sometime.

  14. @MadRocketSci: Definitely agreed with Alex. One possibility is to look into a language like Groovy that’s explicitly designed to make DSLs easy; it’s basically syntactic sugar that uses closures to convey grouping and words as method names or lookup symbols. What you end up with is something that looks sort of like JSON but is an executable program backed by the JVM runtime.

  15. Dear Eric
    I am enjoying The Cathedral & The Bazaar. I am a programmer. I probably cannot qualify as a hacker, but I am really enjoying reading someone else’s thoughts about the stuff I think about all the time but have no one with whom to discuss it all.

    I write to you, however, because of your references to Sci Fi fandom. My sister, Adrienne Fein, was the author of Feinzine. She died young of cancer. I am on a quest to find some old hard copies of her zine and perhaps even some of her old fandom friends. We are talking circa 1980 New York area. Her friends were Arthur from New Rochelle and Bear from Inwood and Bear’s wife who was head of Wicce. Sadly that’s all I know.

    Any thoughts on fans I might inquire of or other avenues I might pursue would be greatly appreciated. Of course I will fan the hope that your reply later today will be filled with excitement because you knew her. She was a rare soul.

    Thanks Eric.
    Mary Helen Fein

    1. >I am on a quest to find some old hard copies of her zine and perhaps even some of her old fandom friends

      I can help some. I knew Adrienne, though we were not especially close, and I can identify those two people. “Arthur” is undoubtedly Arthur Hlavaty, and Bear was the nickname of a man named Neil Belsky. I believe I remember hearing that Neil died a few months ago, but Arthur is still very much around. Hlavaty is a sufficiently unusual last name that you should have no difficulty finding his Web presence.

      I don’t remember for sure if Adrienne was a member of Golden APA, but I think she was. If so, Arthur will still have hardcopy of a lot of her zines and can introduce you to other friends of hers from that time.

  16. You could reimplement a wonderful old BASIC compiler for DOS called ASIC, by 80/20 Software (the pun is implicit in the name.) It would be wonderful to see it run on a Linux command line. I don’t know where you’d find the specs, however. It generated a “Hello World” that was about 500 bytes long, most if it zeros, and the resulting code was super fast. It would also take inline assembler code and run it within your executable. It was just beginning to develop its own ecosystem when Windows 95 showed up and the software was never updated after that.

  17. The SIL Academic Computing folks did something called “Rational Pilot” back in the mid-80s, where “rational” mostly mean (a) adding useful features like sane control flow, and (b) leaving out the worst mis-features.

    Never really went very far, but I treasure the memory of it because one of the docs is, to date, the only ISBN associated with my name:

    http://www.hopl.info/showlanguage.prx?exp=4568&language=RAP

  18. You could reimplement a wonderful old BASIC compiler for DOS called ASIC

    Wow. I remember getting a copy from the local shareware dealer!

  19. I was digging in the “archives” for something else and came across some info that I had used for the Pilot that I wrote for the mainframe. After the initial Pilot, John Starkweather had made some improvements and they got published as “Nevada Pilot” from Ellis Computing. (You may remember Ellis from the CP/M days with Nevada Cobol, Fortran, Pilot and Edit series. Cool software for about $30 a throw.) He had added things to allow files to be read / written, different displays, better graphics, etc. I had used some of these extensions for Pilot, the biggest use was so that instructors could grab data about how the students did.

    I did spend some time looking at ESR’s code, and I can see why he hated doing this. YACC/LEX are not the right tools for Pilot. It was designed to be as simple as possible, with minimal effort to port it / write it for a new platform.

    Thanks for the walk back memory lane.

    1. >Do BLISS next.

      I’ve looked at it. Not weird enough, and too tied to systems programming in dead hardware environments. There aren’t any interesting code examples.

  20. @Kirk: Small world. My parents work with SIL and we went to the same church as Gary Simons for a few years.

    1. I’ve done a Trac 64 and I’m seriously thinking about a modern version of Fact, dynamically typed, with tapes that are XML documents (where else do you have hierarchical data nowadays?) and tables that are implemented in SQLite. Check WP, though; there definitely was an implementation, unless this is another case of multiple languages with the same name.

  21. Have you tried to use Marpa or Perl6 grammars (a variant on PEGEX parsers, I think) instead of LALR yacc or bison / lex?

  22. I’ve always been vaguely hopeful for a modern implementation of PROMAL, an obscure 1980s language with bytecode interpreters for the Apple II, Commodore 64, and MS-DOS. Glenn Holmer has put PDF scans of the original manuals (including the language reference), as well as the original C64 development environment and some third-party PROMAL programs, on a web page: PROMAL for the Commodore 64

  23. Do we need to send a cadaver dog to sniff this site?

    ;)

    Hard to believe you haven’t spouted *something* about the recent electoral shit-show…

  24. I’ve seen Eric make a few comments here and there about the election, but they’ve all been on his G+ page.

  25. Ah…I don’t pollute my life with the google ecosystem.

    Actually, I don’t pollute my life with the intertubes in general…

    I’m an ironic luddite

  26. Say what you will about PILOT, I owe my entire (successful) career in programming and solution design to it – it is the language I cut my teeth on and which got me excited about programming. At the tender age of 14, back in 1983, my parents sent me to a vacation programme designed to teach high-schoolers to code. I spent a week doing amazing things on Atari PILOT, and was hooked. BASIC came next (C64), machine code followed, but I lost my virginity to PILOT, and I have an irrational fondness for the language.

  27. I actually found this page after finding a copy of the standard (I’d ignored the References in the Wikipedia article), and grabbed a copy of the “reference implementation”, mostly to look at the sample programs.

    I agree with you about the craptasticality of the standard as written, though I only have a fifteen-page PDF which calls itself out as “Corrected Edition November 1991”; I don’t have the loose corrigenda you mention.

    Nevertheless, I’ve managed to write a functional implementation of the language in PowerShell; if nothing else, it’s given me some good insight into the process of writing language interpreters.

Leave a comment

Your email address will not be published. Required fields are marked *