Re: GHCI/FFI/GMP/Me madness

2004-08-10 Thread Alastair Reid
into some header file that everyone eats. make clean; make You can generate the list by hand or have it rebuilt by make every time. -- Alastair Reid ___ Glasgow-haskell-users mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/glasgow

Re: Release plans

2004-07-20 Thread Alastair Reid
I'd like to see us support more debugging information, preferably in a way that can be stripped from a binary. The easy way would be as .stabs entries since that's what gdb uses. However, stabs entries themselves are absolutely horrible (the design obviously started simple and acquired a

Re: Strictness confusion

2004-06-25 Thread Alastair Reid
don't know how effective it was or what the interesting issues were but there's plenty of papers/ research reports about Yale's strictness analysis and optimization. -- Alastair Reid ___ Glasgow-haskell-users mailing list [EMAIL PROTECTED] http

Re: Finalizers and FFI

2004-06-11 Thread Alastair Reid
memory management techniques (reference counting, etc.) Of course, there's a problem if you have C function pointers generated using '' in C and function pointers generated using dynamic wrappers in Haskell. There's no reliable way to tell them apart. -- Alastair Reid

Re: Finalizers and FFI

2004-06-10 Thread Alastair Reid
thread a chance to run by calling Control.Concurrent.yield before exiting: http://etudiants.insia.org/~jbobbio/pafp/docs/base/Control.Concurrent.html#v% 3Ayield That is, call yield just after calling performGC. -- Alastair Reid ___ Glasgow-haskell

Re: Finalizers and FFI

2004-06-10 Thread Alastair Reid
threads. I think there's a reason why GHC gives the main thread special status though. They certainly went to some effort to give it special status so I guess there must be a good reason that they did so? -- Alastair Reid ___ Glasgow-haskell-users mailing

Re: Finalizers and FFI

2004-06-10 Thread Alastair Reid
potentially finalize an object before its last use because one of the other finalizers uses it. To fix this, you have to run the finalizers in the right order but how can you tell what the right order is? -- Alastair Reid ___ Glasgow-haskell-users mailing

Re: Finalizers and FFI

2004-06-09 Thread Alastair Reid
there is a newForeignPtr that is easier to use: But, sadly, not portable. -- Alastair Reid ___ Glasgow-haskell-users mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/glasgow-haskell-users

Re: F#

2004-05-21 Thread Alastair Reid
exclusively, there would have been less choice so we'd have been more focused.) -- Alastair Reid ___ Glasgow-haskell-users mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/glasgow-haskell-users

Re: Dynamic loading problem

2004-04-29 Thread Alastair Reid
makeStableNamezh_fast). How can I proceed? Can I pass some flag to the linker or such to force them to behave as I want? Does passing the flag RTLD_GLOBAL to dlopen help? (man dlopen for info about this flag) -- Alastair Reid ___ Glasgow-haskell

Re: FAQ: How to Use Extensible Records in GHCi

2004-03-30 Thread Alastair Reid
#a ( a='a', b=True ) 'a' Trex #b ( a='a', b=True ) True Documentation is here: http://cvs.haskell.org/Hugs/pages/hugsman/exts.html#sect7.2 -- Alastair Reid ___ Glasgow-haskell-users mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo

Re: Haskell performance

2004-03-18 Thread Alastair Reid
the Haskell garbage collector finds it can't access them from the Haskell heap. Not really hard to do - just need to be careful. -- Alastair Reid ___ Glasgow-haskell-users mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/glasgow

Re: Running a final finaliser

2004-01-05 Thread Alastair Reid
. -- Alastair Reidhaskell-consulting.com ___ Glasgow-haskell-users mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/glasgow-haskell-users

Re: Why does sizeOf Word64 = 4?

2003-11-09 Thread Alastair Reid
doesn't directly support) and the size would still be the same because all you are doing is passing a pointer to the object. -- Alastair Reidwww.haskell-consulting.com ___ Glasgow-haskell-users mailing list [EMAIL PROTECTED] http://www.haskell.org

Re: DiffArray Performance

2003-11-05 Thread Alastair Reid
The problem was whether DiffArrays should be thread-safe in the Concurrent Haskell sense, which means protecting access to the DiffArray with an MVar. Can you give some estimate of the cost of using an MVar in this way? Could some cheaper mechanism be provided for the special case of a

