IRIX 6.5 support for GHC (mips-sgi-irix65)

Note: All trademarks and copyrights are registered and/or property of their respective owners (SGI, Glasgow Univeristy...).


Here you will find:

Brief notes on the different models to run GHC.


    Ghc is a compiler for Haskell language, a purely functional language ( http://www.haskell.org ). This page is not intended to explain what functional programming is, but briefly, you sholud understand that due to the large distance between the imperative and the functional underlying computational models , ghc generates code to be executed in a virtual machine: the STG (Spin Tag-less Machine) designed originally by Simon Peyton Jones, among others...
 The way the runtime system implements this virtual machine  varies from the close-to-specifications of the original STG design to the efficiency and fastness of the real STG adhoc implementation in hardware stock.

In other words,  the "theoric,elegant,universal and portable" versus "hacking,fuzzy,local,fast, efficient" :
  1. Unregisterised: The purest and most portable model, on a C compiler (also the less efficient).
  2. Registerised: Optimizations achieved on the previous model  (Strong dependent on GNU tools, gcc and binutils).

Handicaps I found to get a full registerised version (history of a distressing ha[c|s]ke[r|ll] ).

I'm distressed after more than half a year hacking the ghc internals... After that, this is all the information I can share with the Haskell community to aid future porters (not only for those on IRIX ). I will go on hacking every morning, as Prometeo did in the mitology. Some bugs are fixed and new ones are discovered...It's my destiny. ;-). After all, Spanish Minister of Science and Technology (MCyT) has invested some money ( not very much, by the way...) for no available results... :-(
               

 Search for yor combination and read the bug...

CC/GHC
4.08.2
5.04.2
gcc-2.95
A1,A2
A2
gcc-3.0
A3
A4
cc
A5
A5




Notes to bootstrap an unregisterised version (and run nfib.hc).

The corresponding document "Building the Glasgow Functional Programming Tools Suite"/Chapter 10 Porting GHC  is very helpful...
 However, unregisterised bootstraping is fuzzy and there are no many indications to proceed . Take this script (may be this can contribute to redefine the bootstrap mode in newer and easier modes...)

Prerequisites:

    gmake,gcc-2.95 ... Installing is up to you.

Installing:

WARNING: except ghc-4.08.2-src.tar.gz, mirroring haskell site, and ghc-4.08.2-unreg-h[c|i].tar.gz , the rest are unstable code.
**Last NEWS : Edit the ghc-4.08.2/ghc/include/config.h, and fix by hand the lines:  ( Give me time to make the patch...)

#define TEXT_SECTION_END_MARKER  data_start
#define TEXT_SECTION_END_MARKER_DCL  data_start

Running nfib.hc  fib(35)

As explained above you have just got a faulty-unregisterised ghc compiler, in practical terms, not very much, only able to compiler *.hc files, and only when the output binary is not very complex (single GOT). In fact, the proper haskell compiler -hsc-, is compiled but runs faulty (it is MULTIGOT).
However, for me it was very encouraging to play the first STG machine in the world in a mips-sgi-irix65 platform...

Would you like to enjoy too ?

Did you know that a powerfull RTS is in action, pushing and poping many closures in the heap, applying Beta reductionnfibI.hcs, and a Garbage Collector is collecting useless closures... ?

Download.



Click here

Future projects.

Personal notes.

My acknowledge to the Glasgow Haskell Compiler team...I have learnt very much with is open source code...
 
After 7-9 months os code porting, I haven't reached the goal, may be I will not pass my diploma thesis, but....

I have enjoyed VERY MUCH....


Some of my philosophy has changed and evolved... My lectures on Freud, and over all , Friederich Nietszche had confirmed me that after an elegant universal, theorical formalism ( such as the brilliant STG machine, the formal operational Semantics on Lambda Calculus ...) there are obscure, fuzzy , instintive,chaotic, devil and creative forces... Don't you think so? Take a look into the evil Perl-script mangler  under fptools/ghc-driver/ghc-asm.prl and tell me...

 However the only way to improve is the failure and the patching... Obsession on perfect job is the worst enemy for work well done...

Write some words to rmartine@fdi.ucm.es , the distressed ha[c|s]ke[r|ll] ....

I hope you...


Rafael Martinez Torres. Universidad Complutense de Madrid. 2003.