As I said, that code illustrates the point I made in the other comment about being a functional pipeline, which composes pure functions. That snippet is part of a function that's only a little bigger - here's the start of it:
fn spatial_context_cmd() -> impl Parser<char, Statement, Error = Simple<char>> + Clone {
let group = ctx_or_expr()
.then_ignore(just(',').padded_by(ws()))
.then(
spatial_expr()
.separated_by(just(',').padded_by(ws()))
.at_least(1),
)
.map(|(target, exprs)| SpatialGroup { target, exprs });
Combine that with the first snippet and you have the whole function. There's not a lot of room for "slop" here. A big part of that is the constraints imposed by (1) good libraries that follow functional principles, (2) a good type system, (3) a good language.
If you start removing those factors, the quality of generated programs is going to suffer as a consequence: mutable data is more difficult to reason about, and weak or nonexistent types make it harder to recover semantics from source code and easier for runtime errors to occur. A good type system forces a model to get things right before the program will even compile.
I've seen this because, working in ML, I'm forced to generate Python sometimes, and you can definitely see the difference.
You can even generate a diagram from this code. The code above produces this diagram: https://pxdrop.online/i/dbjcbkq81qec73aqu5fg
All the points I've mentioned make it easy to review and to be sure that the code is correct - along with our existing tests, and new tests written by the model.
> What exactly is supposed to be impressive
I didn't say it was "impressive". I said "...pretty high quality. [...] Most functions were pretty short and well factored." The above is certainly an example of that. In my initial review I didn't see anything that I would qualify as "slop" - quite the contrary.
But it actually is impressive that models are capable of this. It's certainly above average code when compared to average human developers.
I'll close with a quote from Ghost in the Shell:
> "All things change in a dynamic environment. Your effort to remain what you are is what limits you."