Flutterby™! : Vibe coding Rust using gpt-4o

Next unread comment / Catchup all unread comments User Account Info | Logout | XML/Pilot/etc versions | Long version (with comments) | Weblog archives | Site Map | | Browse Topics

Vibe coding Rust using gpt-4o

2025-06-11 20:21:53.214809+02 by Dan Lyke 0 comments

Just to log such things here: I've been getting all of the "use LLMs" pressure, and work has me using the OpenAI API. I've got a couple of features I want to add and clean up in my C++ static site generator, and thinking maybe I need to rework that into Rust, in order to learn Rust, so along with my explorations in parsers in Rust, I asked gpt-4o:

I need command line application written in Rust. It should take as arguments one or more paths to search. It stores all of its information in an SQLite database, and if the SQLite database doesn't exist, it can create the database.

It should recursively search the specified paths for files. If the last modified date on a file is more recent than the entry in the SQLite database, or does not exist in the SQLite database, it should calculate a SHA512 sum of each file. If those files are a well known image format, it should extract the height and width of the image. It should store filename, the filename with full path, last modified date, checksum, height and width of each file in the database.

And I got... something that looked like a Rust application, as Cargo.toml and main.rs, but was not in fact a Rust application. It did, however, seem like a reasonable bit of code to fix, so after adding a bunch of <()> to -> Result return specs, and doing a lot of unwrapping and match and error return type management, I've got something that ... runs.

I also had to change how it did file date checking, because it got the semantics of SystemTime totally wrong.

cargo build pulls in a huge list of modules that I don't know how to trust or evaluate (dependencies of dependencies, unlike my previous attempts at vibe coding Rust this did seem to only suggest semi-relevant modules), it seems to run slower than forking jhead and pnginfo processes to find image sizes in C++ (my guess is that the image::GenericImageView is loading the full raster, and doesn't need to).

So... interesting, but not sure how helpful it is vs reading the docs yet.

[ related topics: Interactive Drama Software Engineering Work, productivity and environment Graphics Databases ]

comments in descending chronological order (reverse):