www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Is anyone hacking on druntime in a widespread fashion at the moment?

reply =?ISO-8859-1?Q?Alex_R=F8nne_Petersen?= <xtzgzorex gmail.com> writes:
I'm planning to go over druntime and add nothrow/pure everywhere I can, 
but I don't want to disturb anyone else who's currently working on 
patches that this could disrupt.

-- 
- Alex
Apr 10 2012
next sibling parent reply "H. S. Teoh" <hsteoh quickfur.ath.cx> writes:
On Wed, Apr 11, 2012 at 12:10:19AM +0200, Alex Rnne Petersen wrote:
 I'm planning to go over druntime and add nothrow/pure everywhere I
 can, but I don't want to disturb anyone else who's currently working
 on patches that this could disrupt.

Please do. The current lack of proper function qualifiers has been bugging me to no end, every time I try to do the same in my own code. I inevitably have to remove some qualifiers that should be there, just because of a single druntime construct that wasn't properly qualified. And while you're at it, you might want to consider const too. Last I looked, a whole bunch of stuff that should be const, isn't. And best of luck to you... the last time I tried to do the same thing I ended up changing almost the entire druntime, and still couldn't get the result to compile. T -- "I speak better English than this villain Bush" -- Mohammed Saeed al-Sahaf, Iraqi Minister of Information
Apr 10 2012
parent reply =?ISO-8859-1?Q?Alex_R=F8nne_Petersen?= <xtzgzorex gmail.com> writes:
On 11-04-2012 01:09, H. S. Teoh wrote:
 On Wed, Apr 11, 2012 at 12:10:19AM +0200, Alex Rnne Petersen wrote:
 I'm planning to go over druntime and add nothrow/pure everywhere I
 can, but I don't want to disturb anyone else who's currently working
 on patches that this could disrupt.

Please do. The current lack of proper function qualifiers has been bugging me to no end, every time I try to do the same in my own code. I inevitably have to remove some qualifiers that should be there, just because of a single druntime construct that wasn't properly qualified. And while you're at it, you might want to consider const too. Last I looked, a whole bunch of stuff that should be const, isn't. And best of luck to you... the last time I tried to do the same thing I ended up changing almost the entire druntime, and still couldn't get the result to compile. T

Yeah, I've made several attempts in the past without much luck... Hopefully I'll get there at some point. So, I won't disrupt your AA hacking by doing this? -- - Alex
Apr 10 2012
parent =?ISO-8859-1?Q?Alex_R=F8nne_Petersen?= <xtzgzorex gmail.com> writes:
On 11-04-2012 01:29, H. S. Teoh wrote:
 On Wed, Apr 11, 2012 at 01:09:48AM +0200, Alex Rnne Petersen wrote:
 On 11-04-2012 01:09, H. S. Teoh wrote:
 On Wed, Apr 11, 2012 at 12:10:19AM +0200, Alex Rnne Petersen wrote:
 I'm planning to go over druntime and add nothrow/pure everywhere I
 can, but I don't want to disturb anyone else who's currently working
 on patches that this could disrupt.

Please do. The current lack of proper function qualifiers has been bugging me to no end, every time I try to do the same in my own code. I inevitably have to remove some qualifiers that should be there, just because of a single druntime construct that wasn't properly qualified. And while you're at it, you might want to consider const too. Last I looked, a whole bunch of stuff that should be const, isn't. And best of luck to you... the last time I tried to do the same thing I ended up changing almost the entire druntime, and still couldn't get the result to compile. T

Yeah, I've made several attempts in the past without much luck... Hopefully I'll get there at some point. So, I won't disrupt your AA hacking by doing this?

No, I'm doing the new AA as a completely separate struct for now. I won't be touching druntime until the AA code itself is more-or-less completed. Once that's done, it should be just a matter of copy-n-pasting into object_.d with some minor changes (plus what's anticipated to be very painful dmd changes, from what people have been telling me :-P). In fact, if druntime stuff is properly marked, I'll be able to uncomment a few more qualifiers in the AA code that currently can't work 'cos of druntime's brokenness. T

