Fudgit
FUDGIT, Martin-D. Lacasse's double-precision fitting program from McGill University: a csh-like command shell and a HOC-derived C-style vector language for reading, transforming, fitting and plotting columns of data.
Created by Martin-D. Lacasse (Department of Physics, McGill University)
FUDGIT is a double-precision data-processing and curve-fitting program for Unix, written by Martin-Daniel Lacasse in the Department of Physics at McGill University in MontrĂ©al in the early 1990s. It belongs in a languages encyclopedia because it is a small programming environment and not just a fitting utility. It has two languages: a C-shell-like command language with macros, aliases and foreach loops, and a C-like interpreter derived from Kernighan and Pike’s HOC calculator, in which whole columns of numbers are vectors you can do arithmetic on. Plotting is handed off to gnuplot or any other plotter that reads commands on standard input. The manual’s introduction opens with the joke behind the name: “No more fudging!”
History & Origins
Lacasse wrote FUDGIT while working at McGill’s Center for the Physics of Materials. The program came out of the everyday problem of an experimental or computational physicist: reading columns of numbers from files, transforming them, fitting a model, and plotting the result, many times over.
The program’s change log starts at version 1.42 and says only that earlier changes were “various, including global grammar changes”, so the 1.x releases are undated. The earliest dated record of FUDGIT is the FOLDOC dictionary entry dated 22 March 1993, which already describes version 2.27 running on AIX, HP-UX, Linux, IRIX, NeXT, SunOS and Ultrix and points to the tsx-11.mit.edu Linux archive. The encyclopedia master list gives 1980 for the language. No source found for this page supports that date: the code is copyright 1993, it credits a 1986 C translation of its FFT routine, and its fitting code comes from the 1988 Numerical Recipes in C. This page therefore uses 1993, the earliest dated evidence, and notes that the 1.x versions were probably earlier.
The program was assembled from several existing pieces, and its Credits file lists them:
| Component | Source |
|---|---|
| C-calculator mode | HOC, from Kernighan and Pike’s The Unix Programming Environment (1984), extended with vector algebra, memory management and extra operators |
| Fitting routines | Adapted from chapter 14 of Numerical Recipes in C (1988), reworked for error recovery and user-selectable functions |
| FFT | A 1986 C translation of a Dr. Dobb’s Pascal routine, rewritten; the shipped version is the Numerical Recipes one |
| Line editing | GNU Readline (Brian Fox) |
| Help system | Adapted from gnuplot’s help facility |
| Dynamic loading | Jack Jansen’s and Guido van Rossum’s dl packages from CWI, and Wilson Ho’s GNU-ld-based dld |
The change log credits no one else for the NeXT port (2.25) or the HP-UX 8.07 port (2.28), and for the latter Lacasse thanks Ian Graham for access to his HP account. Most of the other ports came from users, and the change log credits each one: Linux by Thomas Koenig (2.27), Data General by Matthias Stenzel (2.29), 386BSD by Michael Diehl (2.33), System V Release 4 by Glenn Geers (2.34), VMS by Klaus Reimann (2.35) and Solaris 2.3 by David Robinson (2.40).
Design Philosophy
FUDGIT splits its work across three modes that share one set of variables in memory:
- Fitting mode (
fmode) is the central mode and the only one that touches the disk. It parses a line into blank-separated words, like an interactivecsh. Every command can be abbreviated, and plurals are accepted “when it makes sense”. Reading and saving vectors, loading scripts, Fourier transforms and fits all happen here, along with macros, aliases and thewhile/foreach/if-else-endifflow control. - C-calculator mode (
cmode) is a full expression interpreter that understands “most of C grammar except pointers”. It has functions, procedures,autolocals, strings and the whole double-precision C math library.letis shorthand for running one line in this mode. - Plotting mode (
pmode) does no parsing at all. It passes each line straight to the plotting program, which is gnuplot by default.
The manual’s “Bugs” section says the program “has been written with robustness in mind and not optimization”. As an example, the manual notes that by default “all divisions [are] checked for a null quotient”. Lacasse’s own Bugs and TODO files are candid about the three-mode design: “The 3 modes are sometimes really nice. Some other time they really suck”, and the TODO list opens with “If only I knew what I now know before starting this project…”
Key Features
Vectors as columns
Data are read straight from columns of a text file into named vectors, with optional ranges, and then transformed as whole vectors:
| |
Fitting
You choose a model and a method, declare a parameter vector, and fit. This is the manual’s two-Gaussian Marquardt-Levenberg example (abridged):
| |
The example is printed as it appears in the manual, which reads the columns into T, E and ERROR but then fits X, Y and DY.
Built-in models include power series, sine and cosine series, Legendre polynomials, and series of Gaussians, exponentials and (from 2.40) Lorentzians. Methods include straight-line least squares and least absolute deviation, general linear least squares by QR decomposition or SVD, and nonlinear Marquardt-Levenberg. A user-defined model is written as a block of vector assignments, with the partial derivatives named by convention:
| |
The C-calculator language
cmode code looks like C without types or pointers. This is the shipped fac.ft example:
| |
A bare expression prints its value, as in HOC. Since version 2.00, functions and procedures take prototyped arguments, so they can accept vectors and strings as well as scalars. The built-in data variable holds the current vector length, which the shipped avg.ft example uses as a loop bound.
Other features
- Fourier transforms (
fft/invfft), cubic spline interpolation and smoothing - Shell history saved between sessions, with Readline editing including vi mode
- Dynamic loading of compiled C or FORTRAN objects as new functions or procedures, on IRIX, SunOS and ULTRIX only (the ULTRIX support was VAX-only and, according to the change log, untested); the
Bugsfile says to “treat as experimental” - Scripts, conventionally with the
.ftextension, run from the command line asfudgit script.ft
Evolution
| Version | Change (from the shipped change log) |
|---|---|
| 1.43 | Change log begins; version function added |
| 1.50 | Cubic spline interpolation |
| 2.00 | Prototyped arguments for cmode functions and procedures |
| 2.10 | smooth command |
| 2.13 | C-like if/while/for constructions in cmode |
| 2.20 | First dynamic loading (IRIX only) |
| 2.24 | Dynamic loading on SunOS and ULTRIX |
| 2.25 | “The first full ANSI version”; first NeXT port |
| 2.27 | Linux port (Thomas Koenig) |
| 2.35 | VMS port |
| 2.40 | Revised if grammar, Lorentzian fits, Solaris 2.3 port |
| 2.42 | save vector adds time, user and host comments; reverted to Readline 2.0 |
The change log ends with plans that were never released: per-vector lengths, matrix algebra, and merging fitting mode into C mode “moving towards a more consistent language”. The 2.33 README hoped FUDGIT could eventually load user-chosen routines from netlib, “(If I ever get time…)”.
Licensing
FUDGIT was free to use but not free software in the modern sense. The licence allows use and redistribution “for any peaceful purpose and without fee” but says “No part of this can be used for commercial purposes”, and the bundled Numerical Recipes routines carry their own copyright. In a Copyrights essay Lacasse proposed what he called “Progressive Copyrights”: the scientific community could use the code freely, while commercial developers would have to negotiate. These terms are why Debian shipped FUDGIT in its non-free section.
Current Relevance
FUDGIT is historical. Version 2.42 (1994) is the last known release, and the original distribution site, ftp.physics.mcgill.ca/pub/Fudgit/, is no longer reachable. FreeBSD removed its port in 2011 for exactly that reason. The source survives in the Debian archive (sources.debian.org, package fudgit 2.42-6), on the funet.fi mirror (2.33) and on Aminet. Most of its job is now done by gnuplot’s own fit command and by environments such as Python with NumPy and SciPy.
Why It Matters
- A small language built for one task. FUDGIT shows a common early-1990s pattern for scientific tools: a scripting language put together from available parts (HOC, Readline, gnuplot’s help system, Numerical Recipes) to automate the read-transform-fit-plot loop.
- Columns as first-class vectors. Applying
let Y = ln(Y)to a whole data column at once brought array-style working to people who would otherwise write throwaway C or FORTRAN. - A front end, not a monolith. Treating the plotter as a pipe to any program that reads standard input kept FUDGIT small and let it work alongside gnuplot.
- An early free-for-science licence. Its “Progressive Copyrights” essay is an early record of an academic author trying to keep research code open to scientists while keeping it out of commercial products.
Sources and Verification Notes
- Debian source package fudgit 2.42-6 (sources.debian.org, read directly):
INTRO,Credits,Copyrights,ChangeLog,Bugs,TODO,.date(19 Nov 1994),docs/fudgit.tex(title page: Version 2.42, August 1994, McGill),docs/fudgit.1,examples/*.ftanddebian/changelog(15 Jun 1999 to 3 Mar 2000). All code samples are quoted from the manual or the shipped examples. - FOLDOC “FUDGIT”, last updated 1993-03-22: version 2.27, its platform list, and tsx-11. FOLDOC names Thomas Koenig as the author; the program’s own files show he made the Linux port and Lacasse wrote the program.
- ftp.funet.fi
/pub/sci/math/numcomp-free-c/fudgit/: directory listing with 2.33 files dated 1993-06-11, and the README. - Aminet util/misc/Fudgit233: upload date 1993-12-18 and archive contents.
- FreeBSD ports cgit log for math/fudgit: added 1994-11-17, deprecated 2011-03-15 (“upstream disapear”), removed 2011-05-02.
- Debian archive (
archive.debian.org):fudgitis in the potato and woody non-free source indexes and absent from sarge. Thedebian/copyrightfile gives the upstream site asftp://ftp.physics.mcgill.ca/pub/Fudgit/; that hostname no longer resolves (NXDOMAIN, checked 2026-10-07). - UCLA AIX PDSLIB “Fudgit” package page (Wayback capture of 24 June 2003): an AIX 3.2 binary and source of version 2.41, last updated 19 December 1995. This is the only record found of a 2.41 version; the shipped change log goes from 2.40-1 to 2.42.
- Not verified: any release date before version 2.27, and so the true first year; the master list’s 1980; who made the Amiga port; whether the manual’s Ising-model example is from Lacasse’s published research; which FUDGIT version the November 1994 FreeBSD port first packaged. No peer-reviewed papers that cite FUDGIT were found, so no other research uses are claimed.
Timeline
Notable Uses & Legacy
Statistical-physics data analysis at McGill
The user's manual's extended worked example appears to be drawn from Lacasse's own research: a foreach macro that walks one directory per temperature, computes the Onsager surface tension of the 2-D Ising model, makes a Marquardt-Levenberg fit with a user-defined function and analytic derivatives, and sends each result to gnuplot
Early Linux distribution
FUDGIT was among the scientific tools offered from the tsx-11.mit.edu Linux archive by March 1993, using Thomas Koenig's port
Unix and BSD package collections
It was packaged for FreeBSD ports (1994-2011), Debian non-free (1999, potato and woody) and the UCLA AIX Public Domain Software Library (an AIX 3.2 build of version 2.41), so a user could install it as a precompiled package on those systems
Amiga port
The Aminet upload of 2.33 (porter not identified) shipped Amiga binaries, including one (`Fudgit_20_881`) apparently built for 68020/68881 machines, together with the help file and the DVI manual