AmanoJyaku

Members
  • Content Count

    243
  • Joined

  • Last visited

  • Days Won

    11

AmanoJyaku last won the day on January 21 2022

AmanoJyaku had the most liked content!

Community Reputation

184 Jedi Grand Master

4 Followers

About AmanoJyaku

  • Rank
    Jedi Knight

Recent Profile Visitors

13,440 profile views

Single Status Update

See all updates by AmanoJyaku

  1. Rewriting the program again. But, this time.. wow.

    1. DarthParametric

      DarthParametric

      Is that a good wow or a bad wow?

    2. AmanoJyaku

      AmanoJyaku

      Good wow. The old code wouldn't have passed a professional review, it had dangerous things like pointer arithmetic.

      Which is fine since I'm not submitting this to an employer. But, the danger meant the program could and did develop bugs. These bugs might occur at an early phase in the reverse compilation process, but only present themselves later. This made it difficult to figure out what was wrong, and often meant fixing several layers of code.

      The new code is 10% smaller, and 100% clearer. Here's an example:

      Quote

              int Val;

              if (_at_least(CurPos, EndFile, sizeof(int)))
              {
                  std::reverse_copy(CurPos, CurPos + sizeof(int), _to_byte_ptr(Val));

                  return Val;
              }
              else { throw CurPos; }

      The contents of _at_least, std::reverse_copy, and _to_byte_ptr were all in one big function. Yuck.

      Finally, I can get back to solving what appears to be the last two problems for the reverse compiler.