Are templates required ?

Anders F Björklund afb at algonet.se
Fri Jan 19 08:10:26 PST 2007


Frits van Bommel wrote:

>> Which spec is that ? I don't recall them failing any tests.
> 
> I was talking about the D 1.0 spec, which seemed to be what you were 
> talking about.

I only saw a DMD 1.00, so I wasn't sure where the D language is/was...
But if "D 1.0" is the same as what DMD 1.00 supports, then it should.

> Well, I believe they're in the spec for D 1.0, specifically the part 
> located at http://www.digitalmars.com/d/template.html. So IMHO to be 
> fully compliant to the spec, they'd have to work :P.

It "kinda" works, depending on what "compliant to the D spec" means ?
I don't think the spec covers -femit-templates[=full|private|none|auto]

> As far as I'm aware though, they're pretty self-contained. I don't think 
> there are major parts of Phobos that would be broken if templates didn't 
> work, unless you count boxing.
> I think a version of D without template support would still be pretty 
> useful. Though obviously not as useful as a version that *does* support 
> templates :).

Yes, I've been using it for a few years (without templates).
I guess it could still remain as-is, with the warning label.

>> (and GDC doesn't build with Apple GCC 3.3, only with GCC 4.0)
> How about 3.4? Or was that never shipped by Apple?

No, but then again they have a fairly heavily patched GCC 3.3.
gcc (GCC) 3.3 20030304 (Apple Computer, Inc. build 1666)

> How is this related to templates?
> (Does it use "static this()" in a template or something?)

Didn't dig in too deep, just know it works out-of-the-box in Tiger.
Then again, DMDScript was broken again by GDC 0.21 so I'm not sure.

>> readf/TypeInfo doesn't work, because it uses "is" to compare.
>> (and since it emits multiple instances, that doesn't work OK)
> 
> That seems to be an instance of what I expected might happen and wrote 
> in the paragraph you seem to have cut...

Sorry about that.

>> It's a lot of work, and I haven't been able to complete it yet.
>> (there is also very little demand for such a thing, it seems...)
> 
> I must say I have no idea how many people are using old versions of Mac OS.
> Another option might be to supply an entire new toolchain. Or was the 
> ABI changed before the first version of GCC that GDC supports?

It is theoretically possible to build with the GCC 4.0 and deploy
on Mac OS X 10.3.9 (latest) which does have the newer GCC runtime.

But in practice you run into some issues, so I normally use 3.3.

>> I think David has deprecated GCC 3.3 for GDC in general, as well.
> 
> Well, it *is* pretty old by now. 3.4 has been out for almost 3 years 
> now, and 4.0 was almost 2 years ago. (Though IIRC 4.0.0 was buggy at 
> first...)
> [Reference: http://gcc.gnu.org/releases.html]

Tiger was also out almost two years ago, it was also buggy at first.

We've already given up on support for older platforms that C/C++
supports, like Mac OS 9 or Mac OS X 10.1, so might drop 10.3 too ?

After all, soon it will be all about Mac OS X 10.5 (or Vista :-P).

>> And DMD doesn't have any support for Mac, just Windows and linux.
> 
> Aside: that's all I've ever needed :).
> 
> Though I can definitely understand people on macs might not like that...

It's a problem, since what DMD doesn't support doesn't go in the spec.
Maybe GDC should have a separate spec, for the portable version of D ?

I just wondered if a D without fully working templates is still a D...
Of if it is more of a "platform quirk", like reals or string constants.

--anders



More information about the Digitalmars-d mailing list