[Yhc] Still shrinking YHI for ARM7...question
shackell at cs.york.ac.uk
Tue Jul 24 02:49:53 EDT 2007
Alexis Morris wrote:
> Hi all,
> So far this all compiles fine, and will fit into ROM but I have yet to
> test it...I would like to figure out what else I can skim...I really
> want to be able to run it from RAM (64KB) eventually.
> My question at the moment is whether I can remove stuff like pretty.c,
> and sanity.c (and possibly jonkers) without having a major breakdown of
> the system.
> $(VM_DIR)/profile.c \
> $(VM_DIR)/stable.c \
> $(VM_DIR)/pretty.c \
> $(VM_DIR)/sanity.c \
> $(VM_DIR)/stopcopy.c \
These should be safe to remove, indeed stopcopy isn't used at all.
> $(VM_DIR)/Concurrent.c \
> $(VM_DIR)/IORef.c \
> $(VM_DIR)/PackedString.c \
> $(VM_DIR)/RuntimeAPI.c \
These should be possible to remove, Concurrent may be a bit more tricky
(but I think it's all optional).
> $(VM_DIR)/Array.c \
It is used in Numeric but you'll probably never used the function that
uses it (hence you should be able to remove it).
> $(VM_DIR)/WrapPrimitive.c \
You can remove any definitions made redundant by removing other things.
> $(VM_DIR)/System.c \
Might be able to trim it down, primExitWith is essential but everything
else is not.
You might try removing jonkers (and mark) but of course you'll lose
garbage collection. Since you've only got a small amount of memory and
Haskell programs allocate memory like crazy I suspect the garbage
collector is going to be essential.
The other question is how are you loading the bytecode program? In
standard Yhi it's loaded from the filesystem but I'm guessing the
embedded processor doesn't have a file system? In which case I guess you
must load it directly from memory some how. If that's true then you
might be able to remove some of the loading code (but maybe not, depends
on how you do it).
After that it starts getting hard to remove much more. Make sure debug
information is not added and change gcc from "optimise for speed" to
"optimize for size".
Hope that helps :-)
More information about the Yhc