The Carbon programming language was announced today, which gives us an interesting opportunity: can GPT-3 learn a new programming language that it DEFINITELY hasn't had any exposure to? And the answer is yes!!!!!!!

Jul 20, 2022 · 4:09 AM UTC

I mean the 0..n syntax seems to be invalid, but it's a good guess
That is Rust syntax... Also the types f32 and i32 are from Rust. But Rust has no Print function. So it is learning from the example and mixing it in.
Here's a more complicated example. Again, it is taking bits of Rust like the type names, but then adding Carbon-specific syntax like "Slice(i32)" .
This is one of the weirdest things I've ever seen. It's taking ONE EXAMPLE of a BRAND NEW PROGRAMMING LANGUAGE and extending that out into new programs.
Lol it even seems to understand what it's doing
I mean some of these are wrong (Rust DOES use slices, and Carbon DOESN'T have ownership) but it's completely plausible
it can incorporate new data about the language
it can both compile and run code
it can do some interesting transformations of code
it can compile AND document