[m-rev.] for review: initialize stream readers/writers at open time for C#
Julien Fischer
jfischer at opturion.com
Sun Apr 23 20:14:09 AEST 2023
Hi Zoltan,
On Sun, 23 Apr 2023, Zoltan Somogyi wrote:
> The equivalent tasks are already done at open time with C and Java.
>
> For review by Peter, but I would like other people's feedback as well
> about the idea that we should eliminate the generic "stream" type,
> and replace it with specific text_input, text_output, binary_input and binary_output
> stream types. We already have these at the user facing level, but we should have them
> one level down as well, at the defined-as-foreign-types level.
Agreed. They should also be different at the foreign type level as
well. Doing so would eliminate quite a bit of the downcasting that goes
on in the C# and Java implementation of I/O primitives.
> (I think we should keep
> the notag wrapper types, because e.g. "binary_input_stream(0xABCD)" is more
> informative in an mdb session than just "0xABCD".)
Agreed.
> I also think we should reverse two equivalence types, so that text_input_stream and
> text_output_stream are not synonyms for input_stream and output_stream respectively,
> but vice versa, with text_input_stream and text_output_stream being the non-equivalence
> types.
>
> Opinions?
That was pretty much my long-term intention when I added the text_* names
back in 2006. It's probably been long enough now ;-)
> On a related matter, what is the situation with MR_NEW_MERCURYFILE_STRUCT?
It was something that Mission Critical added.
> Does anyone user it?
Not to my knowledge.
> Is it reliable?
Unknown
> If yes, is it fast enough to replace the old file
> representation for everyone?
It needs to be benchmarked.
> If not, does anyone have plans to ever make it reliable?
To some extent the need for MR_NEW_MERCURYFILE_STRUCT has been subsumed
by the stream module in the standard library (although that is not
without its own issues).
Since MR_NEW_MERCURYFILE_STRUCT has been disabled for default for 23
years now, I am inclined towards the opinion that we could simply
remove it.
Julien.
More information about the reviews
mailing list