Re: DiffArray Performance

2003-11-04 Thread Alastair Reid
, the Java community has done a lot of work on how to make it cheap to take an uncontested lock but more expensive to take a contested lock. -- Alastair Reid ___ Glasgow-haskell-users mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo

Re: DiffArray Performance

2003-11-03 Thread Alastair Reid
almost never used in multi-threaded situation. -- Alastair Reid ___ Glasgow-haskell-users mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/glasgow-haskell-users

Re: Marshalling functions was: Transmitting Haskell values

2003-10-29 Thread Alastair Reid
concerns portability of type representations between architectures with different word sizes and different endianness. Good answers probably exist for the type sharing problem (it's a well-studied area). The main problem will be picking among the different choices. -- Alastair Reid

Re: Template Haskell...

2003-10-29 Thread Alastair Reid
(but not enough). -- Alastair Reidwww.haskell-consulting.com ___ Glasgow-haskell-users mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/glasgow-haskell-users

Re: DiffArray Performance

2003-10-27 Thread Alastair Reid
differences like this.) -- Alastair Reidwww.haskell-consulting.com ___ Glasgow-haskell-users mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/glasgow-haskell-users

Re: my 2p's worth...

2003-09-20 Thread Alastair Reid
a per-module option is not viable. -- Alastair Reid ___ Glasgow-haskell-users mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/glasgow-haskell-users

Re: Exhaustive Pattern-Matching

