Est. 1993 Intermediate

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)

Paradigm Procedural: interactive command shell plus a C-like vector expression language
Typing Dynamic (double-precision scalars and vectors, strings, fit parameters)
First Appeared 1993 (earliest dated record; version 2.27 was already circulating by March 1993, and earlier 1.x versions are undated)
Latest Version Version 2.42 (late 1994)

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:

ComponentSource
C-calculator modeHOC, from Kernighan and Pike’s The Unix Programming Environment (1984), extended with vector algebra, memory management and extra operators
Fitting routinesAdapted from chapter 14 of Numerical Recipes in C (1988), reworked for error recovery and user-selectable functions
FFTA 1986 C translation of a Dr. Dobb’s Pascal routine, rewritten; the shipped version is the Numerical Recipes one
Line editingGNU Readline (Brian Fox)
Help systemAdapted from gnuplot’s help facility
Dynamic loadingJack 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 interactive csh. 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 the while/foreach/if-else-endif flow control.
  • C-calculator mode (cmode) is a full expression interpreter that understands “most of C grammar except pointers”. It has functions, procedures, auto locals, strings and the whole double-precision C math library. let is 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:

1
2
3
4
5
# Read columns 1 and 2 of fort.32 (positive values only) and column 4
read fort.32 X:1[0.00001:*] Y:2[0.00001:*] DY:4
let DY /= Y
let Y = ln(Y)
let X = ln(X)

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):

1
2
3
4
5
6
7
8
set function gauss          # We fit two Gaussians
set method ml_fit           # using Marquardt-Levenberg
set parameters VAL 6        # We need 6 parameters called, say, VAL
read out2 T:1 E:2 ERROR:3   # Read elements from file out2
adjust 1 2 3 4 5 6          # Adjust all 6 parameters
let VAL[1] = 1
let VAL[2] = -10
fit X Y DY                  # do the fit

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:

1
2
3
4
5
6
7
set function user
    UFIT = A[1] + s* (A[2]^2 + A[3]^2* T)^(-0.5)
    DUFITD1 = 1                        # derivative wrt A[1]
    TMP = s*(A[2]^2 + A[3]^2*T)^(-1.5)
    DUFITD2 = -A[2]*TMP                # derivative wrt A[2]
    DUFITD3 = -A[3]* T * TMP           # derivative wrt A[3]
stop

The C-calculator language

cmode code looks like C without types or pointers. This is the shipped fac.ft example:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
cmode
	func fac(x) {  # This `x' is a prototype: it does not exist.
		if (x <= 0)  {
		   return(1)
		} else {
		   return(x * fac(--x))
		}
	}
    {
   		auto x=1  # This `x' is a local scalar variable
   		while (x<=120) {
	   		x, " : ", fac(x++)
		}
   }
fmode

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 Bugs file says to “treat as experimental”
  • Scripts, conventionally with the .ft extension, run from the command line as fudgit script.ft

Evolution

VersionChange (from the shipped change log)
1.43Change log begins; version function added
1.50Cubic spline interpolation
2.00Prototyped arguments for cmode functions and procedures
2.10smooth command
2.13C-like if/while/for constructions in cmode
2.20First dynamic loading (IRIX only)
2.24Dynamic loading on SunOS and ULTRIX
2.25“The first full ANSI version”; first NeXT port
2.27Linux port (Thomas Koenig)
2.35VMS port
2.40Revised if grammar, Lorentzian fits, Solaris 2.3 port
2.42save 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/*.ft and debian/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): fudgit is in the potato and woody non-free source indexes and absent from sarge. The debian/copyright file gives the upstream site as ftp://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

1993
FOLDOC records FUDGIT version 2.27 on 22 March 1993, available from the tsx-11.mit.edu Linux archive. The Linux port was made by Thomas Koenig
1993
Version 2.33 is placed on the funet.fi numerical-software mirror (files dated 11 June 1993). Its README calls it full ANSI C and lists dynamic loading of C and FORTRAN objects on IRIX, SunOS and ULTRIX
1993
An AmigaOS (m68k) port of version 2.33 is uploaded to Aminet as util/misc/Fudgit233 (18 December 1993)
1994
Version 2.42 is released. The user's manual title page reads "Version 2.42, August 1994" and the source tree is stamped 19 November 1994. No later version is known
1994
Jean-Marc Zucconi adds math/fudgit to the FreeBSD ports collection on 17 November 1994
1999
Gopal Narayanan packages FUDGIT 2.42 for Debian's non-free section (initial upload 15 June 1999). It ships in the potato and woody releases
2011
FreeBSD removes math/fudgit from its ports tree on 2 May 2011 because the upstream site and the distribution file had disappeared

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

Language Influence

Influenced By

Running Today

Run examples using the official Docker image:

docker pull
Last updated: