[clean-list] Beginner

Jeremy Shaw jeremy.shaw@lindows.com
Sun, 04 Jul 2004 15:22:47 -0700


At Sun, 27 Jun 2004 14:27:58 -0400 (EDT),
Philippos Apolinarius wrote:

> I compiled both examples. Clean  generated a small exec (43 k), as I would expect for this simple problem. Haskell generated a huge exec, ten
> times larger than Clean. Again, I think the problem is my lack of knowledge about GHC compiler. You must understand that I have been playing with
> them languages for only two days. My questions are:
> 1- How to compile the simple examples in Haskell in order to get small exec.

The smallest possible haskell binary is just big -- that's all there
is too it. Fortunately, if you write a 100 line program instead of a 1
line program, it will only be slightly larger, not 100 times larger :)

In unix like environments, you can use 'strip' to remove extra debug
symbols that are not needed in a final release. This seems to cut the
file size by 40% or so.

/tmp $ cat Hello.hs
module Main where

main = putStrLn "Hello, World!"
/tmp $ ghc --make Hello.hs  -o hello
Chasing modules from: Hello.hs
Compiling Main             ( Hello.hs, Hello.o )
Linking ...
/tmp $ ./hello
Hello, World!
/tmp $ ls -ld hello
-rwxr-xr-x   1 toadx    toadx      248420 Jul  4 15:19 hello
/tmp $ strip hello
/tmp $ ls -ld hello
-rwxr-xr-x   1 toadx    toadx      151688 Jul  4 15:19 hello
/tmp $ 

> 2- How to translate the parabola example to Haskell.

I am not familiar with any of the graphic libraries for haskell...

Jeremy Shaw.