2003-08-29 Thread Alastair Reid
exist. 3) Warn if any occurences of hugs_PMF remain and report any runtime failures that miss hugs_PMF as compiler bugs. I never implemented this but I think it would work well. -- Alastair Reid ___ Glasgow-haskell-users mailing list [EMAIL

Re: profiling for stack usage

2003-08-15 Thread Alastair Reid
to build thunks that look like this: 1+1+1+1+ + 1 + 0 which take O(n) heap to store and O(n) stack to evaluate (with constant factors of around 10-20). If you've already tried this approach, the tolols SimonM mentions are well worth using. -- Alastair Reid

Re: Polymorphic kinds

2003-08-04 Thread Alastair Reid
. -- Alastair Reid ___ Glasgow-haskell-users mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/glasgow-haskell-users

Re: How to modify GHC internals?

2003-07-19 Thread Alastair Reid
a slowdown by a factor of 2-10 (depending on whether you interpret or compile) so this might not suit your needs. -- Alastair Reid ___ Glasgow-haskell-users mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/glasgow-haskell-users

Re: state of ghc6 on sparc

2003-06-19 Thread Alastair Reid
On Thursday 19 June 2003 11:06 am, Malcolm Wallace wrote: As I see it, the main problem is reproducing all the keybindings. I'm certain that every user of readline has their own habitual set of emacs keystrokes that differs slightly from everyone elses, so inevitably the full complement will

Re: Problems building ghc-current

2003-05-28 Thread Alastair Reid
Alastair: Thanks a lot for the detailed reply! I'll take a look at the build again; maybe I can get this problem fixed after all. The attached diff (about to be committed) seems to fix the problem. -- Alastair? gc-3.00 ? distrib/html/old_index.html ? lib/Foreign/GreenCard.p_hi ?

Re: STArray and Lazy ST

2003-05-09 Thread Alastair Reid
that, in the absence of a more flexible module system, renaming the lazy st monad seems sensible. -- Alastair Reid ___ Glasgow-haskell-users mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/glasgow-haskell-users

Re: How is non-blocking IO working ?

2003-04-03 Thread Alastair Reid
calls. The problem is that this isn't as portable as using select. Hope this helps. -- Alastair Reid [EMAIL PROTECTED] Reid Consulting (UK) Limited http://www.reid-consulting-uk.ltd.uk/alastair/ SELECT(2) Linux Programmer's Manual SELECT(2

Re: ANNOUNCE: GHC vesrion 5.04.3 released

2003-03-13 Thread Alastair Reid
.] And does GHC or anybody else support 64bit address spaces? I think Hugs does but it would be worth checking explicitly. I'd pay particular attention to the Ptr type in the ffi libraries. -- Alastair Reid [EMAIL PROTECTED] Reid Consulting (UK) Limited http://www.reid-consulting

Re: ghc feature request: core notes

2003-02-06 Thread Alastair Reid
. Assuming that the 1st argument to 'NOTE' is a literal string in the following: #ifdef TRACK_NOTES #define NOTE(x,y) (_scc_ NOTE x (y)) #else #define NOTE(x,y) {- nothing -} #endif -- Alastair Reid ___ Glasgow-haskell-users mailing list [EMAIL PROTECTED

Re: calling haskell from C from haskell

2003-01-03 Thread Alastair Reid
Haskell - C - Haskell. Benefits of using the ffi are that your code will be portable to other compilers (Hugs and NHC) and you'll be in well charted waters where you can be confident that if things don't work then you've found a bug and not an undocumented feature. -- Alastair Reid

Re: ext-core Questions

2002-12-21 Thread Alastair Reid
(For those who are interested in the background of my question: I wondered if it would be possible to translate Core [Haskell] to Perl. If I hunt around a bit, I can maybe find my notes on translating to Forth - my goal was to be able to run Haskell on all the printers at work. -- Alastair

Re: Proposals for changes to searching behaviour

2002-12-10 Thread Alastair Reid
prefer to see everyone switch over to the new way so that we can drop old features. -- Alastair Reid ___ Glasgow-haskell-users mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/glasgow-haskell-users

Re: Native Threads in the RTS

2002-11-29 Thread Alastair Reid
[Note: I'm consistently using 'foreign thread' instead of 'native thread'. The Haskell-spec necessarily treats Haskell as the centre of the universe. So what a Linux kernel hacker might think of as a 'native thread' is really quite foreign to Haskell. Feel free to ignore this little experiment

Re: Native Threads in the RTS

2002-11-29 Thread Alastair Reid
Simon Marlow: Another problem, from an implementation point of view, is that we would have to surround unsafe foreign calls with a lot of context-switching gumph, in case the calling Haskell thread is bound to a native thread. I really think we don't want to do this. Note that you only

Re: Native Threads in the RTS

2002-11-27 Thread Alastair Reid
Are you sure you intend to change the type of forkIO? Currently it's forkIO :: IO () - IO ThreadId Sorry, no, I did not. -- Alastair ___ Glasgow-haskell-users mailing list [EMAIL PROTECTED]

Re: re-opening a closed stdin?

2002-11-25 Thread Alastair Reid
Simon Marlow: [Lazy I/O] is nice, but it introduces too many problems. What happens to any I/O errors encountered by the lazy I/O? They have to be discarded, which means you can't effectively use lazy I/O for robust applications anyway. Surely they are thrown as exceptions which can then

Re: Silly question about IORefs and MVars

2002-11-23 Thread Alastair Reid
memory. -- Alastair Reid ps It's best to avoid relying on compilers not to context switch at particular times unless it is documented that this is a property you can rely on. That kind of reasoning tends to break down when your compiler gets smarter or you switch compilers

Re: RFC: External library infrastructure

2002-11-22 Thread Alastair Reid
multiple copies of what is, essentially, the same information. Obviously, the 3rd reason is the one of most relevance to this thread. -- Alastair Reid [EMAIL PROTECTED] Reid Consulting (UK) Limited http://www.reid-consulting-uk.ltd.uk/alastair

Re: RFC: External library infrastructure

2002-11-12 Thread Alastair Reid
Could you be more concrete? What extension of the package mechanism did you have in mind? (personally I had in mind a standard autoconf + Makefiles story for the build system, but I'm sure there are better ways). I was thinking add all the things that make packages insufficient to use as

Re: Re : Extensible records in Haskell

2002-11-06 Thread Alastair Reid
) that brought us constructor classes, functional dependencies, etc. -- Alastair Reid ___ Glasgow-haskell-users mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/glasgow-haskell-users

Re: Extensible records in Haskell

2002-11-05 Thread Alastair Reid
Hello, is there something like extensible records in ghc? Are you wanting something like Hugs' T-Rex or did you have something else in mind? -- Alastair Reid [EMAIL PROTECTED] Reid Consulting (UK) Limited http://www.reid-consulting-uk.ltd.uk/alastair

Re: IOError vs. Exception vs. IOException

2002-10-31 Thread Alastair Reid
Ross Paterson [EMAIL PROTECTED] cryptically writes: Shouldn't IOError be identified with IOException rather than Exception? I had to grovel through the code to understand what this question means. It seems that GHC.IOBase contains these definitions: type IOError = Exception data

Re: FFI C++

2002-10-29 Thread Alastair Reid
to use them when linking. -- Alastair Reid [EMAIL PROTECTED] Reid Consulting (UK) Limited http://www.reid-consulting-uk.ltd.uk/alastair/ ___ Glasgow-haskell-users mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo

Re: unsafePerformIO

2002-09-24 Thread Alastair Reid
Koen Claessen [EMAIL PROTECTED] writes: However, I for example have no idea what happens when unsafely executing something that throws exceptions, performs a forkIO, something that uses MVar's, etc. I won't dare to try to characterize the difference exactly but you should expect very

Re: Foreign.destructArray

2002-07-25 Thread Alastair Reid
is that, as far as I know, GHC is the only compiler to support the deprecated pragma so it is the only one where it makes sense to complain that a function was removed without being deprecated first. -- Alastair Reid [EMAIL PROTECTED] Reid Consulting (UK) Limited http://www.reid

Re: Foreign.destructArray

2002-07-25 Thread Alastair Reid
a given expiry date. Probably off by default. 5) Each release would include a list of any entities removed ahead of schedule. [It's open to debate whether this would do anything other than increase the motivation to keep the list small.] -- Alastair Reid [EMAIL PROTECTED

Re: Type of newForeignPtr addForeignPtrFinalizer

2002-07-23 Thread Alastair Reid
[This question might be more appropriate for the ffi mailing list] I wonder if I might indulge myself with another stupid question related to this, that is, why make the distinction between Ptr and ForeignPtr at all? [...] The reason for using ForeignPtr is to attach free functions. If we

Re: error building greencard with ghc 5.04

2002-07-22 Thread Alastair Reid
to go through.] -- Alastair Reid [EMAIL PROTECTED] Reid Consulting (UK) Limited http://www.reid-consulting-uk.ltd.uk/alastair/ ___ Glasgow-haskell-users mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/glasgow-haskell

Re: unsafePerformIO around FFI calls

2002-07-09 Thread Alastair Reid
you don't even see side effects reflected as changes in the returned world state.) -- Alastair Reid [EMAIL PROTECTED] Reid Consulting (UK) Limited http://www.reid-consulting-uk.ltd.uk/alastair/ ___ Glasgow-haskell-users mailing

Re: unsafePerformIO around FFI calls

2002-07-08 Thread Alastair Reid
paper or some such. -- Alastair Reid [EMAIL PROTECTED] Reid Consulting (UK) Limited http://www.reid-consulting-uk.ltd.uk/alastair/ ___ Glasgow-haskell-users mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/glasgow

Re: GHCI Can't Find Module But GHC Can

2002-06-27 Thread Alastair Reid
(NIL); } ; The C function 'chase' returns True if there are dependencies on modules we haven't loaded yet. The body of the if causes Hugs to record the offending import list and abandon compiling the current module. -- Alastair Reid[EMAIL

Re: HGL with GHC in Win32

2002-06-24 Thread Alastair Reid
of GHC you use to build GHC with.] PS. I still have to figure out how to make hslibs/win32 in isolation, This seems like a common need for which there should be a standard plan of attack. Sadly, I don't know it. -- Alastair Reid[EMAIL PROTECTED]http://www.cs.utah.edu/~reid

