First Impressions

BCS BCS at pathlink.com
Sun Oct 1 13:26:01 PDT 2006


Johan Granberg wrote:
> BCS wrote:
> 
>> Why isn't performance a problem?
>>
[...]
>> If you are saying that causing a performance hit in run times or 
>> memory space is not a problem... in that case I think you are dead 
>> wrong and you will not convince me otherwise.
> 
> I don't think any performance hit will be so big that it causes problems 
> (max x4 memory and negligible computation overhead). Hope that made 
> clear what I meant.

If you will note, I said nothing about the size of the hit. While some 
may disagree, I think that any unneeded hit is a problem.

One alternative that I could live with would use 4 character types:

char	one codeunit in whatever encoding the runtime uses
schar	one 8 bit code unit (ASCII or utf-8)
wchar	one 16 bit code unit (same as before)
dchar	one 32 bit code unit (same as before)

(using the same thing for ASCII and UTF-8 may be a problem, but this 
isn't my field)

The point being that char, wchar and dchar are not representing numbers 
and should be there own type. This also preserves direct access to 8, 16 
and 32 bit types.



More information about the Digitalmars-d mailing list