RE: fast IO in ghc

2002-04-03 Thread Simon Marlow

 I tend to deal a lot with very very large data files in Haskell and my
 current approach to dealing with getting data out of one 
 program an into
 another is writing it to a file using 'show' and then reading 
 it in using
 'read'.  Unfortunately, this is very slow and produces very 
 large files
 which are very slow to read and write.  Is there another 
 option?  I don't
 care about H98 compatibility, so if there's a way to somehow just dump
 ghc's internal representation (I also don't care about 
 x-platformness) to
 a file and read it back, that would be excellent.  Other 
 suggestions are
 welcome too :).

I wrote a binary I/O library recently for GHC, which we're using to
speed up interface file reading and writing.  The library is similar to
nhc98's Binary library, execept that it works in terms of bytes rather
than bits, and we don't do lazy binary I/O in the same way.

It currently has some GHC-specific stuff in it, but I plan to make a
generic version for the libraries at some point.  For the time being,
you can pull it out of CVS and take a look - it's in
ghc/utils/Binary.hs.  It should work if you remove the GHC-specific
bits.

Cheers,
Simon
___
Glasgow-haskell-users mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users



RE: fast IO in ghc

2002-04-03 Thread Simon Peyton-Jones

And, with a lot of help from Koen, I'm about to fold in a
much more efficient implementation of Read, which may help.

Simon

| -Original Message-
| From: Hal Daume III [mailto:[EMAIL PROTECTED]] 
| Sent: 03 April 2002 05:36
| To: GHC Users Mailing List
| Subject: fast IO in ghc
| 
| 
| I tend to deal a lot with very very large data files in 
| Haskell and my current approach to dealing with getting data 
| out of one program an into another is writing it to a file 
| using 'show' and then reading it in using 'read'.  
| Unfortunately, this is very slow and produces very large 
| files which are very slow to read and write.  Is there 
| another option?  I don't care about H98 compatibility, so if 
| there's a way to somehow just dump ghc's internal 
| representation (I also don't care about x-platformness) to a 
| file and read it back, that would be excellent.  Other 
| suggestions are welcome too :).
| 
| --
| Hal Daume III
| 
|  Computer science is no more about computers| [EMAIL PROTECTED]
|   than astronomy is about telescopes. -Dijkstra | www.isi.edu/~hdaume
| 
| ___
| Glasgow-haskell-users mailing list 
| [EMAIL PROTECTED] 
| http://www.haskell.org/mailman/listinfo/glasgow-| haskell-users
| 
___
Glasgow-haskell-users mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users



RE: fast IO in ghc

2002-04-03 Thread Jan-Willem Maessen

Simon Peyton-Jones [EMAIL PROTECTED] writes:
 And, with a lot of help from Koen, I'm about to fold in a
 much more efficient implementation of Read, which may help.

Any of the guilty parties want to give a quick overview of how it's
going to work?

-Jan-Willem Maessen
___
Glasgow-haskell-users mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users



fast IO in ghc

2002-04-02 Thread Hal Daume III

I tend to deal a lot with very very large data files in Haskell and my
current approach to dealing with getting data out of one program an into
another is writing it to a file using 'show' and then reading it in using
'read'.  Unfortunately, this is very slow and produces very large files
which are very slow to read and write.  Is there another option?  I don't
care about H98 compatibility, so if there's a way to somehow just dump
ghc's internal representation (I also don't care about x-platformness) to
a file and read it back, that would be excellent.  Other suggestions are
welcome too :).

--
Hal Daume III

 Computer science is no more about computers| [EMAIL PROTECTED]
  than astronomy is about telescopes. -Dijkstra | www.isi.edu/~hdaume

___
Glasgow-haskell-users mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users