[phobos] Time to get ready for the next release

Rainer Schuetze r.sagitario at gmx.de
Fri Apr 22 06:26:20 PDT 2011


Don Clugston wrote:
> It's now been two months since the last release, and there have been
> huge compiler improvements.
> Note also that there were a couple of very bad regressions in 2.052,
> so I think we really need a release ASAP.
> We've now achieved minimal stability again (all green on the auto-tester).
> 
> Here's the things which are blockers for the next release:
> 
> From the compiler side:
> * struct destruction of temporaries (seems like we have a chance of
> fixing this soon)
> * fixing the regressions from my CTFE/const folding changes (Fixes are
> here: https://github.com/D-Programming-Language/dmd/pull/37).
> * a few things haven't been backported to D1 yet
> druntime:
> * clean up Windows DLL support
> phobos:
> * nothing that I know of
> 
> Looks as though will be time to get std.parallelism in. But otherwise,
> if you have anything you'd like to get into the next release, please
> indicate so now.

Compiling the latest and greatest from github, I noticed a few things, 
most of them changes that broke existing code, good or bad.

- std.net.isemail does not seem to be compiled into the libary on 
windows. If it is, a debug compile fails because dmd stumbles over 
generating debug information for a string enum. Here's a patch that 
simply skips writing the enum fields, the type information is marked as 
incomplete anyway.

https://github.com/rainers/dmd/commit/9d69feb17f075757c9e6874f64b201fa2f40d5b0

- const string[] can no longer be passed to functions expecting string[] 
argument

This is correct, but very strict. The array pointer and length of the 
argument could be modifiable, but the data elements pointed to should 
not. unfortunately, there is no type to express that. (Would 
const(string[])ref do that?)

- variables of type string no longer implicitely cast to const(char)*

I'm fine with this change.

- const string values no longer accepted in switch-case, you have to use 
enum string.

I'm not so sure about this. You might want to use the same string 
elsewhere, too, so you will have to define it twice, once for switch 
statements with enum, and once for other runtime purposes e.g. taken the 
address of the string.

- struct initializers using {} are no longer evaluated at runtime? the 
compiler complains that the initializers do not evaluate at compile time.

I'm fine with replacing these with the Struct(args) syntax, but AFAIK it 
does not allow direct initializing of static arrays in the struct, you 
have to pass a dynamically created array literal. In my case I also 
needed to add an ugly cast(ubyte[]) to the argument, because [0,0] is 
interpreted as an array of integers.

- std.parallelism.atomicIncUint no longer compiles, because there seem 
to be stronger checks regarding shared. Seems good to me.

- the deprecation of octal numbers revealed an error in the Windows SDK 
header files (v6.0A, I haven't yet checked if it is fixed in newer 
versions).

With all these issues fixed, Visual D seems to compile and run fine. All 
changes are backward compatible, so I can still switch back to dmd 2.052.

Rainer


More information about the phobos mailing list