The ability of ChatGPT to write both syntactically and semantically correct code seems uncanny; but was it generated logically (i.e. from BNF) or biologically (i.e. by imitating training data, and possibly post-filter with a real compiler)? Likely the latter, Cf. googleonebox: