Est. 1995 Intermediate

hackMongo

A locally extended dialect of Mongo, the FORTRAN-77 astronomical plotting package written by John Tonry, adding variables, loops and conditionals to a graphics command language - and, despite its name, having nothing whatsoever to do with the MongoDB database.

Created by Not formally credited. The only named person associated with hackMongo in the public record is Geza Gyuk, then at the University of Chicago Department of Astronomy and Astrophysics, who wrote and submitted the sole surviving hackMongo program. Whether he authored the extension itself or merely used a dialect maintained by others in his department is not established by any source located for this page. The underlying Mongo plotting package was written by Dr. John L. Tonry

Paradigm Imperative command-language scripting. Commands are terse verbs with positional arguments, executed line by line by an interactive plotting program; the extension adds variables, brace-delimited expression substitution, counted loops and conditionals on top of that command stream
Typing Untyped in the shell-language sense. Values are text substituted into a command line; numeric expressions are evaluated inside braces. No declarations, and no type system is documented anywhere in the public record
First Appeared Mid-1990s, most likely between 1994 and 1996, based on the only datable artifact: hackMongo appears in the original 99 Bottles of Beer collection begun on a humour mailing list in early 1994 and expanded past 99 languages during December 1995. Language catalogues commonly give 2010, a date this page found no support for and believes to be an artifact of later re-cataloguing. Treat every date here as approximate
Latest Version None published. No hackMongo release, version number, repository or distribution has ever been located. The parent Mongo package was distributed by Tonry as mongo2k, whose most recent listed release is version 1.0.9, a tarball dated 12 June 2001

hackMongo is a mid-1990s extension of Mongo, the interactive astronomical plotting program written in FORTRAN-77 by Dr. John L. Tonry. It survives as exactly one program, thirty-odd lines long, contributed to a joke website by an astronomer at the University of Chicago. There is no compiler, no manual, no repository and no release. What it does have is an unusually clear story attached to it, and one very instructive piece of misinformation.

First, the Name

Almost every modern catalogue that lists hackMongo files it under Database. That classification is wrong, and it is wrong for a reason worth understanding.

The Mongo in hackMongo is not MongoDB. MongoDB was first released in 2009, roughly a quarter of a century after Tonry’s Mongo, and the two share nothing but four syllables. Mongo the plotting package predates Mongo the database by some twenty-five years and belongs to an entirely different world: FORTRAN, VAX/VMS, Berkeley UNIX, PostScript hardcopy and the preparation of figures for astronomy journals.

The misfiling is a small case study in how automated language catalogues degrade. A name is matched against a better-known name, a category is inferred, a date is attached from whenever the entry entered the current database rather than from when the language existed, and the resulting row is then copied into a dozen derived lists where it looks exactly as authoritative as a hand-verified one. The Database category, the Scripting paradigm and the 2010 date that travel with hackMongo are all products of that process. Of the three, only “scripting” is defensible.

The Parent: Mongo

To understand hackMongo you have to understand what it was hacking.

Mongo was written by John Tonry in the 1980s - Tonry reportedly took his PhD at Harvard around 1980 and held postdoctoral appointments before a long career at the University of Hawaii’s Institute for Astronomy. Its user guide describes it in the flat, unglamorous terms of its era: a program designed to produce high quality graphics output with a minimum of effort, written in FORTRAN-77 with minor extensions, runnable on VAX computers under VAX/VMS and on Berkeley UNIX systems.

Structurally, Mongo is a set of graphics subroutines plus an interactive driver that calls them. The user guide lists three modes of use, of which the most common is the interactive one: you type a command, optionally followed by arguments, and Mongo performs the corresponding graphics operation. The same subroutines can also be linked into a FORTRAN program, so an analysis code can produce its own plots directly.

That design produces a very particular kind of language. The “syntax” is a verb and some positional arguments, one per line - erase, relocate 0.1 0.5, putlabel 6 some text, expand 1.5, hardcopy. It is closer to a plotter’s instruction stream than to a programming language, and that is exactly what it was for.

