Core vs Library
Walter Bright
newshound1 at digitalmars.com
Mon Apr 14 12:29:41 PDT 2008
Jarrett Billingsley wrote:
> "Walter Bright" <newshound1 at digitalmars.com> wrote in message
> news:ftv48m$21m5$1 at digitalmars.com...
>> http://reddit.com/info/6foi8/comments/
>
> 1: Yes, in .Net languages the core types are aliases to structs in System,
> not the other way around.
I don't buy it. The C# compiler somewhere in it knows what an int is,
after all, divides aren't done by a subroutine somewhere, they're done
by a hardware instruction.
If you don't agree, show me how System.Int32 can be implemented without
referring to a core int type.
> 2: The article seems self-contradictory. First you say that an int as a
> struct is slow, possibly ugly, can't be optimized, etc. etc. But then you
> turn around and say that modern compilers can make a user-defined complex
> type efficient. Which is it? It doesn't feel like the article comes to any
> kind of conclusion. Is it that fundamental types like int and float should
> be builtin, while anything higher-level including complex can be done
> satisfactorily as a library?
The struct can be optimized if it is based upon *core* types that can be
optimized.
More information about the Digitalmars-d
mailing list