builtin sort

Stephan Schiffels stephan_schiffels at mac.com
Mon Jun 10 02:03:36 PDT 2013


On Saturday, 8 June 2013 at 22:51:06 UTC, bearophile wrote:
> Peter Williams:
>
>> Rather than deprecate it why not fix it?  Shouldn't have to 
>> import std.algorithm just to sort an array.
>
> Generally you want to keep the compiler (all its layers) as 
> simpler as possible, to make it simpler to compile, debug and 
> develop. A sort is implementable very well in library code. 
> Other things, like tuples with a good syntax maybe can't be 
> implemented well in library code, so they should be in the 
> compiler :)
>
> I suggest to kill the built-in sort ASAP.
>
> Bye,
> bearophile

I agree. Do people have the same opinion on the builtin reverse? 
I don't remember whether there was a discussion about this. I 
suggest to kill that as well. sort and reverse are perfectly well 
implemented in the standard library rather than builtin.

Is anyone actually on this? I could try to dig into it, I guess I 
could start looking for spurious places in phobos and druntime 
where these builtin functions are used and replace them with the 
library ones. If we deprecate it in the end we don't want to see 
it being used anywhere in the standard implementations.

Stephan



More information about the Digitalmars-d mailing list