Excellent. I'll get to it then. :) -- - Alex
Apr 10 2012
prev sibling next sibling parent reply Kevin Cox <kevincox.ca gmail.com> writes:
--0015175d07bc0a11c404bd5b4056
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

On Apr 10, 2012 7:08 PM, "H. S. Teoh" <hsteoh quickfur.ath.cx> wrote:
 On Wed, Apr 11, 2012 at 12:10:19AM +0200, Alex R=C3=B8nne Petersen wrote:
 I'm planning to go over druntime and add nothrow/pure everywhere I
 can, but I don't want to disturb anyone else who's currently working
 on patches that this could disrupt.

Please do. The current lack of proper function qualifiers has been bugging me to no end, every time I try to do the same in my own code. I inevitably have to remove some qualifiers that should be there, just because of a single druntime construct that wasn't properly qualified. And while you're at it, you might want to consider const too. Last I looked, a whole bunch of stuff that should be const, isn't. And best of luck to you... the last time I tried to do the same thing I ended up changing almost the entire druntime, and still couldn't get the result to compile. T -- "I speak better English than this villain Bush" -- Mohammed Saeed

I was wondering why they could not be implied from the code itself. --0015175d07bc0a11c404bd5b4056 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable <p><br> On Apr 10, 2012 7:08 PM, &quot;H. S. Teoh&quot; &lt;<a href=3D"mailto:hsteo= h quickfur.ath.cx">hsteoh quickfur.ath.cx</a>&gt; wrote:<br> &gt;<br> &gt; On Wed, Apr 11, 2012 at 12:10:19AM +0200, Alex R=C3=B8nne Petersen wro= te:<br> &gt; &gt; I&#39;m planning to go over druntime and add nothrow/pure everywh= ere I<br> &gt; &gt; can, but I don&#39;t want to disturb anyone else who&#39;s curren= tly working<br> &gt; &gt; on patches that this could disrupt.<br> &gt; [...]<br> &gt;<br> &gt; Please do. The current lack of proper function qualifiers has been<br> &gt; bugging me to no end, every time I try to do the same in my own code. = I<br> &gt; inevitably have to remove some qualifiers that should be there, just<b= r> &gt; because of a single druntime construct that wasn&#39;t properly qualif= ied.<br> &gt;<br> &gt; And while you&#39;re at it, you might want to consider const too. Last= I<br> &gt; looked, a whole bunch of stuff that should be const, isn&#39;t.<br> &gt;<br> &gt; And best of luck to you... the last time I tried to do the same thing = I<br> &gt; ended up changing almost the entire druntime, and still couldn&#39;t g= et the<br> &gt; result to compile.<br> &gt;<br> &gt;<br> &gt; T<br> &gt;<br> &gt; --<br> &gt; &quot;I speak better English than this villain Bush&quot; -- Mohammed = Saeed al-Sahaf, Iraqi Minister of Information</p> <p>I was wondering why they could not be implied from the code itself.<br> </p> --0015175d07bc0a11c404bd5b4056--
Apr 10 2012
parent "Nick Sabalausky" <SeeWebsiteToContactMe semitwist.com> writes:
"Kevin Cox" <kevincox.ca gmail.com> wrote in message 
news:mailman.1599.1334099575.4860.digitalmars-d puremagic.com...
I was wondering why they could not be implied from the code itself.

