[m-dev.] Minimal streams diff

Michael Day mikeday at yeslogic.com
Wed Oct 2 21:58:26 AEST 2002

> 	- this patch is not OK because it will make things inefficient,
> 	  given our current optimization technology

By cross-module type class calls you mean calls to read_char and
write_char made from outside the module they are defined in? And these
can't be specialised if intermodule optimisation is not enabled, requiring
a method dictionary lookup even when the stream type is known? This seems
like a problem with any type class based stream implementation, but surely
it's reasonable to assume that intermodule optimisation will be enabled
when efficiency is a concern?

The solution to this (besides requiring intermodule optimisation) would be
to leave the original io interface intact. However, this would require
changing the name of the stream read_char and write_char predicates or
moving them back to a separate stream module.

> 	- a big part of the benefit can be achieved by just changing
> 	  extras/stream to use io__result; I encourage you to post a
> 	  patch for this

This would seem to fit with the previous point...

> 	- there might be an argument for moving some or all of the
> 	  functionality in extras/stream into the standard library;
> 	  I'd be happy to consider any proposals you have in this area.

This doesn't seem so convenient, given the first requirement not to
replace the existing io__read_char and io__write_char, which will require
two different names for predicates with the same semantics, even if one is
more efficient than the other.

> (We could reconsider this if/when our optimization technology improves.)

How would it be possible to perform intermodule optimisation without
enabling intermodule optimisation? Or is the existing intermodule
optimisation insufficient for some common cases of type class


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