3 ms·
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
by queoahfh 3mo 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/3646a73515a5e4ac7d0b7df88c61b180e1cabdb2/crates/backend/catalog/pg_inherits/src/lib.rs#L450 https://github.com/malisper/pgrust/blob/3646a73515a5e4ac7d0b...
https://github.com/malisper/pgrust/blob/3646a73515a5e4ac7d0b7df88c61b180e1cabdb2/crates/backend/catalog/pg_inherits/src/lib.rs#L221 https://github.com/malisper/pgrust/blob/3646a73515a5e4ac7d0b...
- mechazawa 3mo agoYeah 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.
- thewhitetulip 3mo agoThat'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
- 0x000xca0xfe 3mo agoI'm too young but I imagine assembly programmers were feeling the same when automatic code generation by compilers took over. Very weird.
- iigijshaba 3mo agoMore 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.
- u8080 3mo agoI guess there also were macro-assemblers before C, so it was a bit more natural.
- philipbjorge 3mo agoWow, I would love to read an interview series based on this!!
- mataamad 3mo agoThis is a (slightly more typesafe) transliteration of the C code. https://github.com/postgres/postgres/blob/2e6578292a9184dcaae6c5abc235a26db9cb2973/src/backend/catalog/pg_inherits.c#L356 https://github.com/postgres/postgres/blob/2e6578292a9184dcaa...