That question comes up a lot. The thing is, that would completely defeat the point. The point is that you want the compiler to *guarantee* that certain specific functions are pure/ safe/const/nothrow, etc. If you make a change that prevents a function from being pure/ safe/const/nothrow, and the compiler just simply accepted it and internally considered it non-pure/non-whatever, then you haven't gained anything at all. It'd be no different from not even having any pure/ safe/const/nothrow system in the first place. At *best* it would just be a few optimizations here and there. But if the compiler tells you, "Hey, you said you wanted this function to be pure/whatever, but you're doing X which prevents that", then you can actually *fix* the problem and go make it pure/whatever.
Apr 11 2012
prev sibling next sibling parent "H. S. Teoh" <hsteoh quickfur.ath.cx> writes:
On Wed, Apr 11, 2012 at 01:09:48AM +0200, Alex Rnne Petersen wrote:
 On 11-04-2012 01:09, H. S. Teoh wrote:
On Wed, Apr 11, 2012 at 12:10:19AM +0200, Alex Rnne Petersen wrote:
I'm planning to go over druntime and add nothrow/pure everywhere I
can, but I don't want to disturb anyone else who's currently working
on patches that this could disrupt.

Please do. The current lack of proper function qualifiers has been bugging me to no end, every time I try to do the same in my own code. I inevitably have to remove some qualifiers that should be there, just because of a single druntime construct that wasn't properly qualified. And while you're at it, you might want to consider const too. Last I looked, a whole bunch of stuff that should be const, isn't. And best of luck to you... the last time I tried to do the same thing I ended up changing almost the entire druntime, and still couldn't get the result to compile. T

Yeah, I've made several attempts in the past without much luck... Hopefully I'll get there at some point. So, I won't disrupt your AA hacking by doing this?

No, I'm doing the new AA as a completely separate struct for now. I won't be touching druntime until the AA code itself is more-or-less completed. Once that's done, it should be just a matter of copy-n-pasting into object_.d with some minor changes (plus what's anticipated to be very painful dmd changes, from what people have been telling me :-P). In fact, if druntime stuff is properly marked, I'll be able to uncomment a few more qualifiers in the AA code that currently can't work 'cos of druntime's brokenness. T -- Long, long ago, the ancient Chinese invented a device that lets them see through walls. It was called the "window".
Apr 10 2012
prev sibling next sibling parent reply deadalnix <deadalnix gmail.com> writes:
Le 11/04/2012 00:10, Alex Rnne Petersen a crit :
 I'm planning to go over druntime and add nothrow/pure everywhere I can,
 but I don't want to disturb anyone else who's currently working on
 patches that this could disrupt.

Can't we consider this as an inference issue ?
Apr 11 2012
parent reply "Jonathan M Davis" <jmdavisProg gmx.com> writes:
On Wednesday, April 11, 2012 22:01:36 deadalnix wrote:
 Le 11/04/2012 00:10, Alex Rønne Petersen a écrit :
 I'm planning to go over druntime and add nothrow/pure everywhere I can,
 but I don't want to disturb anyone else who's currently working on
 patches that this could disrupt.

Can't we consider this as an inference issue ?

How so? Attribute inference exists only for templated functions and some delegate stuff. We're talking primarily about extern(C) function declarations here. - Jonathan M Davis
Apr 11 2012
parent deadalnix <deadalnix gmail.com> writes:
Le 11/04/2012 22:41, Jonathan M Davis a écrit :
 On Wednesday, April 11, 2012 22:01:36 deadalnix wrote:
 Le 11/04/2012 00:10, Alex Rønne Petersen a écrit :
 I'm planning to go over druntime and add nothrow/pure everywhere I can,
 but I don't want to disturb anyone else who's currently working on
 patches that this could disrupt.

Can't we consider this as an inference issue ?

How so? Attribute inference exists only for templated functions and some delegate stuff. We're talking primarily about extern(C) function declarations here. - Jonathan M Davis

As long as the function body is available, inference is possible. If it is possible, it is legitimate to wonder if the problem come from the fact that it isn't done, or that it isn't explicit in the source code.
Apr 14 2012
prev sibling next sibling parent Kevin Cox <kevincox.ca gmail.com> writes:
--00151761c8c4756dd404bd6ce9aa
Content-Type: text/plain; charset=UTF-8

