# The port grew to three times its estimated size

Markdown copy of https://realalpha.app/s/the-port-grew-to-three-times-its-estimated-size/ on Real Alpha, the best minutes from long interviews with the people building AI. Cite and link the page, not this copy.

- Speaker: [Stephen Toub](https://realalpha.app/people/stephen-toub/) · Stephen Toub is a Distinguished Engineer at Microsoft.
- Host: [Ryan Peterman](https://realalpha.app/people/ryan-peterman/) · Host, The Peterman Pod · Went from new grad to staff engineer at Instagram in three years.
- Show: The Peterman Pod
- Episode: [Microsoft Distinguished Eng: Why And How To Port Your Entire Codebase to Rust | Stephen Toub](https://realalpha.app/v/PLMOVlZC4eU/), Nov 2, 2026
- Moment: 1:00:01 to 1:03:18 of the episode (3 min), playing on https://realalpha.app/s/the-port-grew-to-three-times-its-estimated-size/; the episode from there: https://realalpha.app/v/PLMOVlZC4eU/?t=3601

## Quote

> “I think I'd estimated about **six to eight weeks** to get it done.”
> — [Stephen Toub](https://realalpha.app/people/stephen-toub/) at [1:01:22](https://realalpha.app/v/PLMOVlZC4eU/?t=3682) · The Peterman Pod

## Takeaways

1. The estimate assumed roughly 150,000 lines of production TypeScript.
2. Incoming features expanded the port to around 450,000 lines.
3. Untangling the runtime from the CLI added work.

## About this segment

Stephen Toub estimated six to eight weeks based on roughly 150,000 production lines. The port reached about 450,000 lines as the code grew and the runtime was separated from the CLI.

From “Microsoft Distinguished Eng: Why And How To Port Your Entire Codebase to Rust | Stephen Toub”, Nov 2, 2026. [Watch the full episode](https://realalpha.app/v/PLMOVlZC4eU/)

## Transcript

Transcribed by machine (Whisper) from the episode’s audio, so a word may be off here and there.

[1:00:07](https://realalpha.app/v/PLMOVlZC4eU/?t=3607) did you have a sense of how much this would cost in tokens before you went and did it yes and the bill ended up being larger than i expected um mostly because the line count ended up being larger than I expected. Um, I hadn't fully factored in the growth rate of how much incoming code there would be. So this was, you know, there were, there were a few things, I think I did a lot of things, right. I did a few things wrong and, you know, 2020 hindsight and all that. One of them I already mentioned, I didn't spend enough time, uh, really fleshing out the end to end tests to make sure that they were as comprehensive as they could have been. I could have done that better. The other thing I could have done better was really factor in the growth rate of code that would need to be ported. So when I looked at the, the code base as part of writing this proposal,

[1:01:04](https://realalpha.app/v/PLMOVlZC4eU/?t=3664) it was somewhere on the order of 150,000 lines of production type script, 130, something like that. I don't remember the exact number. Um, and based on that and some back of the napkin calculations and looking at how long it took to create the prototypes that I'd alluded to earlier for, you know, in the different languages to sort of measure perf and things like that. I think I'd estimated about six to eight weeks to get it done.

[1:01:35](https://realalpha.app/v/PLMOVlZC4eU/?t=3695) But when you look at what we actually need to port, I didn't factor in a few things. One, that there were, you know, tens of developers using agents very quickly augmenting the code base with lots of a different additional functionality. And, you know, this code base is one that's it's not public open source, but it's effectively internal open source. So there's a bunch of folks that come in and add the things that they need.

[1:02:06](https://realalpha.app/v/PLMOVlZC4eU/?t=3726) And then the core team is helping to review all that. And so there's this very significant influx of functionality that I hadn't accounted for. I also hadn't accounted for the fact that because of how the code base came about, the CLI, the copyright CLI and the runtime were kind of very intertwined, more so than they ideally should have been. And so in order to port just the runtime, and the CLI can be ported separately if we wanted to, but to actually tease them apart to the point where you don't need the CLI, you don't need to deploy the CLI as part of your application that's using the runtime.

[1:02:46](https://realalpha.app/v/PLMOVlZC4eU/?t=3766) There was this effort of teasing them apart, but then there's also an effort of moving functionality that really doesn't need to be in the TUI and that could be shared in the runtime down. And I failed to account for how much of the code that was currently marked as CLI would actually be beneficial to move down. And so over this effort, there was also code that was coming down so by the end um we ported somewhere between four and i think 450 000 lines of typescript so