Mongo mattered less for its own adoption than for what grew out of it. Robert Lupton and Patricia Monger reimplemented it from scratch with considerable additions; the result is universally called SuperMongo and officially distributed as SM, and it is not compatible with the original. SM became a fixture of astronomical data analysis and is the reason the Mongo name is still recognised in the field. The Starlink project produced its own Mongo-influenced package, PONGO, on top of the PGPLOT library. Tonry continued his own line separately, releasing later versions as mongo2k; his November 1998 download page is candid about the state of the project, admitting he had never worked up the enthusiasm to update the manual. The most recent release listed there is version 1.0.9, in a tarball stamped 12 June 2001.

A note on platforms. The only platform claims made on this page are the ones the primary sources make themselves: the user guide’s statement that Mongo runs on VAX/VMS and Berkeley UNIX, and Tonry’s own statement that mongo2k compiles and runs cleanly on Suns running SunOS and Solaris and works with at least one variant of Linux on a PC using g77. Nothing is documented about what hackMongo ran on, beyond the reasonable inference that it ran wherever its author’s department ran Mongo.

The Only Surviving Program

Here is the complete public corpus of hackMongo, exactly as preserved in the mirrored 99 Bottles of Beer list:

! Does the beer song... sends output to a postscript file
! Geza Gyuk - [email protected]

printer 1
erase

data beer.dat
setv rounds c1(1)                       ! get number of rounds
                                        ! from first line, first
setv container bottles                  ! column of file beer.dat
expand {5/rounds}
loop i {rounds} 2 -1
   relocate 0.1 {i*5/(5*rounds)}
   putlabel 6 {i} bottles of beer on the wall,
   relocate 0.1 {(i*5-1)/(5*rounds)}
   putlabel 6 {i} bottles of beer,
   relocate 0.1 {(i*5-2)/(5*rounds)}
   putlabel 6 take one down and pass it around,
   if ({i}=2) setv container bottle
   relocate 0.1 {(i*5-3)/(5*rounds)}
   putlabel 6 {i-1} {container} of beer on the wall.
   relocate 0.1 {(i*5-4)/(5*rounds)}
   putlabel 6
endloop

relocate 0.1 {5/(5*rounds)}
putlabel 6 1 bottle of beer on the wall,
relocate 0.1 {4/(5*rounds)}
putlabel 6 1 bottle of beer,
relocate 0.1 {3/(5*rounds)}
putlabel 6 take it down and pass it around,
relocate 0.1 {2/(5*rounds)}
putlabel 6 no more bottles of beer on the wall.

hardcopy
end

The program does not print the song. It draws it. Every verse is a text label positioned at explicit page coordinates, and the finished plot is sent to a PostScript file. There is no text output stream in this language at all, because plotting programs do not have one; the only way to emit a character is to place it somewhere on a page.

Reading the Code

The commands divide cleanly into two groups, and that division is almost certainly where the “hack” in hackMongo lies.

The Mongo half

CommandRole
printer 1Selects an output device - here, PostScript hardcopy rather than a screen
eraseClears the plotting surface before drawing
data beer.datAttaches an external data file, the standard way Mongo ingests numbers
expandScales the character size
relocate x yMoves the current plotting position
putlabel n textWrites text at that position, with n selecting justification
hardcopyEmits the accumulated plot to the output device
endTerminates the session

Every one of these is recognisable as ordinary plotting-package vocabulary, and relocate, putlabel and expand are documented Mongo commands.

The hack half

setv rounds c1(1)
expand {5/rounds}
loop i {rounds} 2 -1
   if ({i}=2) setv container bottle
endloop

Four things here are not plotting at all:

  • setv binds a name to a value, and can pull that value out of the loaded dataset - c1(1) is column 1, row 1 of beer.dat. Note that container is bound to the bare word bottles, so the same mechanism holds strings and numbers indifferently.
  • {...} is expression substitution. Anything in braces is evaluated as arithmetic against the current variables and the result is pasted into the command line before the command runs. This is macro-expansion semantics, the same trick the Unix shell and TeX use, and it is why the language needs no type system: everything is text until something asks it to be a number.
  • loop i {rounds} 2 -1 / endloop is a counted loop with an explicit negative step, running the induction variable down from the value read out of the data file to 2.
  • if (...) is a single-line conditional, used here for the one job every 99 Bottles implementation must do: switching the plural.

Gyuk’s one-line description - that hackMongo is an extension of the Mongo plotting package - does not say which commands are the extension. But the shape of the split is hard to misread. The graphics verbs are stock; the control flow is not. hackMongo is what you get when someone bolts a programming language onto a plotting program. No source located for this page states that outright, so treat it as a strong inference rather than a documented fact.

The one genuinely clever line

expand {5/rounds}

Each verse occupies five label rows, and every vertical coordinate in the program is computed as a fraction of 5*rounds. The whole song is therefore laid out in normalised page space, and the type size is scaled by the same factor. Change the number in beer.dat from 99 to 12 and the program produces a twelve-verse poster in larger type, correctly spaced, with no other edit.

That is a real piece of engineering judgement in a joke program, and it is characteristic of the domain. An astronomer preparing a figure has a fixed page and a variable amount of data, and learns early to express everything as a fraction of the plot rather than in absolute units.

Dating the Language

The metadata attached to hackMongo in most catalogues gives 2010; this page gives the mid-1990s, and the reasoning is worth showing.

The evidence is the collection the program lives in. The surviving mirror carries its maintainer’s own account: the list began on a humour mailing list in early 1994, started with about twenty languages, and blew past ninety-nine during the December 1995 holidays on its way to the 227 entries preserved in the mirror. hackMongo is in that mirror, taken from the original ionet.net site before it disappeared. The contact address in the source, [email protected], is consistent with the same window: Geza Gyuk was, according to the address itself, at the University of Chicago in the mid-1990s, and reportedly moved to the Adler Planetarium around 2000, where he is subsequently listed as director of astronomy.

So the program is mid-1990s with reasonable confidence, and the dialect it was written in must predate the program. The commonly quoted 2010 corresponds to nothing in that history. It is far more likely to record when the entry was ingested into the modern 99-bottles-of-beer.net catalogue, where hackMongo carries language number 299, and from which the current generation of language lists were scraped.

The precise year remains unknown, and this page does not pretend otherwise. 1995 is a midpoint of a bracketed range, not a discovered fact.

Design Philosophy, Such As It Is

hackMongo was not designed. That is the honest summary, and it is also the interesting part.

Nobody sat down to create a language. Someone with a plotting package, a real job to do, and a repetitive figure to produce added variables and a loop so they would not have to type the same command four hundred times. The extension solves the problem of the person who wrote it and stops there - which is why it has no manual, no version number, no name beyond a self-deprecating one, and no distribution.

This is the single most common way programming languages actually come into existence, and it is almost entirely invisible in language histories, which naturally favour the designed ones. Every long-lived scientific tool accretes a layer like this. A configuration format grows conditionals. A macro facility grows recursion. A plotting command stream grows a for loop. Each step is locally reasonable and none of them is a language design decision, and yet a language is what you end up with.

The name says the author knew exactly what he had. Not Mongo++, not MongoScript. hackMongo.

Current Relevance

There is none, in any practical sense, and that should be stated plainly rather than dressed up.

hackMongo has no implementation in circulation, no documentation, no users and no successor. Its parent Mongo has been effectively superseded for decades - by SM, which absorbed the community, and more broadly by PGPLOT, IDL, and now overwhelmingly by Python with Matplotlib and Astropy. The Lowell Observatory copy of the MONGO User’s Guide and Tonry’s own mongo2k download page have both gone offline. The 99 Bottles list that carries the sole hackMongo program has itself died once already and survives through mirrors.

What remains is a fragment: thirty-odd lines of a language that never had a manual, kept alive because its author had a sense of humour and a website was collecting the results.

Why It Matters

Three things, none of which is about hackMongo’s merits as a language.

It documents a real category. The private extension to a scientific tool is a huge and almost wholly unrecorded population of languages. hackMongo is a rare specimen with a legible fossil, and it shows the characteristic pattern with unusual clarity: domain vocabulary inherited wholesale, control flow bolted on, no types, no documentation, no distribution.

It is a caution about catalogue metadata. Almost everything a modern language list will tell you about hackMongo is wrong. It is not a database language. It is not from 2010. The one field that survives scrutiny is “scripting”, and even that is a coarse fit for a plotter command stream. When a language’s entire public footprint is a single joke program, everything downstream of that program is inference - and inference made by software, at scale, without a human ever reading the code.