Re: HGL with GHC in Win32

2002-06-21 Thread Alastair Reid
the latter. -- Alastair Reid[EMAIL PROTECTED]http://www.cs.utah.edu/~reid/ ___ Glasgow-haskell-users mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/glasgow-haskell-users

Re: possible readline license problem with ghc and -package util

2002-06-11 Thread Alastair Reid
against this is for the copyright owners to make a legally binding promise not to do so (as the FSF have done). -- Alastair Reid ___ Glasgow-haskell-users mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/glasgow-haskell-users

Re: problems with FFI including h files

2002-06-05 Thread Alastair Reid
I thought we established that generating valid C prototypes from the Haskell FFI type signature wasn't possible due to the incompleteness of the Haskell type (lack of 'const' modifiers for one thing - is there anything else?). Compilers use the same calling sequence whether you tell them

Re: problems with FFI including h files

2002-06-05 Thread Alastair Reid
Yes - but read the text I quoted before my message. I'm not talking about calling the function, I'm talking about generating C prototypes. You suggested that the Haskell compiler could generate prototypes and the C compiler could be used to check for mismatches, which would be great if it

Re: problems with FFI including h files

2002-06-03 Thread Alastair Reid
Anyone have any ideas that don't have such a big impact? What we did in Hugs (for GreenCard stuff) was create a header file containing _only_ the things needed by ffi'd code (example attached). Since it was such a short file, it wasn't too hard to avoid nameclashes. This works because the

