Est. 1987 Intermediate

KUIP

CERN's Kit for a User Interface Package - the command processor and KUMAC macro language behind PAW, GEANT 3 and dozens of other high-energy physics programs, first released by René Brun and Pietro Zanarini in 1987

Created by René Brun and Pietro Zanarini (CERN)

Paradigm Procedural, Command language / macro scripting
Typing Untyped (macro variables are stored as strings)
First Appeared 1987
Latest Version KUIP 2.07 (last logged version, January 1996); still shipped in community CERNLIB 2026.06

KUIP (Kit for a User Interface Package) is the command-line system that a generation of particle physicists typed into every day. CERN developed it in the late 1980s as the user interface of PAW, the Physics Analysis Workstation. It parsed and checked commands, organised them into a menu tree, supplied online help, and ran a macro language. Macro files carried the .kumac extension, and users called them KUMACs. Through PAW, the GEANT 3 detector simulation program and other programs in the CERN Program Library, KUIP became the scripting layer for analysis and simulation work at laboratories around the world. Its macro language is a small procedural language, with variables, expressions, loops, conditionals, recursion and error handling. Its other half is a declarative format, the Command Definition File, for describing an application’s commands.

History & Origins

From ZCEDEX to KUIP

KUIP had a predecessor. CERN’s KUIP manual says many of its basic features “stem from the package ZCEDEX, implemented at CERN in 1982 by R. Brun, C. Kersters, D. Moffat and A. Petrilli, which offered already command parsing, macros, vectors, and functions.” ZCEDEX was the command processor of the early interactive GEANT 3. The GEANT 3.21 manual records that GEANT’s interactive package was “initially based on ZCEDEX, then upgraded to KUIP.”

At the beginning of 1986 CERN launched the PAW project to give physicists one interactive tool for histogramming, fitting and plotting. In the KUIP manual’s words, KUIP was “developed at CERN in the context of PAW”. The manual’s acknowledgments say: “The first version of KUIP released in 1987 was designed and implemented by René Brun and Pietro Zanarini.” The KUIP Users Guide Version 1.0 by Brun and Zanarini is dated February 1988. The CERN Program Library short write-up for entry I202 records the package as submitted on 10 February 1988. PAW had its first public release at the beginning of 1988. Catalogues that give 1988 as KUIP’s year are therefore dating its documented library release and arrival with PAW. CERN’s own manual puts the first version a year earlier.

The original KUIP was written entirely in Fortran 77. The manual explains that “at that time (1987) the Fortran compiler was the only one commonly available on all initial target platforms (VM/CMS, VAX/VMS, and Apollo)”. In 1990 Zanarini described the system in Computer Physics Communications (“KUIP: The User interface of PAW”, vol. 61, pp. 103-114). He emphasised the Command Definition File, the KUIP Compiler, the switchable dialogue modes and portability as KUIP’s “most valuable features”.

The C rewrite and KUIP/Motif

Fortran had no recursion, no function pointers and no exception recovery, and its fixed-length character variables made dynamic strings awkward. All of these are things a command interpreter needs. Alfred Nathaniel took over maintenance of the basic package, and a large part of KUIP was rewritten in C. The version log for KUIP 2.00, dated 4 December 1992, opens with “A large fraction of KUIP has been rewritten in C” and asks users to test their KUMAC files before the new version went into production. (The manual places this rewrite at the beginning of 1992, so the exact timing is uncertain by several months.) The same release announced “a completely new Motif interface with a browser for application specific object types”. This was KUIP/Motif, which generalised the windowed interface first built for PAW++ so that any existing KUIP application could get a Motif front end by changing a few initialisation calls. Nicole Cremel was responsible for the Motif interface, with major earlier contributions from Fons Rademakers.

KUIP spread to many platforms through the 1990s. The October 1994 manual (Version 2.05) lists ports to Convex, Cray Unicos, DEC VMS/Ultrix/OSF and Alpha Windows NT, HP Apollo and HP-UX, IBM VM/CMS, MVS/TSO and AIX, SGI Irix, SunOS and Solaris, MS-DOS, NeXT and Linux. The version log dates the first Linux version to KUIP 2.02/07 in May 1993 and the first Windows NT port, by Valeri Fine of Dubna, to the 2.03 series later that year. Version 2.06 (October 1994) added global variables, variable indirection and arrays of macro variables. According to the PAW guide, users received global variables with CERNLIB’s “95a” release. The version log ends with KUIP 2.07/08 in January 1996.

Long afterlife

By the mid-1990s CERN’s data-analysis effort was moving to ROOT, the C++ framework that succeeded PAW, and KUIP development tailed off. KUIP was not withdrawn, though. It remained part of PACKLIB in every CERN Program Library release up to the final official CERNLIB 2006. Linux distributions packaged it with the rest of CERNLIB for years. The Debian package description for the kuipc compiler says it “is no longer actively developed, so aside from its use in the build process of CERNLIB, it is of mainly historical interest.” Debian removed the cernlib package from unstable in October 2023.

