[Q] bootstrapping ghc on netbsd
Dear all, QUESTION: Is there an easy way of keeping ghc-4.08.2 from using any assembler code when compiling it from .hc files + sources? DETAILS: Why do I want to do this? gmp-2.0.2 has some problems compiling on netbsd machines that can be solved by hiding all assembler code from the compiler. Having done so, I managed to bootstrap on NetBSD 1.3.2, but still have an inplace-compiler failure on 1.5. The error message is from the gcc assembler (see below), so I thought trying a pure C variant might help somewhat. I undefined i386_{HOST,TARGET,BUILD}_ARCH in $(TOP)/mk/config.mk but it had no effect. thanks for any hints, Matthias == rm -f Addr.o ; if [ ! -d Addr ]; then mkdir Addr; else /usr/bin/find Addr -name '*.o' -print | xargs rm -f __rm_food ; fi ; ../../ghc/driver/ghc-inplace -recomp -cpp -fglasgow-exts -fvia-C -Rghc-timing -I../../ghc/includes -imonads -static -O -package-name lang -split-objs-c Addr.hc -o Addr.o -osuf o Funny global thing?: __stg_split_marker1: Funny global thing?: _module_registered: Funny global thing?: __init_Addr: Funny global thing?: __stg_split_marker2: Funny global thing?: __stg_split_marker3: [...] Funny global thing?: __stg_split_marker89: Funny global thing?: __stg_split_marker90: Prologue junk?: .globl __stg_split_marker2 __stg_split_marker2: ret .Lfe3: .size__stg_split_marker2,.Lfe3-__stg_split_marker2 .globl Addr_lvl_closure .data .align 4 .typeAddr_lvl_closure,@object .sizeAddr_lvl_closure,4 Addr_lvl_closure: .long Addr_lvl_info .globl Addr_lvl_info .section.rodata .align 4 .typeAddr_lvl_info,@object .sizeAddr_lvl_info,12 Addr_lvl_info: .long 0 .word 0 .word 0 .word 17 .word 0 .text .align 4 .globl Addr_lvl_entry .typeAddr_lvl_entry,@function Addr_lvl_entry: gmake[2]: *** [Addr.o] Error 255 == -- Matthias Fischmann | Research Engineer| +358 (9) 8565 7474 [EMAIL PROTECTED] | SSH Communication Security Corp. | +358 (40) 752 5291 ___ Glasgow-haskell-users mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
How do I force evaluation?
Hi, I want to do something like: | main = do | monstrousDataStructure - monstrousComputation | hPutStr stderr "success!" | ... The important point is that I want to make sure that the computation has terminated and not failed before I go to `...'. I have tried | x - x `seq` x and | x - id $! x which should be equivalent anyway, but they both did not have any effect. Then, I remember that there was something called strict, but I can't find it any more. I am afraid I am missing something basic here. If you can't help me, I will come back with a more precise example, I just haven't found one so far (only the original code, but you don't want to read 1843 LOC on this list, do you?... :) thanks a lot, Matthias -- Matthias Fischmann | Research Engineer | +358 (9) 8565 7474 [EMAIL PROTECTED] | SSH Communication Security Corp | +358 (40) 752 5291 ___ Glasgow-haskell-users mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
greencard example does not compile
Hi, I am playing with greencard a little bit and failed to compile the examples in the documentation. I am using ghc-4.01 (4-02 refuses to compile greencard) and GNU CPP version 2.8.1 (i386 GNU/Linux with ELF). We I make ghc eat the following code (in module Main with a trivial main function): data Polar = P Int Int deriving Show polarToCart :: Polar - (Int, Int) polarToCart (P a b) = (a, b) cartToPolar :: (Int, Int) - Polar cartToPolar (a, b) = P a b %fun mirror :: Polar - Polar %call ( polarToCart / cartToPolar (int x) (int y)) %code x = -x; % y = -y; %result ( polarToCart / cartToPolar (int x) (int y)) the error is this: [...] End of search list. [...]/2.8.1/cc1 /tmp/cca32238.i -quiet -dumpbase ghc32227.c -O -Wimplicit -version -fomit-frame-pointer -fno-defer-pop -o ghc32227.s GNU C version 2.8.1 (i586-pc-linux-gnu) compiled by GNU C version 2.8.1. /tmp/ghc32227.hc:479: redeclaration of `x' /tmp/ghc32227.hc:479: `x' previously declared here /tmp/ghc32227.hc:479: redeclaration of `y' /tmp/ghc32227.hc:479: `y' previously declared here Is this a problem with gcc? Or should I use ghc3 instead of 4? Also, I did not figure out how to keep ghc from ignoring the ``-keep-hc-file-too option''. Is it because the hc file is corrupted that ghc does not want me to look at it? I would really like to get this running, the greencard idea looks very convenient. thanks for any hints, -Matthias (Btw, does anybody know why ghc4.02 complains about comments starting with a character different from space (like in ``--:: type'')? This is certainly not intended, is it?)
[q] locating run-time errors in the source code
Hi, My program just died with the following message: Fail: Prelude.(!!): index too large This is not very informative (I have 7000 LOC). The only thing it tells me is that I should always check whether some index is ok or not, and produce a more informative error message by hand in the latter case. Is there a more elegant way to figure out where the error occurred? Maybe a compiler switch that makes the program dump the source code position where (!!) was accessed? (I checked the documentation, but could not find a clue.) thanks, Matthias -- Max-Planck-Institut für Informatik [EMAIL PROTECTED] http://www.mpi-sb.mpg.de/~fis
Re: Q: Efficiency of Array Implementation
Date: Fri, 19 Feb 1999 09:41:58 +0100 (MET) From: Lennart Augustsson [EMAIL PROTECTED] CC: [EMAIL PROTECTED], [EMAIL PROTECTED], [EMAIL PROTECTED] Concerning 'rapid access' you found in docs - it is hard to believe this access is as fast as in C array - i mean changing X[i] in array X. Because when this change is done fast, it is a side effect, breaks functionality. Extracting values from an array can be as fast as in C. The tricky part is contructing the array. The Haskell Array module provides one way of constructing monolithic arrays, i.e., arrays that are built once and never again modified. But there are other ways, e.g., using ST monad which allows incremental construction of the array. -- Lennart This reminds me of a question I could not solve on my own yet (due to lack of an operational profiler for the most part): Is it possible that ghc knows how to transform Array data structures into destructive arrays in some settings? I had an algorithm with a terrible time complexity and wrote an implementation using purely functional Arrays. Since the runtime was still to bad, I tried ST together with MutableArrays instead, but the runtime got worse. I don't have the time to figure out the details right now, but if you plan to stay interested in them for a longer period, tell me and I will give you more information when I work on the problem again. (It's still possible that it's a bug in my code, however.) -Matthias -- Max-Planck-Institut für Informatik | DFKI [EMAIL PROTECTED] | [EMAIL PROTECTED] http://www.mpi-sb.mpg.de/~fis |
pretty printing with pphs and without
Hi all, I just had a look at the documentation of pphs. Great idea, but it seems as if the ghc source code was texed with something different. Where do those {code}-environments come from, and how can I teach LaTeX to understand them? Will this also fontify my code like pphs would, or is it just equivalent to {verbatim}? If so, can I convince pphs to work together with this other concept? Thank you very much, mf -- Max-Planck-Institut für Informatik | Deutsches Forschungszentrum für KI [EMAIL PROTECTED] |[EMAIL PROTECTED] http://www.mpi-sb.mpg.de/~fis |