Re: Dynamic types: GHCI works, GHC doesn't?

2002-06-02 Thread Alastair Reid
just as a note, the new version of DrIFT (which i now maintain) has the ability to derive 'Typeable', Very cool. (Though I'd still like to see Typeable being moved into compilers.) I sort of fudged the Typeable derivation rule, if someone wanted to robustify it, i would gladly accept

Re: Dynamic types: GHCI works, GHC doesn't?

2002-06-01 Thread Alastair Reid
instances themselves.] -- Alastair Reid[EMAIL PROTECTED]http://www.cs.utah.edu/~reid/ ___ Glasgow-haskell-users mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/glasgow-haskell-users

Re: monomorphism/hugs98/ghc-5.02.3

2002-05-31 Thread Alastair Reid
of Aho, Sethi and Ullmann) designing a language (C) which is not context free (because of the typedef problem).) -- Alastair Reid ___ Glasgow-haskell-users mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/glasgow-haskell-users

Re: problems with FFI including h files

2002-05-31 Thread Alastair Reid
think) - so you could see just where everything comes from. -- Alastair Reid[EMAIL PROTECTED]http://www.cs.utah.edu/~reid/ ___ Glasgow-haskell-users mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/glasgow

Re: instance Ord FiniteMap

2002-05-29 Thread Alastair Reid
; then become hash tables (or something like that - it was a long time ago that I saw this). Which is all to say that you should hide your choice of data structure behind a common API and change it as you run into performance problems. -- Alastair Reid[EMAIL PROTECTED]http

Re: specifying common 'dis's in greencard

2002-05-29 Thread Alastair Reid
) so I think you should distill the essence of the problem into a couple of 5-10 line modules and send in a bug report (or realize what you were doing wrong in the process). -- Alastair Reid[EMAIL PROTECTED]http://www.cs.utah.edu/~reid

Re: Runtime importing of modules in GHC

2002-05-27 Thread Alastair Reid
the typename stays the same but the type itself changes, but it'll also catch a lot of errors in a lot of code. -- Alastair Reid[EMAIL PROTECTED]http://www.cs.utah.edu/~reid/ ___ Glasgow-haskell-users mailing list [EMAIL PROTECTED] http

Re: last result in ghci

2002-05-02 Thread Alastair Reid
compatible in this regard. -- Alastair Reid[EMAIL PROTECTED]http://www.cs.utah.edu/~reid/ ___ Glasgow-haskell-users mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/glasgow-haskell-users

Re: announce: GHC internals library (version 0.1)

2002-05-01 Thread Alastair Reid
| Int Int | Integer Integer | Float Float | Double Double | CharChar | MiscString -- any other value that we don't yet distinguish (ie Blackhole) Any chance we can work together to eliminate as many of these differences as possible? -- Alastair Reid

Re: module namespaces with Prelude

2002-04-24 Thread Alastair Reid
roots and turn on ambiguous filename checks and would perhaps convert their code to use hierarchial namespaces. -- Alastair Reid[EMAIL PROTECTED]http://www.cs.utah.edu/~reid/ ___ Glasgow-haskell-users mailing list [EMAIL PROTECTED] http

Re: module namespaces with Prelude

2002-04-23 Thread Alastair Reid
: confuses Bar.IO for IO hugs -P..: Bar.Foo # unexpected failure: confuses Bar.IO for IO Did I do the wrong thing or do we need to tweak the loader? (I didn't test with import chasing turned off - could that be it?) -- Alastair Reid[EMAIL PROTECTED]http://www.cs.utah.edu/~reid

Re: ghc graphics library

2000-06-28 Thread Alastair Reid
simonpj writes: Alastair Reid is, I believe, actively working on updating his graphics library (from which SOEGraphics was originally derived), to work with the current version of GHC. What I don't know is when he expects to be done. Alastair? What's the status? I don't think there's