February 12, 2014
On Wednesday, 12 February 2014 at 14:15:55 UTC, Manu wrote:
> On 12 February 2014 16:11, eles <eles@eles.com> wrote:
>
>> On Wednesday, 12 February 2014 at 03:28:57 UTC, Manu wrote:
>>
>>> On 12 February 2014 12:11, Manu <turkeyman@gmail.com> wrote:
>>>
>>>  On 12 February 2014 05:43, Walter Bright <newshound2@digitalmars.com>
>>>> wrote:
>>>>
>>>>
>>
>>> I've changed my mind. Depending on a functional link-stripper sucks.
>>> I think it's definitely useful, although I think it should be implemented
>>> as a suite of flags, not just a single one. Sure, a convenience flag can
>>> be
>>> offered, but as an implementation detail, it should be a suite of flags.
>>>
>>
>> I like this and I also think providing compiler switches (ie. without
>> naming the subset) as being acceptable.
>>
>> However, what if I would need those switches for just one particular
>> module and the functions therein? How to compile only those modules with
>> the switches?
>>
>> Only through manual compile/linking?
>>
>
> Yes, exactly as with C++ today. It shouldn't be an unfamiliar problem to
> most.

How does that work with templates across modules?
February 12, 2014
On 13 February 2014 00:25, John Colvin <john.loughran.colvin@gmail.com>wrote:

> On Wednesday, 12 February 2014 at 14:15:55 UTC, Manu wrote:
>
>> On 12 February 2014 16:11, eles <eles@eles.com> wrote:
>>
>>  On Wednesday, 12 February 2014 at 03:28:57 UTC, Manu wrote:
>>>
>>>  On 12 February 2014 12:11, Manu <turkeyman@gmail.com> wrote:
>>>>
>>>>  On 12 February 2014 05:43, Walter Bright <newshound2@digitalmars.com>
>>>>
>>>>> wrote:
>>>>>
>>>>>
>>>>>
>>>  I've changed my mind. Depending on a functional link-stripper sucks.
>>>> I think it's definitely useful, although I think it should be
>>>> implemented
>>>> as a suite of flags, not just a single one. Sure, a convenience flag can
>>>> be
>>>> offered, but as an implementation detail, it should be a suite of flags.
>>>>
>>>>
>>> I like this and I also think providing compiler switches (ie. without naming the subset) as being acceptable.
>>>
>>> However, what if I would need those switches for just one particular module and the functions therein? How to compile only those modules with the switches?
>>>
>>> Only through manual compile/linking?
>>>
>>>
>> Yes, exactly as with C++ today. It shouldn't be an unfamiliar problem to most.
>>
>
> How does that work with templates across modules?
>

I'm not sure how that would affect anything? Only a couple of runtime things would be unavailable, and ideally individually unavailable on different flags.


February 12, 2014
On Wednesday, 12 February 2014 at 14:36:21 UTC, Manu wrote:
> On 13 February 2014 00:25, John Colvin <john.loughran.colvin@gmail.com>wrote:
>
>> On Wednesday, 12 February 2014 at 14:15:55 UTC, Manu wrote:
>>
>>> On 12 February 2014 16:11, eles <eles@eles.com> wrote:
>>>
>>>  On Wednesday, 12 February 2014 at 03:28:57 UTC, Manu wrote:
>>>>
>>>>  On 12 February 2014 12:11, Manu <turkeyman@gmail.com> wrote:
>>>>>
>>>>>  On 12 February 2014 05:43, Walter Bright <newshound2@digitalmars.com>
>>>>>
>>>>>> wrote:
>>>>>>
>>>>>>
>>>>>>
>>>>  I've changed my mind. Depending on a functional link-stripper sucks.
>>>>> I think it's definitely useful, although I think it should be
>>>>> implemented
>>>>> as a suite of flags, not just a single one. Sure, a convenience flag can
>>>>> be
>>>>> offered, but as an implementation detail, it should be a suite of flags.
>>>>>
>>>>>
>>>> I like this and I also think providing compiler switches (ie. without
>>>> naming the subset) as being acceptable.
>>>>
>>>> However, what if I would need those switches for just one particular
>>>> module and the functions therein? How to compile only those modules with
>>>> the switches?
>>>>
>>>> Only through manual compile/linking?
>>>>
>>>>
>>> Yes, exactly as with C++ today. It shouldn't be an unfamiliar problem to
>>> most.
>>>
>>
>> How does that work with templates across modules?
>>
>
> I'm not sure how that would affect anything? Only a couple of runtime
> things would be unavailable, and ideally individually unavailable on
> different flags.

