11.001001000011111101101010100010001000 Arithmazium
Home

Versions of Paranoia

Since its release in 1982, Paranoia has enjoyed enthusiastic migration to other popular languages. You can find them at Netlib, the repository of mathematical software, papers, and databases.

What do you call it?

This discussion touches on several flavors of the Paranoia program. Some shorthand will tidy up the discussion, with a distinctive style to call attention to the reference to a specific version. We'll use ParaBas (pair 'a bass, as they say in Wisconsin, you know) for the Basic version, adapting the file extension for other versions like ParaPy, the focus of this discussion.

Basic

ParaBas version A1.10 by William Kahan, released May 1982, is here at Netlib, the repository of mathematical software, papers, and databases.

Version A1.11 updated for this site in 2020, is here. The changes are small:

  • Bump the version number in the introductory PRINT statement.
  • Remove an unwanted ' character in line 110.
  • Reverse the inequality in line 5390, as explained in the Basic and Python.
  • Change all instances of >< to <>, the more modern symbol for \( \ne \) in Basic.
  • The three new lines are comments, with distinctive line numbers xx3 and the initials JTC.

    This is a fascinating body of code and you're encouraged to have a look at it. Pro tip: a good place to start is the bottom, where you will find a handy glossary of the variables.

    Pascal

    Brian A. Wichmann of the National Physical Laboratory in Britain re-coded Paranoia in Pascal in 1985, with contributions by David M. Gay and David G. Hough. You can find the 1988 edition of ParaPas on Netlib here. Wichimann used his version of Paranoia to test NPL's new Pascal compiler.

    C

    Thos Sumner of the University of California, San Francisco ported ParaPas to C in 1985, with later help from Gay and Hough. ParaC 1992 is here at Netlib. Some users have modified ParaC from its interactive form to a command-line tool to be used as a numerical sanity check in systems development.

    Work on the Python version has revealed several bugs in the C version. They should find their way to an update to the Netlib version, eventually.

    Fortran

    Naturally, Paranoia has a Fortran edition. Or two. Netlib has versions to be compiled for single precision and double precision. We refer to them together as ParaTran.

    Modula-2

    Among the spate of early Paranoia codes is K. Y. Tan's port of the Pascal version to Modula-2. The 1986 edition of ParaMod is here at Netlib.

    Forth

    Krishna Myneni ported ParaC to Forth-94 in 2009. ParaForth is not yet in Netlib, but you can find it here.

    Python

    I converted ParaC to Python semi-automatically in 2019. Like the ParaPas and ParaC, it looked like a large Basic program in sheep's clothing. It had many global variables, often recycled for multiple uses, and few subprograms.

    To exploit many excellent features of Python and to make the program more readable, I completely restructured Paranoia as a set of independent test functions called from a code sequence mirroring Kahan's original Basic. Everything happens in the same order, but in a more modular structure.

    The next page explains how this discussion carves ParaPy up to deal with it in bite-sized chunks. To see the whole program, or just run it yourself, click here on this site.

    ParaPy will find its way to Netlib when the dust settles.

    Julia

    A clear next step is ParaJ in the Julia language. To be continued...

    Home