On Apr 11, 2012 4:14 PM, "Nick Sabalausky" <
SeeWebsiteToContactMe semitwist.com> wrote:
 "Kevin Cox" <kevincox.ca gmail.com> wrote in message
 news:mailman.1599.1334099575.4860.digitalmars-d puremagic.com...
I was wondering why they could not be implied from the code itself.

That question comes up a lot. The thing is, that would completely defeat

 point. The point is that you want the compiler to *guarantee* that certain
 specific functions are pure/ safe/const/nothrow, etc.

 If you make a change that prevents a function from being
 pure/ safe/const/nothrow, and the compiler just simply accepted it and
 internally considered it non-pure/non-whatever, then you haven't gained
 anything at all. It'd be no different from not even having any
 pure/ safe/const/nothrow system in the first place. At *best* it would

 be a few optimizations here and there.

 But if the compiler tells you, "Hey, you said you wanted this function to

 pure/whatever, but you're doing X which prevents that", then you can
 actually *fix* the problem and go make it pure/whatever.

Makes sense. --00151761c8c4756dd404bd6ce9aa Content-Type: text/html; charset=UTF-8 <p><br> On Apr 11, 2012 4:14 PM, &quot;Nick Sabalausky&quot; &lt;<a href="mailto:SeeWebsiteToContactMe semitwist.com">SeeWebsiteToContactMe s mitwist.com</a>&gt; wrote:<br> &gt;<br> &gt; &quot;Kevin Cox&quot; &lt;<a href="mailto:kevincox.ca gmail.com">kevincox.ca gmail.com</a>&gt; wrote in message<br> &gt; news:mailman.1599.1334099575.4860.digitalmars-d puremagic.com...<br> &gt; &gt;<br> &gt; &gt;I was wondering why they could not be implied from the code itself.<br> &gt;<br> &gt; That question comes up a lot. The thing is, that would completely defeat the<br> &gt; point. The point is that you want the compiler to *guarantee* that certain<br> &gt; specific functions are pure/ safe/const/nothrow, etc.<br> &gt;<br> &gt; If you make a change that prevents a function from being<br> &gt; pure/ safe/const/nothrow, and the compiler just simply accepted it and<br> &gt; internally considered it non-pure/non-whatever, then you haven&#39;t gained<br> &gt; anything at all. It&#39;d be no different from not even having any<br> &gt; pure/ safe/const/nothrow system in the first place. At *best* it would just<br> &gt; be a few optimizations here and there.<br> &gt;<br> &gt; But if the compiler tells you, &quot;Hey, you said you wanted this function to be<br> &gt; pure/whatever, but you&#39;re doing X which prevents that&quot;, then you can<br> &gt; actually *fix* the problem and go make it pure/whatever.<br> &gt;</p> <p>Makes sense.<br> </p> --00151761c8c4756dd404bd6ce9aa--
Apr 11 2012
prev sibling next sibling parent reply James Miller <james aatch.net> writes:
* Nick Sabalausky <SeeWebsiteToContactMe semitwist.com> [2012-04-11 16:08:05
-0400]:
 "Kevin Cox" <kevincox.ca gmail.com> wrote in message 
 news:mailman.1599.1334099575.4860.digitalmars-d puremagic.com...
I was wondering why they could not be implied from the code itself.

That question comes up a lot. The thing is, that would completely defeat the point. The point is that you want the compiler to *guarantee* that certain specific functions are pure/ safe/const/nothrow, etc. If you make a change that prevents a function from being pure/ safe/const/nothrow, and the compiler just simply accepted it and internally considered it non-pure/non-whatever, then you haven't gained anything at all. It'd be no different from not even having any pure/ safe/const/nothrow system in the first place. At *best* it would just be a few optimizations here and there. But if the compiler tells you, "Hey, you said you wanted this function to be pure/whatever, but you're doing X which prevents that", then you can actually *fix* the problem and go make it pure/whatever.

