www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - *sigh*

reply Caligo <iteronvexor gmail.com> writes:
--14dae9ccd4ec029bac04b50e3939
Content-Type: text/plain; charset=ISO-8859-1

At the moment I don't see how anything serious can be done with D.  In the
past few weeks, while working on a _toy_ project, I've encountered several
bugs that have caused a lot of problems and wasted a lot of time.  Sorry,
but it's just frustrating.  it's gotten to the point where I have to rum
DMD every time I add/modify 10 lines of code just to make sure the compiler
doesn't die.

Two of the bugs were causing 'internal errors', but I never managed to
isolate the issue so that I could bug report them.  I can't reproduce them
outside of my project, but at the moment I have managed to not have them
get triggered.  I also use GDC-4.6, which sometimes performs better.

*sigh*
Now that I got that off my chest...

I need to figure out what this is because I can't compile my code anymore,
and I get this:

  dmd: glue.c:1065: virtual unsigned int Type::totym(): Assertion `0'
failed.
  Aborted

I don't want to spend hours shuffling code around to find out what's
causing it :(

--14dae9ccd4ec029bac04b50e3939
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

At the moment I don&#39;t see how anything serious can be done with D.=A0 I=
n the past few weeks, while working on a _toy_ project, I&#39;ve encountere=
d several bugs that have caused a lot of problems and wasted a lot of time.=
=A0 Sorry, but it&#39;s just frustrating.=A0 it&#39;s gotten to the point w=
here I have to rum DMD every time I add/modify 10 lines of code just to mak=
e sure the compiler doesn&#39;t die.<br>
<br>Two of the bugs were causing &#39;internal errors&#39;, but I never man=
aged to isolate the issue so that I could bug report them.=A0 I can&#39;t r=
eproduce them outside of my project, but at the moment I have managed to no=
t have them get triggered.=A0 I also use GDC-4.6, which sometimes performs =
better.<br>
<br>*sigh*<br>Now that I got that off my chest...<br><br>I need to figure o=
ut what this is because I can&#39;t compile my code anymore, and I get this=
:<br><br>=A0 dmd: glue.c:1065: virtual unsigned int Type::totym(): Assertio=
n `0&#39; failed.<br>
=A0 Aborted<br><br>I don&#39;t want to spend hours shuffling code around to=
 find out what&#39;s causing it :(<br>

--14dae9ccd4ec029bac04b50e3939--
Dec 26 2011
next sibling parent deadalnix <deadalnix gmail.com> writes:
Le 27/12/2011 08:56, Caligo a écrit :
 At the moment I don't see how anything serious can be done with D.  In
 the past few weeks, while working on a _toy_ project, I've encountered
 several bugs that have caused a lot of problems and wasted a lot of
 time.  Sorry, but it's just frustrating.  it's gotten to the point where
 I have to rum DMD every time I add/modify 10 lines of code just to make
 sure the compiler doesn't die.

I would say that this is a good practice, bugguy compiler or not. If you test often, you spot errors earlier, and can fix them earlier. And the earlier you do so, the easier it is.
Dec 27 2011
prev sibling next sibling parent reply Andrei Alexandrescu <SeeWebsiteForEmail erdani.org> writes:
On 12/27/11 1:56 AM, Caligo wrote:
 At the moment I don't see how anything serious can be done with D. In
 the past few weeks, while working on a _toy_ project, I've
 encountered several bugs that have caused a lot of problems and
 wasted a lot of time.  Sorry, but it's just frustrating.  it's
 gotten to the point where I have to rum DMD every time I add/modify
 10 lines of code just to make sure the compiler doesn't die.

 Two of the bugs were causing 'internal errors', but I never managed
 to isolate the issue so that I could bug report them.  I can't
 reproduce them outside of my project, but at the moment I have
 managed to not have them get triggered.  I also use GDC-4.6, which
 sometimes performs better.

 *sigh*

