As far as I understand quite a lot of what’s working now is thanks to Atze Dijkstra and Jurriën Stutterheim,2 so cheers to those!
UPDATE 2012-04-23: The Git repo has moved to: git://github.com/UU-ComputerScience/uhc.git
I used the UHC repository from Github:
$ mkdir uhcjs $ cd uhcjs $ git clone firstname.lastname@example.org:uhc/uhc.git $ cd uhc/EHC
GHC 7+ should work okay, I imagine.3
There is no INSTALL file and the README doesn’t mention installation, but the configure script is helpful.
Have a look, see if it mentions that you need something installed.4 Personally, I had to install a few:
$ cabal install uuagc fgl EH-Util syb
Then I just ran make (
-j runs n jobs and I have four cores):
$ make uhc -j 4 … real 4m40.388s user 6m19.628s sys 0m12.053s
Takes about 5 minutes on a modern machine,5 so you probably want to run both make and make install (sans
-j), which takes about 4 minutes:
$ make uhc -j 4 && sudo make install
And go get a cup of tea.
$ uhc --version ehc-1.1.2, Revision exported
Now UHC is installed.
UPDATE 2012-02-16: Git repo below is currently not working due to rename from jscript → js, use git://github.com/spockz/uhc-jscript.git instead.
$ cd ../.. $ git clone git://github.com/norm2782/uhc-jscript.git
Go to the src directory:
$ cd uhc-jscript/uhc-jscript/src
Main.hs and replace everything with something nice like:
import Language.UHC.JScript.Assorted main = alert "Hello, Haskell!"
$ uhc -tjs Main.hs
Main.html in your browser.
That’s about as far as I got. There’s a fairly substantial API already defined by Jurriën Stutterheim in src/, e.g. a HTML5 API and jQuery and AJAX. Enjoy hacking! It’s more complete than GHCJS, so it may be an interesting route to take for the Ludum Dare for making a browser-based game.
I had to use GHC 7.0.4 as GHC 6.12.3 failed with a rather unsightly plethora of linker errors. So I enabled GHC 7.0.4:
$ export PATH=/opt/ghc/7.0.4/bin/:$PATH
Required: uuagc is available? : yes version : Attribute Grammar compil… command for uuagc : /home/chris/.cabal/bin/uuagc ghc is available? : yes version : 6.12.3 command for ghc : /home/chris/Programs/bin/ghc command for ghc raw : /home/chris/Programs/bin/ghc libraries: uulib is available? : yes version : uulib-0.9.14
Intel(R) Core(TM) i7 CPU M 620 (2.67GHz and 4096 KB cache size) x× 4.↩