Cupid

Inside Cupid

History

Where Hugs came from, what happened to it, and what this tree is.

Gofer and Hugs

In August 1991 (the 1994 report below says September) Mark Jones, then a D.Phil. student at Oxford, released Gofer, a compact and portable implementation of a Haskell-like language that also served as a test bed for type-system ideas, among them constructor classes, which later entered Haskell, and the treatment of type classes that led to multi-parameter classes and functional dependencies, which entered its implementations. Gofer was small enough to run on the machines of the day and was widely used for teaching. Jones went on developing it at Yale, as a postdoctoral researcher from 1992.

Jones described its implementation in a 1994 research report, The implementation of the Gofer functional programming system (Yale University, YALEU/DCS/RR-1030, May 1994). It covers Gofer 2.30, before the module system, but the architecture it sets out is the one this tree still has. The chapters on storage, the front end, type inference and the compiler and machine draw on it and say where Hugs and Cupid moved on. The report closes with the hope that "someone, perhaps even me, has the opportunity to develop a new, cleaner version of the system, building on this experience" (p. 50); Cupid's aim of an implementation one person can read is in that spirit, if thirty years late.

After leaving Yale in the summer of 1994, Jones rewrote Gofer to follow the Haskell standard more closely, and on 14 February 1995, by then at the University of Nottingham, released the result as Hugs, the Haskell User's Gofer System. Once Hugs was available, Yale hired Alastair Reid to work on it. Reid added the Haskell module system, which first appeared in Yale's Hugs0 release in June 1996, while Jones released Hugs 1.3 from Nottingham in August 1996. The two lines came together in Hugs 1.4, in January 1998, and in Hugs 98 the next year, the first Hugs to support the Haskell 98 standard; the versions were named after the version of Haskell they implemented. Like Gofer before it, every release of Hugs came with its full source code and a liberal licence, as was common for academic software.

After Hugs 98, Jones moved to OGI and Reid to the University of Utah. Both went on contributing, at a reduced level, alongside John Peterson, Andy Gill, Johan Nordlander, Jeff Lewis, Sigbjorn Finne, Ross Paterson and Dimitry Golubovsky. Section 9.3 of A History of Haskell: Being Lazy with Class (Hudak, Hughes, Peyton Jones and Wadler, HOPL III, 2007), largely written by Jones, tells the story of Gofer and Hugs in more detail.

Hugs 98, 1999 to 2006

The releases were named by month:

  • January 1999 — Hugs 98 beta. Merged the module system and dynamic linking of Hugs 1.4 with the type-system extensions of Hugs 1.3c: multi-parameter classes, TREX records, rank-2 polymorphism, existentials.
  • May 1999 — Largely Haskell 98 conformant. Import chasing, a Windows GUI, a first foreign interface.
  • November 1999 — BSD licence. :browse and :version, functional dependencies, better overlapping instances. Bug-fix releases in February and July 2000.
  • February 2001 — A foreign function interface modelled on GHC's, the observe debugger, parallel list comprehensions, recursive mdo, classic Mac OS support.
  • December 2001 — Hierarchical module names, the missing standard libraries, most of hslibs, Mac OS X.
  • November 2002 — The FFI brought close to the specification, a large part of GHC's hierarchical libraries, a complete module system.
  • November 2003 — Internal restructuring. Double becomes double precision, the libraries shared with GHC and nhc98 are adopted wholesale, imprecise exceptions, .NET support on Windows. The beginnings of a user's guide.
  • March 2005 — Unicode Char and locale-based I/O, the -X option, the new ffihugs syntax, Cabal support, and a Cabal-based library build.
  • May 2006 — WinHugs rewritten by Neil Mitchell, the :main command, the empty Hugs module as the default scope.
  • September 2006 — A bug-fix release with libraries matching GHC 6.6.

September 2006 was the last release. By then GHC had an interactive mode of its own, the shared libraries had moved on, and the three-stage bootstrap that turned the shared sources into something Hugs could load had become the main cost of keeping up. Hugs remained in distributions for some years, then stopped building on current compilers.

This tree

This tree is Andrea Bedini's. It starts from the September 2006 release with one aim: a Haskell implementation you can sit down and read. The language is Haskell 2010 plus the parts of modern Haskell that real code needs and one type checker can hold; everything from 2006 that did not serve the aim has been removed. In order:

  • the sources were made standard C23 and the K&R definitions converted
  • autoconf was replaced by meson, with the platform facts written down rather than probed
  • the dead platforms (DOS, classic Mac OS, Symbian, Win16, the old Unixes) were deleted
  • the flag-guarded extensions and n+k patterns were deleted; pattern guards were added
  • the base library was taken over as plain Haskell and the Cabal/cpphs/hsc2hs bootstrap removed
  • the packaging, the DocBook user's guide and the release notes were replaced with this documentation
  • the -98 switch was dropped, so the extensions it guarded are always on
  • the fork was first called Cuddles, and everything that carried the Hugs name was renamed; the haskell98 flat-module package, the .NET remnants and the unbuilt 2006 lib/ and include/ trees were dropped, and the three modules the demos need from lib/ moved into demos/
  • kind signatures, GADT syntax and equality constraints were added, the equalities within the one constraint solver, and literate scripts were dropped
  • the fork was named Cupid, after the day Hugs was first released
  • the libraries took the class hierarchy and API of GHC's base, and the language gained what packages written for GHC use most: type operators, tuple sections, polymorphic and constraint synonyms, and GHC's deriving strategies with Generic and Data
  • Windows became a supported platform, built natively without a POSIX layer, and CI builds release archives for Linux, macOS and Windows
  • literate scripts came back, in the Bird-track form only

The design of Cupid explains the choices that came out of these changes, and why they were made. Differences from Hugs 98 lists what they mean for someone who used Hugs.

See also

Edit this page on GitHub