[m-rev.] for review: string switches using tries

Zoltan Somogyi zoltan.somogyi at runbox.com
Wed Feb 25 12:46:26 AEDT 2015



On Wed, 25 Feb 2015 12:01:44 +1100, Paul Bone <paul at bone.id.au> wrote:
> I want to clarify something, because I'm not an expert on encoding/unicode.
> Isn't it desirable that a Mercury programmer can be sure that strings are
> the same across all backends?  (That they have the same encoding, behaviour
> etc.

Yes, that is desirable. However, using the same representation
as the target language is even more desirable, because without it,
passing strings across the foreign language interface becomes
(a) slow, due to the required representation changes, and (b) error
prone, since e.g. code that deals with offsets into strings has to
keep track of "offset into *which version* of the string?", with
the chance of getting the answer wrong.

Zoltan.



More information about the reviews mailing list