Essay record

Porting my F# Web App to Rust in 2 Hours with AI

Record
Essay / / 3 min read / 995 words
On this page4 sections / +

DISCLOSURE: Some links may be affiliate links. Details

I've been using AI to revive some of my old projects the latest of which is CloudCompare, a simple cloud comparison tool for server, object, and egress pricing. I've been moving most of my development over to Rust as I think Rust is extremely well positioned in the age of AI. It's a high level language with low level performance characteristics and guardrails that protect you, and AI, from more types of bugs.

I used my agentic engineering approach to port my site from F# to Rust in about 2 hours. Here we'll discuss a bit more about my approach and learnings.

What I Migrated

I used AI to port CloudCompare from F# (on my old fullstack F# boilerplate) to Rust (and my new fullstack Rust boilerplate).

CloudCompare architecture before and after the F# to Rust port

Old Site:

For more on how I built my site with F#, you can check out Build a Fullstack Webapp with F# + Falco

New Site:

  • Architecture: Vertical sliced modulith
  • Backend: Rust on Axum
  • Frontend: SSR HTML with Maud
  • Hosting: Same

For more on building sites with Rust, you can checkout Build a Simple Single-File Rust Web API

HAMY Labs self-host architecture with Ansible, Tailscale, Nomad, app servers, and a database server

My hosting setup is outside the scope of this video but I frequently get questions about it so here's a quick overview:

  • 3 server types - Admin, DB, App
  • Ansible playbooks configure servers - lock them down, setup Nomad orchestrator, only talk via Tailscale
  • Nomad for orchestration
  • Deploys via GitHub Actions

How I Migrated my Site with AI

AI ran through my agentic engineering workflow and completed the migration in ~2 hours.

  • Before (F#): 1,918 lines of code
  • After (Rust): 2,359 lines of code (22% increase)

My agentic workflows are relatively simple, essentially having paved roads for the common parts of the software development lifecycle:

  • Planning
  • Building
  • Reviewing

Where I think they're more useful is I have some orchestration skills that compose these together so that my agents can run longer with less supervision:

  • One supervisor to understand the goals and the tasks I'm giving it
  • Spins up build cycles that build and review a single task
  • Decides what to work on next based on outcome of that task

It's definitely slower and more costly than just running these things actively myself but it is also less mental overhead which is useful when most of the time I have to work on these side projects is when I'm resting / doing smth else (see My Daily Routine as a Software Engineer and Dad of a 1-Year-Old). With these orchestrations I can kick it off and then just look at the results later.

Now I'm not going to pretend that this was an overly complicated migration, certainly nothing like trying to break apart a million-line legacy monolith or convert Bun from Zig to Rust.

  • Small app - ~2,000 lines of production code
  • Simple monolithic, server-side rendered design

But it's still impressive that we can do this passively with AI - smth that would've taken me hours of coding myself.

There were a few factors that made this migration fast and reliable

  • I had the existing F# codebase to use as a reference for my Rust codebase (an oracle)
  • The old and new CloudSeed boilerplates have very similar architectures
  • The code itself is not very complicated - mostly just static page rendering

It doesn't hurt that F# logic is pretty easy to parse and AI is pretty good at Rust. And both Rust and F# have expressive types so most of the data modeling can be ported over ~1:1 (vs trying to shove some discriminated unions into say a Go or C# app).

Outcomes and Learnings

After the 2 hours, we had an app that built and ran locally but didn't actually deploy. It wasn't perfect but it was ~90% there.

Issues:

  • New: The UI had drifted with verbose AI explanations and unwieldy table styles
  • Existing: Stale currency calculations
  • Existing: The app didn't deploy, an artifact of not updating my deploy pipeline since the last time I overhauled my hosting paradigm ~2026.03

If I had to pick some learnings:

  • AI is fast - particularly for close 1:1 migrations and langs it has good training data in (Rust included!)
  • AI is increasingly capable at running unattended - especially with solid direction, guardrails, and examples to follow
  • You are still the last and most important quality gate - there will be drift so if you don't catch it, your users will

Next

Cloud server pricing chart comparing monthly cost per vCPU and RAM per vCPU

Since the migration I've updated the cloud data, added some comparison charts, and expanded coverage to additional providers all from my couch. If you're looking to compare some cloud data, take a look at CloudCompare and let me know what you think.

I think AIs will continue to eat away at the need to code/program for most CRUD usecases and the onus on humans will be to switch from tactics to strategy - product requirements, roadmaps, and system design / guardrails.

If you want to see my AI skills, I snapshot them each month to the HAMY LABS Example Repo, available to HAMINIONS Members.

If you liked this post you might also like:

Built with CloudSeed Rust