At any rate, inference would probably end up being more trouble than its worth, or as you said, useless. Me: "I know this function can throw" Compiler: "But I don't think so, so I'm gonna mark it nothrow" Me: "No! You idiot!" Compiler: "Herp-Derp, code-breaking optimization based on incorrect assumptions" Me: "FUUUUUUUUUU...." I don't trust computers, I've spent too long programming to think that they can get anything right. -- James Miller
Apr 11 2012
parent "Nick Sabalausky" <SeeWebsiteToContactMe semitwist.com> writes:
"James Miller" <james aatch.net> wrote in message 
news:mailman.1640.1334189880.4860.digitalmars-d puremagic.com...
 I don't trust computers, I've spent too long programming to think that
 they can get anything right.

Quote of the year, right there. while(true) vote++; I need that on a T-Shirt, or tattooed somewhere, or something.
Apr 11 2012
prev sibling next sibling parent "H. S. Teoh" <hsteoh quickfur.ath.cx> writes:
On Thu, Apr 12, 2012 at 12:59:06AM -0400, Nick Sabalausky wrote:
 "James Miller" <james aatch.net> wrote in message 
 news:mailman.1640.1334189880.4860.digitalmars-d puremagic.com...
 I don't trust computers, I've spent too long programming to think that
 they can get anything right.

Quote of the year, right there. while(true) vote++; I need that on a T-Shirt, or tattooed somewhere, or something.

I'm stealing that quote for my quotes file. :-) T -- Береги платье снову, а здоровье смолоду.
Apr 11 2012
prev sibling next sibling parent James Miller <james aatch.net> writes:
* H. S. Teoh <hsteoh quickfur.ath.cx> [2012-04-11 22:28:32 -0700]:
 On Thu, Apr 12, 2012 at 12:59:06AM -0400, Nick Sabalausky wrote:
 "James Miller" <james aatch.net> wrote in message 
 news:mailman.1640.1334189880.4860.digitalmars-d puremagic.com...
 I don't trust computers, I've spent too long programming to think that
 they can get anything right.

Quote of the year, right there. while(true) vote++; I need that on a T-Shirt, or tattooed somewhere, or something.

I'm stealing that quote for my quotes file. :-)

I am honored sir. -- James Miller
Apr 11 2012
prev sibling parent Jonathan M Davis <jmdavisProg gmx.com> writes:
On Saturday, April 14, 2012 15:24:14 deadalnix wrote:
 Le 11/04/2012 22:41, Jonathan M Davis a =C3=A9crit :
 On Wednesday, April 11, 2012 22:01:36 deadalnix wrote:
 Le 11/04/2012 00:10, Alex R=C3=B8nne Petersen a =C3=A9crit :
 I'm planning to go over druntime and add nothrow/pure everywhere =




 but I don't want to disturb anyone else who's currently working o=




 patches that this could disrupt.

Can't we consider this as an inference issue ?

How so? Attribute inference exists only for templated functions and=


 delegate stuff. We're talking primarily about extern(C) function
 declarations here.
=20
 - Jonathan M Davis

As long as the function body is available, inference is possible. If =

 is possible, it is legitimate to wonder if the problem come from the
 fact that it isn't done, or that it isn't explicit in the source code=

But it doesn't work that way, and if it did, the signature of the funct= ion=20 could change depending on whether you were using a .di or .d file when=20= importing. D takes the tact that it's better to require that the progra= mmer=20 mark functions as pure - particularly in a language where it's possible= to=20 have function declarations with no definitions (it's also easier on the= =20 compiler). Attribute inference was only added with templates, because w= ithout=20 it, you'd have to duplicate the template for all of the combinations of= =20 nothrow, pure, and safe, which was untenable. Also, if you're talking about C functions, you _can't_ have the source = code.=20 Again, druntime is a prime example of that. Even if the language had at= tribute=20 inference for all functions, you'd still have to explictly mark C funct= ions as=20 pure for them to be pure, because the compiler doesn't have their sourc= e. - Jonathan M Davis
Apr 14 2012