What I mean is: template in module A that needs one of these flags is instantiated from module B that needs to *not* have that flag.
February 12, 2014
Am Wed, 12 Feb 2014 14:37:53 +0000
schrieb "John Colvin" <john.loughran.colvin@gmail.com>:

> 
> What I mean is: template in module A that needs one of these flags is instantiated from module B that needs to *not* have that flag.

The template is emitted to the object file of module B, so only the flags used with B matter and as long as 'these flags' are a strict subset, it's always possible to use the same code in standard D.

(It is kinda important that we produce the same code in both cases though - otherwise weird things can happen if the linker merges template instances)
February 12, 2014
This would certainly be a useful feature to have when porting, and Walter clearly uses it himself.  Assuming this can be done with minimal work, I'd say make it a DMD thing rather than a D thing in general.  Like -profile.  And add a switch to enable it in the front-end if possible.  Then DMD (and potentially the other compilers) will have the feature in case anyone finds it useful and we can move on.  Call it -minimal.

I have a feeling we've already spent more time talking about this than Walter would have spent implementing it anyway, so it's already taking time away from other things.  Let's just give it a nod and move on.
February 12, 2014
On 2/12/14, 12:34 AM, Daniel Murphy wrote:
> The thing is, we do almost have it, because it's not a huge thing to
> implement.  Low hanging fruit vs long-term priorities.

There's this thing in psychology - when confronted with too many unprioritized tasks, people will consistently choose the easiest ones.

Andrei

February 12, 2014
On Wednesday, 12 February 2014 at 15:40:54 UTC, Sean Kelly wrote:
> This would certainly be a useful feature to have when porting, and Walter clearly uses it himself.  Assuming this can be done with minimal work, I'd say make it a DMD thing rather than a D thing in general.  Like -profile.  And add a switch to enable it in the front-end if possible.  Then DMD (and potentially the other compilers) will have the feature in case anyone finds it useful and we can move on.  Call it -minimal.

Good compiler flag name choice.

> I have a feeling we've already spent more time talking about this than Walter would have spent implementing it anyway, so it's already taking time away from other things.  Let's just give it a nod and move on.

By 'nod' you mean Bugzilla entry, right? The flag would have to be documented. While "better C" is descriptive, it's not very helpful.

I like the idea a lot. If it's truly low hanging fruit, then yeah it should be done, but I get the concerns that others have about D and unfinished business. Tough decision!

February 12, 2014
On 2/12/14, 7:40 AM, Sean Kelly wrote:
> This would certainly be a useful feature to have when porting, and
> Walter clearly uses it himself.  Assuming this can be done with minimal
> work, I'd say make it a DMD thing rather than a D thing in general.
> Like -profile.  And add a switch to enable it in the front-end if
> possible.  Then DMD (and potentially the other compilers) will have the
> feature in case anyone finds it useful and we can move on.  Call it
> -minimal.
>
> I have a feeling we've already spent more time talking about this than
> Walter would have spent implementing it anyway, so it's already taking
> time away from other things.  Let's just give it a nod and move on.

I convinced Walter of my view on this, so he won't work on it. I trust that at least between the two of us we can focus on working on what matters most first.

Andrei

February 12, 2014
On Wednesday, 12 February 2014 at 16:30:29 UTC, Andrei Alexandrescu wrote:
> On 2/12/14, 7:40 AM, Sean Kelly wrote:
>> This would certainly be a useful feature to have when porting, and
>> Walter clearly uses it himself.  Assuming this can be done with minimal
>> work, I'd say make it a DMD thing rather than a D thing in general.
>> Like -profile.  And add a switch to enable it in the front-end if
>> possible.  Then DMD (and potentially the other compilers) will have the
>> feature in case anyone finds it useful and we can move on.  Call it
>> -minimal.
>>
>> I have a feeling we've already spent more time talking about this than
>> Walter would have spent implementing it anyway, so it's already taking
>> time away from other things.  Let's just give it a nod and move on.
>
> I convinced Walter of my view on this, so he won't work on it. I trust that at least between the two of us we can focus on working on what matters most first.
>
> Andrei

But keep -minimal in mind. A good idea, both the concept and the flag name.
February 12, 2014
On 02/11/2014 02:43 PM, Walter Bright wrote:
> I've toyed with this idea for a while, and wondered what the interest
> there is in something like this.
>
> The idea is to be able to use a subset of D that does not require any of
> druntime or phobos - it can be linked merely with the C standard
> library. To that end, there'd be a compiler switch (-betterC) which
> would enforce the subset.
>
> (First off, I hate the name "better C", any suggestions?)

A new switch?
-OnlyC

A new language?
CD