Behold a cursed crate: a Rust macro that will use generative code to produce implementations. Write the function signature and that's it.
Nightmare fuel.
use ai_bindgen::ai;
#[ai]
extern "C" {
#[ai(prompt = "return the n-th prime number, please")]
fn prime(n: i32) -> i32;
// no prompt parameter (the signature should be self explanatory :)
#[ai]
fn max(a: i32, b: i32) -> i32;
}
fn main() {
println!("The 15th prime number is {}", prime(15)); // 47 (hopefully)
println!("max(4, 6) = {}", max(4, 6)); // 6
}
I like the "hopefully" there.
@mttaggart Not my cake, and agree on the shock, but in some sense it is still better than committing the AI generated code without trace.
(Of course one hopes the generated code is still committed somewhere for persistence and observation, instead of being regenerated and such).