[m-dev.] record syntax

Thomas Conway conway at cs.mu.OZ.AU
Thu Feb 24 08:50:16 AEDT 2000


On Wed, Feb 23, 2000 at 04:55:14PM EST, David Overton wrote:
> Here's one way you could achieve this interface to the ppid type with
> the current system, with just a bit more typing and slightly less
> efficiency:
> 
> 	:- type ppid
> 		--->	ppid(
> 				ppid_2 :: ppid_2,
> 				modname :: string,
> 				predname :: string,
> 				arity :: int,
> 				modenum :: int
> 			).
> 
> 	:- type ppid_2
> 		--->	pred
> 		;	func
> 		;	comp(typemod_2::string, typename_2::string).

I considered this and it isn't feasible because it uses an extra
word (assuming we have at least two tag bits on pointers). I'm
allocating a few million of these, and lots of other structures besides,
so every word counts.

In my application, I stopped using maps because they have a memory
overhead of about a factor of 2 greater than using arrays. It wasn't
access time, but memory - when you start paging, it doesn't matter
whether the access time is O(1) or O(n log n). :-(

-- 
 Thomas Conway )O+     Every sword has two edges.
     Mercurian            <conway at cs.mu.oz.au>
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to:       mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions:          mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------



More information about the developers mailing list