Getting Started

UHC

1 Download

  • Prerequisites. Running the configure scripts yields an overview of what is missing.
    • GHC: a recent version, preferably > 7.0.3=; GHC 7.0.3 has been used for recent development, GHC 7.4.1 for current development. Older GHC versions may do as well, but are not used for developing, nor is any effort done for keeping UHC compilable with older GHC versions. The installed libraries should include the mtl and fgl library. Depending on platform and GHC distribution more libraries may need to be installed.
    • Additional libraries, available via Hackage or locally.
      • uulib: parser combinators.
      • uuagc: attribute grammar system.
  • Download

2 Build and install

  • Prerequisites: GHC and the abovementioned libraries must be installed.
    • Look here for setting up a cygwin environment and additional info on installing UHC under cygwin.
  • For building UHC, run the following commands from trunk/EHC:
    % ./configure
    % make uhc                         # under the hood, this is EHC variant 101
    % make install                     # sudo may be required, depending on your permissions
    
    During the build part of the compiler is built as a library, installed as a ghc user package, via cabal.

3 Run

  • Run UHC. A sample session:
    % cat > hw.hs
    module HelloWorld where
    main = putStrLn "Hello World"
    % uhc hw.hs
    [1/1] Compiling Haskell              hw                     (hw.hs)
    % ./hw
    Hello World
    %
    

4 Check your installation (optional)

  • Regress test UHC:
    % make test
    WARNING: output may differ w.r.t. names for the following tests:  IO2.hs IO3.hs
    make test-regress TEST_VARIANTS=uhc
    == version 101 ==
      -- 99/BoundedChar1.hs.exp101 -- 99/BoundedChar1.hs.reg101 --
      -- 99/BoundedInt1.hs.exp101 -- 99/BoundedInt1.hs.reg101 --
      -- 99/CaseFall1.hs.exp101 -- 99/CaseFall1.hs.reg101 --
    ...
    %
    

    Differences may also be reported because of platform dependent representation of linefeeds. The tests where this is likely to happen are marked with the word platform to indicate the platform or runtime environment differences.

5 Shoot trouble (hopefully optional)

See the troubleshooting FAQ in the UHC manual.