It preserves something about how astronomers computed. The program is a small window onto a working environment: data in a text file with numbered columns, coordinates normalised to the page, output going to PostScript for a journal, a FORTRAN-77 program driving it all, and a physicist writing loops in a plotting package because that was the tool already on the machine. That world is gone. This is one of the few pieces of it anyone bothered to keep.

Timeline

1980s
Dr. John L. Tonry writes Mongo, an interactive astronomical graphics program, in FORTRAN-77 with minor extensions. Its documentation describes it as running on VAX computers under VAX/VMS and on Berkeley UNIX, and as usable in three modes, the most common being an interactive one in which the user types a command verb followed by arguments. Mongo also ships as a library of FORTRAN subroutines that can be called from a user program
1980s
Robert Lupton and Patricia Monger reimplement Mongo from scratch with additional features. The result is universally known as SuperMongo and officially shipped as SM; it is not compatible with the original Mongo, and it goes on to become far more widely used in astronomy than its ancestor. The Starlink project later, in the 1990s, separately produces PONGO, a Mongo-inspired front end built on the PGPLOT library
1994
In early 1994 someone posts the full lyrics of 99 Bottles of Beer to a humour mailing list; the objection that it could be done in six lines of BASIC starts the collection that becomes the 99 Bottles of Beer language list, originally hosted by Tim Robbins at ionet.net. This is the collection that will eventually carry the only known hackMongo program
1995
The 99 Bottles collection passes 99 languages during the December holiday season, far sooner than its maintainer expected, and continues growing toward the 227 entries preserved in surviving mirrors. hackMongo is one of them, contributed with the note that it "is an extension of the Mongo plotting package" and credited in a source comment to Geza Gyuk at [email protected]. The exact submission date is not recorded in the mirrored list, but the list itself brackets it to roughly 1994-1996
1998
In November, Tonry publishes a download page for the latest Mongo, released as mongo2k or m2k, under a 1998 copyright. He states plainly that he has not been able to work up the enthusiasm to update the Mongo manual and has not ported it widely, and that it seems to compile and run cleanly on Suns running SunOS and Solaris and works with at least one variant of Linux on a PC using the g77 compiler. The distribution is free to use but explicitly not public domain
2000
Geza Gyuk reportedly joins the Adler Planetarium around this time, where he is subsequently listed as its director of astronomy; his University of Chicago oddjob address, the only contact information ever attached to hackMongo, ceases to be current. The exact year of the move is not confirmed by any source located for this page
2001
The last dated Mongo artifacts appear: the mongo2k 1.0.9 tarball is stamped 12 June 2001, and Bruce W. Koehn revises the MONGO User's Guide hosted at Lowell Observatory on 19 March 2001. Both the guide and the download page have since gone offline
2000s
The original ionet.net list disappears. A copy taken from a German mirror is preserved at westnet.com, and the actively maintained successor site 99-bottles-of-beer.net re-catalogues the entries, assigning hackMongo language number 299. It is this re-cataloguing, rather than any event in the language's own history, that appears to be the source of the 2010 date attached to hackMongo in derived language lists

Notable Uses & Legacy

99 Bottles of Beer (the only known hackMongo program)

A complete hackMongo program by Geza Gyuk that renders all one hundred verses of the song as typeset labels on a plot and writes the result to a PostScript file. It reads the verse count from a data file rather than hard-coding it, scales the type size to fit the page, and switches from "bottles" to "bottle" at the right verse. So far as this page could determine, it is the entire public corpus of the language

Figure preparation for astronomical publication (parent package)

Mongo, the package hackMongo extends, was written to produce publication-quality plots for astronomy with minimum effort, and could be driven interactively or called as a FORTRAN subroutine library from analysis code. This was the working context in which a hacked local dialect would have been used. Note the scope of this claim: it describes documented use of Mongo, not verified use of hackMongo, for which no institutional deployment record exists

The SuperMongo lineage

The clearest measure of Mongo influence is not hackMongo but SM, the Lupton and Monger reimplementation, which became a staple of astronomical data analysis and remains the reason most astronomers recognise the name at all. hackMongo is a sibling branch of that same family tree - a private extension where SM was a public rewrite

Language Influence

Influenced By

Mongo

Running Today

Run examples using the official Docker image:

docker pull
Last updated: