June 23, 2015
On Tuesday, 23 June 2015 at 17:53:43 UTC, John Colvin wrote:
> Isn't this what selective imports are for? Admittedly it's not quite as convenient, but it does let you choose exactly what you want. You can even make a module that wraps a manually selected set of imports, e.g. you do your own basic_types module.
>
> In the end, if you have specific requirements, you have to be specific.

Unfortunately, selective imports have been broken for 9 years.
June 23, 2015
On Tuesday, 23 June 2015 at 17:59:48 UTC, Meta wrote:
> On Tuesday, 23 June 2015 at 17:53:43 UTC, John Colvin wrote:
>> Isn't this what selective imports are for? Admittedly it's not quite as convenient, but it does let you choose exactly what you want. You can even make a module that wraps a manually selected set of imports, e.g. you do your own basic_types module.
>>
>> In the end, if you have specific requirements, you have to be specific.
>
> Unfortunately, selective imports have been broken for 9 years.

There is hope: https://github.com/D-Programming-Language/dmd/pull/3407
June 23, 2015
On 6/23/15 1:59 PM, Meta wrote:
> On Tuesday, 23 June 2015 at 17:53:43 UTC, John Colvin wrote:
>> Isn't this what selective imports are for? Admittedly it's not quite
>> as convenient, but it does let you choose exactly what you want. You
>> can even make a module that wraps a manually selected set of imports,
>> e.g. you do your own basic_types module.
>>
>> In the end, if you have specific requirements, you have to be specific.
>
> Unfortunately, selective imports have been broken for 9 years.

Even selective imports being fixed, the benefits in terms of separate compilation and encapsulation are worth it.

I agree with the idea to limit package.d to just public imports. I don't think it should be enforced by the compiler, but it should be something Phobos strives for and that we recommend.

-Steve

June 23, 2015
On Tuesday, 23 June 2015 at 17:53:43 UTC, John Colvin wrote:
> Isn't this what selective imports are for?

Not quite the same thing: selective imports control which symbols you pull into the current namespace, but not which code gets pulled into the binary.

If you do `import foo : bar;`, the compiler processes all of foo (consider that it has to, just to find the name), generating the object file for it, but only exposes the name `bar` to you.

With smaller basic modules, if you only import the foundation, the compiler only has to look at that small file and only has to include its contents in the object file.
June 23, 2015
Am 23.06.2015 um 16:58 schrieb Manu via Digitalmars-d:
> https://github.com/D-Programming-Language/phobos/pull/2845
>
> I'm getting quite happy with it.
> I think it's a good and fairly minimal but useful starting point.
>
> It'd be great to get some reviews from here.
>

From a quick glance, looks very nice! If there was channel swizzling and an underlying (low dimensional) vector type, I could use it more or less as a drop-in replacement in my code.

One thing that I was wondering if it wouldn't make more sense overall for the color string representation to use RGBA instead of ARGB. The former is a lot more common outside of 3D APIs/hardware and arguably more intuitive.
June 23, 2015
On Tuesday, 23 June 2015 at 14:58:35 UTC, Manu wrote:
> https://github.com/D-Programming-Language/phobos/pull/2845
>
> I'm getting quite happy with it.
> I think it's a good and fairly minimal but useful starting point.
>
> It'd be great to get some reviews from here.

Swizzels would be a nice addition.
June 23, 2015
On Tuesday, 23 June 2015 at 14:58:35 UTC, Manu wrote:

> It'd be great to get some reviews from here.

I would like to see the packed implementatiin finished before this is pulled, but I won't stand in its way.

Mike
June 24, 2015
They work fine. Just cast between color structs with different component orders:

BGR8 a = Color.white;
RGB8 b = a; // <- did swizzle

Is there a specific api you miss?


On 24 June 2015 at 05:34, Tofu Ninja via Digitalmars-d <digitalmars-d@puremagic.com> wrote:
> On Tuesday, 23 June 2015 at 14:58:35 UTC, Manu wrote:
>>
>> https://github.com/D-Programming-Language/phobos/pull/2845
>>
>> I'm getting quite happy with it.
>> I think it's a good and fairly minimal but useful starting point.
>>
>> It'd be great to get some reviews from here.
>
>
> Swizzels would be a nice addition.
June 24, 2015
On 24 June 2015 at 08:46, Mike via Digitalmars-d <digitalmars-d@puremagic.com> wrote:
> On Tuesday, 23 June 2015 at 14:58:35 UTC, Manu wrote:
>
>> It'd be great to get some reviews from here.
>
>
> I would like to see the packed implementatiin finished before this is pulled, but I won't stand in its way.

I just don't want to write all the others which will mirror this set of API decisions almost verbatim until the API is stabilised.
June 24, 2015
On Wednesday, 24 June 2015 at 04:48:28 UTC, Manu wrote:

> I just don't want to write all the others which will mirror this set of API decisions almost verbatim until the API is stabilised.

A wise decision.  I understand.