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.