The naming structure of the files are like this:
hbc-version.bin-arch-os.tar.gz
where
There are code generators for the following architectures available: NS32k, M68K, I386, Alpha, ARM, Cray-1, HPPA, MIPS, PowerPC, RT/PC, SPARC, and Vax.
gunzip < the-file-you-fetched.tgz | tar xf -
cd whereever-you-unpacked-it make BIN=platform installwhere platform corresponds to the arch-os part of the tar file you unpacked. This will install the executables in /usr/local/bin, the various other files in /usr/local/lib/lmlc and the man pages in /usr/local/man/man1.
If you decide not to install the compiler in /usr/local/lib/lmlc you must set the environment variable HBCDIR to whatever directory you used instead to be able to compile.
To run the interactive system just type hbi (NOTE: hbi doesn't work on all platforms). E.g.
dogbert% hbi Welcome to interactive Haskell B. 1.4 version 0.9999.4 Pentium 1997 Feb 12! Loading prelude... 1559 values, 194 types found. Type "help;" to get help. > 1+2; 3 > let inc x = x+1;; inc :: (Prelude.Num a) => a -> a > inc 6; 7 > asin (2 :+ 0); 1.5707963267948966 :+ (-1.3169578969248166) > let fac 0 = 1 # fac n = n * fac(n-1) # ; fac :: (Prelude.Num a) => a -> a > fac 100; 93326215443944152681699238856266700490715968264381621468592963895217599993229915608941463976156518286253697920827223758251185210916864000000000000000000000000 > whatis (+); method (+) :: (Prelude.Num b) => b -> b -> b > import Sort; Loading "/usr/local/lib/lmlc/hbc_library1.3/Sort.o" > whatis Sort; module Sort sortLe :: (b -> b -> Bool) -> [b] -> [b] > nub (sortLe (<=) "the quick brown fox jumps over the lazy dog"); " abcdefghijklmnopqrstuvwxyz" > quit; Bye dogbert%
The compiler is called hbc. It has the about the same flags as ordinary UNIX compiler. If the file Main.hs contains
main = putStr "ahoy, przygodo\n"then it can be compiled and run by
dogbert% hbc Main.hs dogbert% a.out | pol2eng hello, world dogbert%To avoid having to keep track of dependencies and also writing Makefiles you should use hbcmake which figures out what has to be done automatically.
dogbert% hbcmake Main hbc -c Main.hs hbc -o Main Main.o dogbert% Main ahoy, przygodo dogbert%
The first time you do this you have to do the following steps: