News for hackers. Stuff that matters.
Re:Show HN: Whole Git repo was made with ChatGPT by 19h on Sunday December 04, 2022 @06:05PM (#33859004)
Honestly the thing that shocked me the most is this kind of query I've been doing for the last 10 hours:

  Rewrite the following in Rust:

  size_t strlenNEON(const char *p)
  {
      const char *const top = p;
      uint8x16_t c16 = vdupq_n_u8(0);
      /* 16 byte alignment */
      size_t n = reinterpret_cast<size_t>(p) & 15;
      if (n > 0) {
          uint8x16_t x = *(const uint8x16_t*)&p[-n];
          uint8x16_t a = vceqq_u8(x, c16);
          unsigned long mask = GetByteMask(a) << (16 + n);
          if (mask) {
              return __builtin_clz(mask);
          }
          p += 16 - n;
      }
      assert((reinterpret_cast<size_t>(p) & 15) == 0);
      for (;;) {
          uint8x16_t x = *(const uint8x16_t*)&p[0];
          uint8x16_t a = vceqq_u8(x, c16);
  
          if (isFound(a)) {
              unsigned int mask = GetByteMask(a);
              return p + __builtin_clz(mask) - top;
          }
          p += 16;
      }
  }
It even correctly produces the implementation of the unimplemented functions being called from the C++ impl.
Re:Show HN: Whole Git repo was made with ChatGPT by thdespou on Sunday December 04, 2022 @11:55PM (#33861647)
It's the journey not the destination that matters.