AI Continues to Impress
I make no secret of being a bit of an AI skeptic, however, I will give credit where it's due.
Today I've had two AI experiences that left me feeling impressed. Both of these involved leveraging the AI assistant built into Zed.
Earlier today I was writing some documentation in the Zed codebase. I had two structs with the same fields: an internal settings struct and a separate struct for serialization. One of these structs had its fields documented while the other did not.
While I could have copied the doc comments over by hand, I decided to enter this prompt into the inline assistant to see what would happen:
Copy the doc comments from the fields in
LanguageSettingsContent
and add them to the fields inLanguageSettings
. Ignore the note about the default value. Just bring over the doc comments.
The AI copied over the doc comments verbatim—sans the note about the default value that I asked it to ignore—and put them on the corresponding fields.
Later this evening I was doing some work on my site, translating some of my templates from Tera over to a new templating system I'm building on top of auk
.
I needed to port this small component I had written over to Auk's DSL:
<div class="pv2 flex items-end">
<div class="pv1 w-20">{{ label }}</div>
<div class="pv1 w-80">
<progress class="flex language-bar" value="{{ value }}" max="10"></progress>
</div>
</div>
Once again, I thought it would be interesting to see what the Zed assistant could do with this. I prompted it with:
Rewrite this HTML using
auk
's DSL like thepost_link
function above.
The end result that the assistant spit out looked identical to what I would have produced by hand:
pub fn language_stat(label: &str, value: u32) -> HtmlElement {
div()
.class("pv2 flex items-end")
.child(div().class("pv1 w-20").text_content(label))
.child(
div().class("pv1 w-80").child(
progress()
.class("flex language-bar")
.value(value.to_string())
.max("10"),
),
)
}
I still don't buy into the notion that AI will make software developers obsolete. Rather, I think that a judicious integration of AI into our development tools and workflows can make us all more effective at building software.