The source code survives in a community-maintained CERNLIB hosted by CERN. It is “based on the last official release CERNLIB 2006a, with additional patches to support 64bit, mainly developed by Debian”. CERN’s site makes clear that CERNLIB “is no longer supported by CERN” and that the community version is maintained on a best-effort basis. That repository published source releases from 2022 through 2026, the latest dated 24 June 2026. They still contain the full packlib/kuip tree, its version logs and a Vim syntax file for CDF files.

Design Philosophy

KUIP was designed as a User Interface Management System, a toolkit that gives many different applications the same way of talking to their users. Its manual sets out the goals:

  • One interface for many programs. A physicist who learned PAW’s command syntax could use GEANT, CMZ or any other KUIP application without relearning the basics. KUIP/Motif extended this to the windowed interface, so that all applications would have the same look and feel.
  • Different users, different dialogue styles. Beginners could walk the command tree through alphanumeric or graphical menus. Experienced users typed abbreviated command lines. Users could switch between styles at any moment in a session.
  • Describe the interface, don’t code it. Application writers did not call KUIP’s registration routines by hand. They wrote a text file, the Command Definition File (CDF), that described commands, parameters, defaults, help text and menus. The KUIP Compiler (KUIPC) turned this file into C or Fortran code. The CDF also held all the online help, so the help stayed in step with the program, and KUIP could export it as LaTeX for printed manuals.
  • Mixed control. KUIP normally prompted the user and passed commands to the application. The application could also hand command sequences back to KUIP to execute.

Key Features

Command trees and abbreviation

Commands live in a hierarchy of menus, laid out like a Unix file system, for example /KUIP/SET_SHOW/PROMPT or HISTOGRAM/OPERATIONS. Users can shorten any part of a command path as long as the result is unambiguous. If an abbreviation is ambiguous, KUIP lists the possible matches. Missing mandatory arguments are prompted for. Arguments of the wrong type or out of range are rejected before the application’s action routine is called. KUIP also has aliases, command-line recall and editing, a csh-like history mechanism, and a session log written as a runnable macro (last.kumac in PAW).

The Command Definition File

The KUIP manual’s own example application is a Reverse Polish Notation calculator. Its CDF begins like this:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
>Name RPNDEF
>Menu RPN
>Guidance
Reverse Polish Notation sub-pocket calculator
using KUIP for the user interface.
>Command ENTER
>Parameters
+
NUM 'Enter a number' R D=0.
>Guidance
Push the number(s) given as parameter(s) into the stack.
If none push a zero.
>Action RPENT

>Name names the generated definition routine. >Menu and >Command build the tree. Each parameter line gives a name, a prompt, a type (R for real) and a default. >Action names the Fortran or C routine KUIP calls. In the action routine, the program reads its arguments with calls such as KUGETR. The main program only had to call KUINIT, the generated RPNDEF, and finally KUWHAT, which hands control to KUIP’s input loop.

The KUMAC macro language