The way I see it is, you are a customer (and one who has had enough faith to hang around for a while), so your issues should be given priority. We can and we should improve quality in the abstract, but at the end of the day it's about the human beings who are using the language. ---------------------------8<------------------------------8<--------------------------------------------------
 struct A{

 A opBinary(string op)(const ref A a){ A rt; return rt; }

 void fun(){ } }

 struct B{

 A _a; alias _a this; }


 void main(){

 B b1, b2, b3; b3 = (b1 - b2).fun(); }

 Which causes:

 dmd: glue.c:1065: virtual unsigned int Type::totym(): Assertion `0'
 failed. Aborted

 DMD 2.57, 64-bit.

Let me make a couple of points about this code. (To be clear, neither justifies the presence of an internal compiler error.) First, you are returning a reference to a local. That is automatically suspicious, although I assume this is reduced code from something meaningful. Second, you are exploring a territory that is hardly accessible with other languages - operator overloading with consolidated implementation in conjunction with subtyping. That means it's not run-of-the-mill stuff the compiler is failing with, it's stuff that you would need to abandon wholesale if you switched languages. Again, that's not a justification for the code not working with a meaningless error message. I want to warn against the paradoxical "I can't get creative use of feature X working, therefore I'm going back to my old language where I can't even think of X." That _all_ being said, creative use of creative D features is a prime attraction factor of D and we must have them down perfectly. As I mentioned once, very often the first use of D by newcomers is not some shit task; shit tasks can be done in any language. It's some difficult task that D features promise a miraculous solution for, one that would be quite hard to achieve with other languages. Andrei
Dec 27 2011
next sibling parent reply deadalnix <deadalnix gmail.com> writes:
Le 27/12/2011 16:25, Andrei Alexandrescu a écrit :
 Again, that's not a justification for the code not working with a
 meaningless error message. I want to warn against the paradoxical "I
 can't get creative use of feature X working, therefore I'm going back to
 my old language where I can't even think of X."

That is correct. But you have to consider some side element of the language : IDE support, toolchain, etc . . . So if you can't use advaned feature of D, it is rationnal to go back to java/C++/whatever that have a way better IDE support and toolchain.
Dec 27 2011
parent =?ISO-8859-1?Q?Alex_R=F8nne_Petersen?= <xtzgzorex gmail.com> writes:
On 27-12-2011 17:14, deadalnix wrote:
 Le 27/12/2011 16:25, Andrei Alexandrescu a écrit :
 Again, that's not a justification for the code not working with a
 meaningless error message. I want to warn against the paradoxical "I
 can't get creative use of feature X working, therefore I'm going back to
 my old language where I can't even think of X."

That is correct. But you have to consider some side element of the language : IDE support, toolchain, etc . . . So if you can't use advaned feature of D, it is rationnal to go back to java/C++/whatever that have a way better IDE support and toolchain.

I think with Mono-D and Visual D, we have pretty decent IDE support these days. - Alex
Dec 27 2011
prev sibling parent Andrei Alexandrescu <SeeWebsiteForEmail erdani.org> writes:
On 12/27/11 11:37 AM, Artur Skawina wrote:
 I want to warn against the paradoxical "I can't get creative use of
 feature X working, therefore I'm going back to my old language
 where I can't even think of X."

It may seem paradoxical at first, but isn't. That feature X, often together with Y and Z, could be one of the main reasons for choosing the language - so if that feature doesn't deliver, or isn't reliable enough, this is a valid reason to go back to a maybe less powerful, but at least reliable language. Not only because of the current failure, but also out of fear of what else may break. artur

You may want to also quote the paragraph following that, which is very close to what you said :o). In brief, I entirely agree. Andrei
Dec 27 2011
prev sibling next sibling parent Artur Skawina <art.08.09 gmail.com> writes:
 I want to warn against the paradoxical "I can't get creative use of feature X
working, therefore I'm going back to my old language where I can't even think
of X."

It may seem paradoxical at first, but isn't. That feature X, often together with Y and Z, could be one of the main reasons for choosing the language - so if that feature doesn't deliver, or isn't reliable enough, this is a valid reason to go back to a maybe less powerful, but at least reliable language. Not only because of the current failure, but also out of fear of what else may break. artur
Dec 27 2011
prev sibling next sibling parent Walter Bright <newshound2 digitalmars.com> writes:
On 12/26/2011 11:56 PM, Caligo wrote:
 I need to figure out what this is because I can't compile my code anymore, and
I
 get this:

    dmd: glue.c:1065: virtual unsigned int Type::totym(): Assertion `0' failed.
    Aborted

Kenji prepared a fix for it, and I'm testing it now.
Dec 27 2011
prev sibling parent Caligo <iteronvexor gmail.com> writes:
--f46d0430896c4b784a04b51943ae
Content-Type: text/plain; charset=ISO-8859-1

On Tue, Dec 27, 2011 at 9:25 AM, Andrei Alexandrescu <
SeeWebsiteForEmail erdani.org> wrote:

 The way I see it is, you are a customer (and one who has had enough
 faith to hang around for a while), so your issues should be given
 priority. We can and we should improve quality in the abstract, but at
 the end of the day it's about the human beings who are using the language.

I prefer to be called a "user" rather than a "customer". Even better, a "member" of _D_ revolution. :-) Let me make a couple of points about this code. (To be clear, neither
 justifies the presence of an internal compiler error.)

 First, you are returning a reference to a local. That is automatically
 suspicious, although I assume this is reduced code from something
 meaningful.

 Second, you are exploring a territory that is hardly accessible with other
 languages - operator overloading with consolidated implementation in
 conjunction with subtyping. That means it's not run-of-the-mill stuff the
 compiler is failing with, it's stuff that you would need to abandon
 wholesale if you switched languages.

 Again, that's not a justification for the code not working with a
 meaningless error message. I want to warn against the paradoxical "I can't
 get creative use of feature X working, therefore I'm going back to my old
 language where I can't even think of X."

 That _all_ being said, creative use of creative D features is a prime
 attraction factor of D and we must have them down perfectly. As I mentioned
 once, very often the first use of D by newcomers is not some shit task;
 shit tasks can be done in any language. It's some difficult task that D
 features promise a miraculous solution for, one that would be quite hard to
 achieve with other languages.


 Andrei

Actually, in regards to this issue, there isn't anything meaningful in my code because: somewhere in my project there is a member function that returns void, represented in the code I posted by "fun()". Then there is a another member function that returns non-void, and its name differs only by a letter (we'll call it here funs() ). When I was coding I meant to call funs(), and not fun(). When it came time to compiling the code, I got the non-informative error message. This b3 = (b1 - b2).funs(); made the error go away, but it wasn't easy to find. This has been an accidental bug discovery, :-) I know bitching about issues isn't productive, but sometimes it gets frustrating. Programming in D is very exciting and fun, and compiler/language bugs get in the way. --f46d0430896c4b784a04b51943ae Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable <br><br><div class=3D"gmail_quote">On Tue, Dec 27, 2011 at 9:25 AM, Andrei = Alexandrescu <span dir=3D"ltr">&lt;<a href=3D"mailto:SeeWebsiteForEmail erd= ani.org">SeeWebsiteForEmail erdani.org</a>&gt;</span> wrote:<br><blockquote= class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc soli= d;padding-left:1ex"> The way I see it is, you are a customer (and one who has had enough<br> faith to hang around for a while), so your issues should be given<br> priority. We can and we should improve quality in the abstract, but at<br> the end of the day it&#39;s about the human beings who are using the langua= ge.<br><div> </div></blockquote><div><br>I prefer to be called a &quot;user&quot; rather= than a &quot;customer&quot;.=A0 Even better, a &quot;member&quot; of _D_ r= evolution.<br>:-)<br><br></div><blockquote class=3D"gmail_quote" style=3D"m= argin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left= :1ex"> Let me make a couple of points about this code. (To be clear, neither justi= fies the presence of an internal compiler error.)<br> <br> First, you are returning a reference to a local. That is automatically susp= icious, although I assume this is reduced code from something meaningful.<b= r> <br> Second, you are exploring a territory that is hardly accessible with other = languages - operator overloading with consolidated implementation in conjun= ction with subtyping. That means it&#39;s not run-of-the-mill stuff the com= piler is failing with, it&#39;s stuff that you would need to abandon wholes= ale if you switched languages.<br> <br> Again, that&#39;s not a justification for the code not working with a meani= ngless error message. I want to warn against the paradoxical &quot;I can&#3= 9;t get creative use of feature X working, therefore I&#39;m going back to = my old language where I can&#39;t even think of X.&quot;<br> <br> That _all_ being said, creative use of creative D features is a prime attra= ction factor of D and we must have them down perfectly. As I mentioned once= , very often the first use of D by newcomers is not some shit task; shit ta= sks can be done in any language. It&#39;s some difficult task that D featur= es promise a miraculous solution for, one that would be quite hard to achie= ve with other languages.<span class=3D"HOEnZb"><font color=3D"#888888"><br> <br> <br> Andrei<br> </font></span></blockquote></div><br>Actually, in regards to this issue, th= ere isn&#39;t anything meaningful in my code because:<br><br>somewhere in m= y project there is a member function that returns void, represented in the = code I posted by &quot;fun()&quot;.=A0 Then there is a another member funct= ion that returns non-void, and its name differs only by a letter (we&#39;ll= call it here funs() ).=A0 When I was coding I meant to call funs(), and no= t fun().=A0 When it came time to compiling the code, I got the non-informat= ive error message. This<br> <br>b3 =3D (b1 - b2).funs();<br><br>made the error go away, but it wasn&#39= ;t easy to find.=A0 This has been an accidental bug discovery, :-)<br><br>I= know bitching about issues isn&#39;t productive, but sometimes it gets fru= strating.=A0 Programming in D is very exciting and fun, and compiler/langua= ge bugs get in the way.<br> --f46d0430896c4b784a04b51943ae--
Dec 27 2011