On Sunday, 6 October 2019 at 14:08:07 UTC, Adam D. Ruppe wrote:
D can eliminate error paths at compile time too, e.g. static assert - which can be used to create all kinds of new useful errors. So I am guessing this is just a case of the code needing a lil tweak or the compiler being conservative and putting the code in even though it is never supposed to happen (like final switch keeps an error path because you can do like cast(some_enum) value_not_in_enum.... and then better to have the assertion failure than UB.)

Good to hear. I confess I was a bit mystified about why it should be an issue for D or why compiler vs. library implementation should make a difference to the ability to eliminate the error path (I infer from your remarks that it shouldn't, in principle).

I'm not fluent in assembly so, leaving the error path aside, I wasn't sure how to interpret the "main path" assembly from the D and Rust code, and whether they were practically equivalent (clearly the assembly posted looked different). Can anyone offer any interpretation there?
  • Re: Blog Post: Beating ... Arun Chandrasekaran via Digitalmars-d-announce
    • Re: Blog Post: Bea... Seb via Digitalmars-d-announce
      • Re: Blog Post:... Paul Backus via Digitalmars-d-announce
      • Re: Blog Post:... Andrei Alexandrescu via Digitalmars-d-announce
      • Re: Blog Post:... Walter Bright via Digitalmars-d-announce
        • Re: Blog P... Seb via Digitalmars-d-announce
          • Re: Bl... Joseph Rushton Wakeling via Digitalmars-d-announce
            • R... Joseph Rushton Wakeling via Digitalmars-d-announce
              • ... Adam D. Ruppe via Digitalmars-d-announce
              • ... Joseph Rushton Wakeling via Digitalmars-d-announce
              • ... Paul Backus via Digitalmars-d-announce
            • R... Seb via Digitalmars-d-announce
              • ... Joseph Rushton Wakeling via Digitalmars-d-announce
              • ... Andrei Alexandrescu via Digitalmars-d-announce
              • ... Paul Backus via Digitalmars-d-announce
              • ... Joseph Rushton Wakeling via Digitalmars-d-announce
              • ... Paul Backus via Digitalmars-d-announce
          • Re: Bl... Arredondo via Digitalmars-d-announce
        • Re: Blog P... Paolo Invernizzi via Digitalmars-d-announce
          • Re: Bl... Walter Bright via Digitalmars-d-announce

Reply via email to