A .kumac file can hold several macros, each bracketed by MACRO name [parameters] and RETURN. The EXEC command runs them: EXEC file runs the first macro in file.kumac, and EXEC file#name runs a named one. A file containing nothing but commands is already a valid macro. The language includes:

  • String-valued variables. Variables are created by assignment. The result is “stored as a string (even for arithmetic expressions)”. A variable is substituted by putting its name in square brackets. The // operator concatenates strings:

    1
    2
    3
    
    greet = Hello
    msg = [greet]//' World'
    MESS [msg]
    
  • Arguments and special variables. Arguments arrive as [1], [2] and so on, or as named parameters with defaults (MACRO m arg1=abc arg2=def). [#] is the argument count, [*] all the arguments, [0] the macro’s full name, and [@] the return value of the last EXEC. Macros may call themselves recursively.

  • Structured flow control. IF ... THEN / ELSEIF / ELSE / ENDIF, DO and FOR loops, WHILE ... DO / ENDWHILE, REPEAT ... UNTIL, BREAKL and NEXTL (with a nesting-level count), plus the older GOTO label and IF expr GOTO label.

  • Wildcard CASE. Labels can match glob patterns, as in this example from the PAW manual:

     1
     2
     3
     4
     5
     6
     7
     8
     9
    10
    
    MACRO CASE
    READ FILENAME
    CASE [FILENAME] IN
    (*.ftn, *.for) TYPE = FORTRAN
    (*.c) TYPE = C
    (*.p) TYPE = PASCAL
    (*) TYPE = UNKNOWN
    ENDCASE
    MESSAGE [FILENAME] is a [TYPE] file.
    RETURN
    
  • Error handling. Every command sets a status code, readable through the system function $IQUEST(1). Handlers are set with ON ERROR GOTO label, ON ERROR EXITM, ON ERROR STOPM and ON ERROR CONTINUE, and OFF ERROR / ON ERROR suspend and restore them.

  • System functions. Built-in $-functions inspect the environment, manipulate strings ($WORDS, $WORD), evaluate expressions ($INLINE) and list variables by wildcard ($DEFINED). Since version 2.06, they can be combined with indirection ([%name], [a_[i]]) to build arrays, including associative ones.

  • Vectors. KUIP manages named numeric vectors that applications such as PAW share with their histogramming and fitting code. Through PAW, vector arithmetic was also available via the integrated SIGMA array language.

A minimal macro

1
2
3
MACRO hello
MESSAGE 'Hello, World!'
RETURN

Saved as hello.kumac, this runs from any KUIP application prompt with EXEC hello. A KUIP application can also run a macro in batch mode with no user interaction, which is how many PAW analysis jobs ran.

Evolution

PeriodDevelopment
1982ZCEDEX, KUIP’s predecessor, written at CERN
1987First KUIP version (Brun, Zanarini), Fortran 77
1988Users Guide Version 1.0; CERN Program Library entry I202; ships with the first public PAW release
1992Version 2.00: large-scale rewrite in C, new KUIP/Motif interface
1993Linux version (2.02/07); first Windows NT port work (2.03)
1994Version 2.05 manual; 2.06 adds global variables and variable arrays
19962.07/08, last version-log entry
2006Final official CERNLIB release containing KUIP
2022-2026Community CERNLIB source releases still include KUIP

Many people contributed to KUIP besides its original authors. The manual credits Olivier Couet (graphics menus and the HIGZ interface), Carlo Vandoni (SIGMA integration), Colin Caughie of Edinburgh (macro flow control), Ilias Goulas of Turin (KUIB, an interface builder offered as a replacement for KUIPC), and porters at Strasbourg, DESY, Dubna and DEC.

Current Relevance

KUIP is a historical language, but it is not quite extinct. The community CERNLIB lives in a CERN GitLab group named for DPHEP (Data Preservation in High Energy Physics), and anyone who rebuilds PAW or GEANT 3 from it to rerun old software also gets KUIP, so old KUMAC macros can still be run. The community CERNLIB README lists tested builds on recent Red Hat-compatible and Ubuntu Linux releases, with limited support for macOS, Solaris and others. No official container image exists. New work in high-energy physics is done in ROOT and Python, not KUMAC.

Why It Matters

KUIP shows how a physics laboratory solved, in the late 1980s, a problem that general software engineering was also working on: giving a family of large interactive programs one consistent, scriptable interface. Its central idea was to declare commands, parameters and help text in one file and generate the interface code from it. That made the online help and the program impossible to drift apart, and it let menus, command lines and later Motif panels all come from the same description. In the PAW era, KUMAC files were the standard way to record and automate the plots and fits of an analysis.

Timeline

1982
René Brun, C. Kersters, D. Moffat and A. Petrilli build ZCEDEX at CERN, offering the command parsing, macros, vectors and functions that KUIP later inherited
1986
CERN launches the Physics Analysis Workstation (PAW) project at the beginning of the year; KUIP is developed as its user interface
1987
First version of KUIP, designed and implemented by René Brun and Pietro Zanarini in Fortran 77 for VM/CMS, VAX/VMS and Apollo
1988
KUIP Users Guide Version 1.0 published (February) and KUIP entered in the CERN Program Library as I202; PAW, its first big client, has its first public release early in the year
1990
Zanarini's paper "KUIP: The User interface of PAW" appears in Computer Physics Communications vol. 61
1992
Version 2.00 (log dated 4 December) rewrites a large part of KUIP in C and adds a new OSF/Motif interface with an object browser
1993
Version 2.02 introduces a Linux version (May); work on a Windows NT port by Valeri Fine begins in the 2.03 series
1994
Version 2.06 adds global variables, variable indirection and arrays of macro variables; the Version 2.05 manual is published in October
1996
Version 2.07/08 (January) is the last entry in KUIP's version log
2022
A community-maintained CERNLIB, based on the last official CERNLIB 2006a release plus Debian's 64-bit patches, resumes source releases that still include KUIP
2023
Debian removes the cernlib source package, including the kuipc compiler, from unstable (October)

Notable Uses & Legacy

PAW (Physics Analysis Workstation)

KUIP was built for PAW and provided its whole command line, menus, online help and KUMAC macro language; PAW users wrote their analysis and plotting procedures as .kumac files

GEANT 3

The interactive version of CERN's GEANT 3 detector simulation program (GXINT) moved its command interface from ZCEDEX to KUIP, and KUIP/Motif's browser could show GEANT volumes and particle tracks

CMZ

The CERN code management system CMZ is listed in the KUIP manual among the large CERN application programs built on KUIP

STAR experiment GSTAR

Brookhaven's STAR simulation framework GSTAR, built on GEANT 3.21 and PAW, used a KUIP-based interface supporting both interactive work and KUMAC scripting

OBELIX event display

An event display for the OBELIX experiment (CERN PS201), presented at the 1990 Computing in High Energy Physics conference, used KUIP for its user interface together with HIGZ and ZEBRA

FATMEN

The CERNLIB file and tape management package FATMEN has a KUIP-based command-line program, defined in its own Command Definition File

Language Influence

Influenced By

ZCEDEX

Running Today

Run examples using the official Docker image:

docker pull
Last updated: