Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

A while ago I created a very simple AI tool that lets you write any kind of pseudocode you like, and then choose a language to convert it into. I didn't do much with it, but I like that style better because at least you can verify and correct the output.

For instance:

  // pseudocode input
  fizzBuzz(count)
    for each i in count
      if divisible by 3, print 'fizz'
      if divisible by 5, print 'buzz'
      if both, print 'fizz buzz'

  // rust output
  fn fizz_buzz(count: i32) {
    for i in 1..=count {
      match (i % 3, i % 5) {
        (0, 0) => println!("fizz buzz"),
        (0, _) => println!("fizz"),
        (_, 0) => println!("buzz"),
        _ => println!("{}", i),
      }
    }
  }


in general i agree with the other guy that said using llms like this is codegen ... but you have given a case agreeing with another perspective in the thread, that using llms like this is akin to treating them as a compiler from spoken language to code ...




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: