I’ve been messing around with Claude code to see how fast I can spin up silly small projects. I also wanted to do a bit more in rust (https://rust-lang.org).

The first one is a breakout clone using the egui library (they call libraries “crates” in rust to avoid sounding like python, and because the package manager tool is called “cargo”. Why not call them all libraries?)

You can find the code here: https://github.com/wfkolb/rust_out

It runs VERY poorly because of the way I handled the graphics, in this case each “pixel” was a ui square and would essentially draw extra data to be that corny lighting effect around the pixels. However, I learned a bit more about egui https://github.com/emilk/egui which is essentially Imgui https://github.com/ocornut/imgui for rust (even though rust technically has Imgui bindings). But the thing that makes it much easier for my brain to understand egui (as well as Imgur) is that it isn’t call back based. Meaning you don’t write “here’s what you do on click” after adding a button to your graphics, you actually have a huge “while(true)” loop which is much more programatic. For example you’ll make a button by essentially saying “if the button was pressed last frame do this” so everything flows a bit more like a game or Arduino style loop. Makes it very hard to manage your GUI though, you need to recompile every small change you make. But with AI this becomes a much faster iteration cycle.

The other thing I made was a quick 3d renderer to load and display some 3d models (as .fbx files https://en.wikipedia.org/wiki/FBX):

You can find the code here: https://github.com/wfkolb/three_three_dee_dee. It doesn’t really have depth so it’s an isometric view (https://en.wikipedia.org/wiki/Isometric_video_game_graphics) and the lighting is a bit awkward but hey it loads any fbx and can display it! The window management was made using winit (https://github.com/rust-windowing/winit), the actual graphics side was done using wgpu (https://github.com/gfx-rs/wgpu) which essentially takes the window opened by winit, identifies the low level graphics object inside of that window, and lets you paint per pixel. However in this case wgpu has the bones of a 3d renderer that can pass model vertexes to the gpu, which then can display whatever. I then used the rust fbx package here: https://docs.rs/fbx/latest/fbx/ which basically just parses the fbx files, gets all of the information needed and throws it into wgpu. I gotta say this was one of the more challenging things to work with AI on. This was mostly because telling the ai you’ve done something wrong requires very careful wording of what you’re seeing, otherwise the AI will give you a bunch of conversation about why what it did was correct. For example: FBX files compress their meshes by making a list of vertexes that are all labeled by an index, then by making a list of indices to link those vertexes together to make a mesh. Getting Claude to recognize that its shader was disordering that list of indices was challenging, it required passing in a simple triangle with debug statements to convince the AI something was wrong. Now if I had a better understanding on how the fbx ordering side worked BEFORE I started working I probably would have caught that earlier….

But this comes down to question about how you should use AI in the first place. When you’re doing something you already know how to do you’re essentially getting a junior engineer with unlimited time and energy to do whatever you ask. When you have no idea what you’re doing and you’re talking to AI, you’re going to get some garbage output that will build you into a corner rather quickly. But if you’ve done the thing that you’ve asked AI you can increase your time to completion by a bunch.

So in my case it was pretty dumb that I did this all with rust: a language I’ve barely used.