← Back to context

Comment by queoahfh

2 days ago

I am concerned about the quality. Even a cursory skim of the code makes the code appear asinine. Unless the genius aspects of the code elude me.

https://github.com/malisper/pgrust/blob/3646a73515a5e4ac7d0b...

https://github.com/malisper/pgrust/blob/3646a73515a5e4ac7d0b...

Yeah same. The structure makes no real sense and when digging into the code it reads like I'm the first human to look at it.

  • That's how Ai generated code is. I am almost convinced that Models are intentionally taught to write obtuse code because AI companies don't want us to write code at all

  • I'm too young but I imagine assembly programmers were feeling the same when automatic code generation by compilers took over. Very weird.

    • More that I got confused by the C function returning bool, not as an error value, but as a result, which is my fault for skimming it quickly.

      I have taken a closer look at the code, and it seems superficially a somewhat faithful rewrite, not quite idiomatic Rust, but closer than I anticipated at first. I know there are non-LLM rewriting tools for C to Rust, and with a test suite to help, a rewrite to Rust might be greatly helped. The new Rust code does have some drawbacks in some ways, and there are topics I am curious about.

    • I guess there also were macro-assemblers before C, so it was a bit more natural.