Hi,
Thanks for sharing this post.
...Which was just on the right time for me. Recently i got some interest in Rust. There are mutiple reasons,
usage of rust in the infrastructure of popular web tools / ecosystem like Vite, bun, TS compiler etc. (I have a plan to get in building dev tools, too).
recent increase in Rust mentions (dont really wanna call it "hype") promoting mem management and efficiency / swiftness etc. as a better choice of C++ / C and GC consisting languages and also the efficiency of making AI write Rust code, due to its better error messages, etc.
some feeling that it would be better to also know a compiled, static and efficient lang, as a career roadmap (in addition to TS/JS and relevant ecosytem/tools etc.)
I also believe that We should know the language that we make AI code for us, I would feel quite uneasy otherwise.
I still did not get into learning Rust, evaluating it still, and nowadays, unfortunately i am very busy or lazy to do some side project/learning at my free time (could not create any).
But hopefully this will change and I will resume learning and building personal stuff soon. And when that time comes, building some tools with Rust and learning it might be a challenge i could assume.
Anyway,
I have a couple of questions for you, if you dont mind:
What you think of next? do you think you will continune with rust development, for this kind of work above and learn it deeply by time?
And are there any more reasons, other than just embracing a challenge that is exciting to get into Rust (if you say yes to my above question)
Thanks
I actually agree with a lot of what you said, especially this part 👇
We should know the language that we make AI code for us.
I feel the same way. Even if AI can write a lot of the code, I still want to understand what it is doing, why the compiler is complaining, and whether the implementation actually makes sense.
For your first question
yes, I think Rust will definitely remain one of my options, especially when I build CLI tools or other developer tools.
I'm still learning Rust myself, so I wouldn't say I've gone very deep yet. But working on type-tune has already given me a pretty good reason to keep learning it.
In my testing, the Rust version of type-tune ended up being almost 10x faster than the TypeScript version in some workloads. For a CLI, that kind of difference directly improves the UX, commands feel much more immediate.
your second question
performance isn't the only reason for me.
I also really like that Rust gives you a compiled binary, strong guarantees from the compiler, and very explicit error handling. For tools that touch a lot of files or modify a user's codebase, that safety is especially attractive.
That said, I don't think I'd choose Rust for everything. I still love TypeScript, and for many kinds of applications it is absolutely the better choice.
But for CLI/dev tooling specifically, Rust has definitely become a language I want to keep using and learning more deeply. 🦀
So if you eventually decide to build a small tool with it, I think that would be a great way to learn, that's basically how I'm learning it too! 😸
Thanks for your detailed response. Agree with all.
when learning something, I mostly prefer to watch a superficial video and start reading the docs or recommended books. When i check the docs. they mention an online book. I kind of feel that i should start with this book, for fundamentals mostly.
In parallel, starting a little project seems a very good idea.
now the hardest part, committing to it and finding time.
Creator of GithubStarsManager — an open-source, local-first tool that organizes GitHub stars with AI: auto-categorization, semantic search, release tracking, and an MCP server for star library.
The "type-tune got faster, its developer got slower" line is the most honest part of this. AI collapsing the cost of writing Rust while the review cost stays the same is exactly the bottleneck I keep running into too — "compiles and passes tests" doesn't tell me whether the abstraction is right, and the .clone() question is a perfect example of a decision that looks trivial but isn't.
The Scan / Plan / Apply split, with every candidate [ignore] by default, is the design choice I'd steal: it makes the tool's job "surface the decision" instead of "make the decision", and rolling back when tsc validation fails is the safety net that makes apply feel trustworthy rather than scary. Congrats on the release — and on refusing to become a very expensive Enter key.
Creator of GithubStarsManager — an open-source, local-first tool that organizes GitHub stars with AI: auto-categorization, semantic search, release tracking, and an MCP server for star library.
Ha, the expensive Enter key line got me too — and honestly it's the exact tension I keep running into with my own tooling. Automate the mechanical parts, keep the risky parts reviewable. Good luck with the Rust side of it, and thanks for writing the trade-offs up so honestly.
That balance is exactly what I’m trying to keep: automate the mechanical work, but make sure the parts that can actually change the architecture stay visible and reviewable.
And thanks for the encouragement on the Rust side too. I still have a lot to learn, but that’s part of the fun. 🦀
Creator of GithubStarsManager — an open-source, local-first tool that organizes GitHub stars with AI: auto-categorization, semantic search, release tracking, and an MCP server for star library.
Exactly — "the parts that can actually change the architecture stay visible" is the perfect way to put it. That's the line I'd draw too: automate the boring bits, keep the decisions that reshape the system in front of human eyes. Enjoy the Rust learning curve, the fun part is real 😄
Appassionato di programmazione web e creatore di BeeEngine, un motore di gioco 2D leggero in Vanilla JS. ! 🐝🐝🐝🐝🚀++++++++BeeLadybug è un overlay di telemetria e ispezione visiva open source.🐞🐞🐞
"I don't want to become a very expensive Enter key" 😹 This hit home!
Honestly, I'm not a great developer. I get a lot of help from AI, and just like you said, I use it to understand. I still don't know everything about how my own two projects are built. I tried reading a bit of your Rust code, but I needed AI to explain it to me 😅
But I truly believe one thing: you have great skills and great ideas, and they will take you further than AI, because you're the one giving the commands.
For me, writing documentation for my projects is how I learn: I understand them better and I keep finding new bugs to fix... and so on! 🐱🦀💚
fnmain(){letme=String::from("JS cat 🐱");ask_ai(&me);// borrowing, not moving! I'm learning 😹println!("{} still here, still learning 🦀",me);}
And honestly, using AI to understand our own code is still learning. What matters is that you keep asking why things work instead of just accepting the output.
Writing documentation is a really good way to do that too. If you can explain the code clearly, you usually understand it much better — and like you said, you often find bugs along the way. 👀
Also, your Rust example made me laugh. 😹🦀
The JS cat survived the borrow checker!
Appassionato di programmazione web e creatore di BeeEngine, un motore di gioco 2D leggero in Vanilla JS. ! 🐝🐝🐝🐝🚀++++++++BeeLadybug è un overlay di telemetria e ispezione visiva open source.🐞🐞🐞
Technical writer covering Python, AI, and the craft of learning in public. 30 articles on Python fundamentals, projects, and developer education. FreeCodeCamp Author
The line that hit me: "I don't want to become a very expensive Enter key."
That is the most accurate description of the current AI era I have ever read.
As someone who is currently learning Python, I feel this deeply. It is incredibly easy to just ask an AI to write a script, hit "Accept," and move on. But if you don't understand the why behind the code, you're just accumulating technical debt and learning absolutely nothing.
I also love the Scan / Plan / Apply architecture you built. It perfectly mirrors how we should be using AI. Let the AI automate the tedious scanning and the manual file moves (Apply), but keep the architectural decisions (Plan) in the hands of the human.
I have one question for you: Through this process, do you feel like you actually learned Rust, or did you just learn how to review AI-generated Rust? There's a massive difference between the two, and I'm curious how you feel about it now.
I definitely wouldn’t say "I fully understand Rust" yet.
There are still parts where I need to stop, read the implementation carefully, and sometimes ask for an explanation before I really understand what is happening.
But through actually building type-tune, reviewing the generated code, and going through those explanations almost like mini lectures, I do feel that I’m gradually learning Rust rather than simply learning how to approve AI-generated Rust.
So for me, the workflow that seems to work best is: let AI help with the implementation, but then slow down during review, read the code carefully, understand why it works, and only move forward once I can explain it to myself.
One important detail in this case is that type-tune already had its basic architecture implemented in TypeScript before I rewrote it. So I already understood what the tool was supposed to do and how the pieces fit together. That made it much easier to focus specifically on how Rust expresses the same ideas.
I’m still very much learning, but I think that combination of "building + reviewing + understanding" is working pretty well for me so far. 🦀
I research AI tools, APIs & agents — comparing specs, pricing and real user reports — then publish honest rankings so you don't waste money. Research-first, never sponsored fluff.
That line about not wanting to become a very expensive Enter key is the whole thing, isn't it. The clone-vs-borrow review problem is the part that would slow me down most — AI handing you code that compiles but you can't tell if the .clone() is load-bearing. Did the rewrite change how you review AI code in TypeScript too, or is it just the Rust that's slower to check?
Yeah, Rust is definitely the slower one for me to review. 😹
In TypeScript, I can usually spot questionable choices pretty quickly because I already have a strong mental model for the language and ecosystem.
But the Rust rewrite did make me more suspicious of AI-generated code in TypeScript too.
“Compiles” and “passes tests” are useful signals, but they still don’t tell me whether the abstraction, API boundary, dependency direction, or ownership of responsibility is actually right.
So Rust mostly slowed down the review itself, but it probably made my TypeScript reviews a bit more skeptical too. 👀
And yeah, the .clone() question is exactly the kind of thing that makes Rust review take longer for me. 🦀
Memory safety and zero-cost abstractions only deliver their promise when you understand the underlying cache hierarchy and syscall overhead.
Rewriting services without profiling memory allocation patterns just trades one set of bottlenecks for another. Systems engineering always comes down to mechanical sympathy with the hardware.
I am going to ask you 1 thing. where on this planet, earth and sky did you learn rust. It still manages to elude me to this day. and so i got the unholy deity AI to teach me slowly. also,
Keeping the original module as a compatibility re-export is a good safety valve. One edge I’d be curious about: with project references or path aliases, does apply validate only the selected --project, or walk the referenced configs too? A leaf config can pass while a consumer still resolves the old path differently.
Right now, type-tune does not walk TypeScript project references.
If the selected tsconfig has non-empty references, scan/plan/apply are rejected before any rewrite happens. Path aliases are supported, but final validation still runs against the selected --project only.
So your leaf-config example is exactly why I don’t want to claim workspace-wide safety yet.
Supporting the full project-reference graph will need a broader analysis/validation model rather than just following references during apply. 🦀
I measure AI coding claims in public. LGTM — Let's Get the Measurements: real runs, real numbers, receipts. Every article is an experiment I actually ran. Books & packs: aheadkit.gumroad.com
The line about AI generating Rust faster than you can understand it is the most honest thing I've read about agents in weeks. You optimised the typing and accidentally made yourself the bottleneck. I did the same dance with a language I barely knew once and spent more time reading the generated code than I would've spent writing the slow version myself. Still worth it for the learning, or would you pick the boring familiar stack next time and keep the speed?
I think it depends a lot on the size of the project and what I’m trying to achieve. 😸
If I need to ship something quickly and maintain it for a long time, I’d probably still choose TypeScript because that’s where I’m fastest and most comfortable.
If performance really matters, or I specifically want the challenge, then I’d choose the language that fits that goal better.
What this rewrite changed for me is that I’m much less afraid of rewriting something later.
But even with Rust, I probably wouldn’t start from zero there. I’d likely build the first version in TypeScript, get the design and behavior right, and then rewrite once I actually understand what needs to change.
🎓 Self-taught full-stack developer | 💻 Python, JavaScript, Django, React
🇮🇷 From Iran | 💡 Passionate about building tools that empower people
🧠 AI enthusiast | 🤖 Dreaming of ethical, creative,
A most laudable endeavour! Though AI may expedite the writing of code, the discernment to comprehend, scrutinise, and refine it remains the developer’s own province. I hold in especial esteem your resolve to acquaint yourself with Rust rather than blindly entrust the machine with the task; therein lies the distinction between wielding a tool with mastery and becoming subservient to its convenience.
Rust is definitely challenging for me, but that’s also what makes it interesting. I’ll keep learning little by little and try my best to really understand what I’m building instead of just letting the AI do everything for me. 🦀
I write about Next.js + TypeScript + AI engineering, with a focus on making sites discoverable to LLMs and AI search. Long-form notes at mudassirkhan.me
the line about type tune getting faster while its developer got slower is the honest part of the post. having design docs and tests already in place is probably why the migration took under a month, most rewrites stall because the spec only lives in the old code. we moved one hot path off node once and the test suite as a contract saved us more than the language did. how are you checking the rust output matches the typescript version on large repos, snapshot diffs or something stricter?
Yeah, having the tests and design docs already in place helped a lot. 😸
For parity, I compare candidate IDs, referrers, plan output, and dry-run previews rather than relying on snapshots alone.
The controlled fixtures match well, but on one much larger real app the two versions still disagreed slightly, so I’m not treating that as a valid benchmark yet.
I’d rather expose the mismatch than hide it behind a snapshot. 👀
Great write-up! The line “AI can generate Rust code much faster than I can understand it” names a problem many people feel but few say out loud. 😹
The review bottleneck is real. AI cuts the cost of writing code, but reviewing still costs the same. Reviewing also depends on how fluent you are in the language. In TypeScript you can spot a smell in seconds. In Rust you stop and look things up, as you described with .clone(), pub vs pub(crate), and macros. Seen that way, the bottleneck is the gap between the code you can generate and the code you can judge.
Your port had a big advantage: the TypeScript version. You had a working implementation, design docs, and tests. That means you had an oracle. A few things that could help you learn faster and trust the port more:
Run the old and new implementations against the same fixtures. Run both on a handful of real TS projects and diff the plan.json output. Because your candidate IDs are deterministic, this should be cheap. It checks the port without you having to read every line of Rust.
Let Clippy do the first pass of the ownership and visibility review. cargo clippy flags many of the things you described, such as redundant_clone and needless borrows. unreachable_pub and clippy::pedantic can also be enabled. When AI writes a .clone(), a lint can tell you whether it’s needed. That leaves your attention for the architectural decisions.
Use AI as a tutor, not only as a generator. Instead of “write this function,” try “write it, then explain every .clone() and pub and what would break without it.” Or ask it for a version with zero clones and have it explain the trade-offs. You write that this is the “expensive Enter key” trap, and this is the opposite habit.
The design philosophy is the strongest part. The Scan / Plan / Apply split, with every candidate [ignore] by default, is the same idea as your AI argument: automate the tedious work, not the decisions. Opt-in by default is a good choice for a tool that rewrites source files. It also means AI-assisted review stays advisory and never touches the code. I’d like to see more AI tools put the human decision point in a reviewable artifact like plan.md, instead of an in-chat “approve all.”
Rolling back when TypeScript validation fails is a nice safety net too. It makes apply feel more like a transaction than a codemod.
Some questions:
Can you share numbers on the speed-up? Which phase gained the most (parsing, reference resolution, or I/O) on a large monorepo?
How do you handle cases the tool can’t safely rewrite, such as export * chains, namespace imports, or declare module augmentations? Do they get skipped with a reason in the plan, or flagged?
Is there a “second pass” idea, such as suggesting destinations based on existing folder conventions, while keeping the human in charge?
On the closing request: Rust is mostly learned by reading the compiler’s error messages carefully. The borrow checker error you showed is a good example. You’re already doing the harder part, which is questioning why the code is written the way it is. Keep reviewing the diffs, and the crab will come. 🦀
Thanks for sharing, and congrats on the release! 🎉
I really like the way you described the old TypeScript implementation as an “oracle.” That’s exactly what made this rewrite practical.
I actually went back and benchmarked the old TypeScript version against the current Rust version after reading your question.
On a controlled fixture with 200 packages and 600 TypeScript files, where the scan results matched:
Command
TypeScript
Rust
Speed-up
scan
1,008 ms
90 ms
11.3×
plan
1,002 ms
96 ms
10.4×
reviewed apply --dry-run
1,868 ms
1,012 ms
1.85×
I also tested a real is-kit checkout:
Command
TypeScript
Rust
Speed-up
scan
713 ms
78 ms
9.1×
plan
754 ms
84 ms
8.9×
That said, I don’t think I can honestly say “Rust made phase X faster” yet.
The implementations changed quite a lot too: the TypeScript version used ts-morph / TypeScript findReferences(), while the Rust version uses tree-sitter and its own import/referrer analysis.
On one much larger real application, reference lookup in the old implementation was clearly the hotspot, but the two versions produced slightly different analysis results, so I don’t want to present its timings as an apples-to-apples benchmark.
So for now my conclusion is:
The rewrite is clearly much faster in comparable tests, but I can’t attribute that gain to Rust alone or say which phase improved the most on a large real codebase yet. 👀🦀
Also, I really like your suggestion of asking AI to explain every .clone() and pub instead of just generating the code. That’s exactly the kind of habit I want to build.
Hi,
Thanks for sharing this post.
...Which was just on the right time for me. Recently i got some interest in Rust. There are mutiple reasons,
I also believe that We should know the language that we make AI code for us, I would feel quite uneasy otherwise.
I still did not get into learning Rust, evaluating it still, and nowadays, unfortunately i am very busy or lazy to do some side project/learning at my free time (could not create any).
But hopefully this will change and I will resume learning and building personal stuff soon. And when that time comes, building some tools with Rust and learning it might be a challenge i could assume.
Anyway,
I have a couple of questions for you, if you dont mind:
Thanks for the thoughtful comment! 😸
I actually agree with a lot of what you said, especially this part 👇
I feel the same way. Even if AI can write a lot of the code, I still want to understand what it is doing, why the compiler is complaining, and whether the implementation actually makes sense.
yes, I think Rust will definitely remain one of my options, especially when I build CLI tools or other developer tools.
I'm still learning Rust myself, so I wouldn't say I've gone very deep yet. But working on
type-tunehas already given me a pretty good reason to keep learning it.In my testing, the Rust version of type-tune ended up being almost 10x faster than the TypeScript version in some workloads. For a CLI, that kind of difference directly improves the UX, commands feel much more immediate.
performance isn't the only reason for me.
I also really like that Rust gives you a compiled binary, strong guarantees from the compiler, and very explicit error handling. For tools that touch a lot of files or modify a user's codebase, that safety is especially attractive.
That said, I don't think I'd choose Rust for everything. I still love TypeScript, and for many kinds of applications it is absolutely the better choice.
But for CLI/dev tooling specifically, Rust has definitely become a language I want to keep using and learning more deeply. 🦀
So if you eventually decide to build a small tool with it, I think that would be a great way to learn, that's basically how I'm learning it too! 😸
Thanks for your detailed response. Agree with all.
when learning something, I mostly prefer to watch a superficial video and start reading the docs or recommended books. When i check the docs. they mention an online book. I kind of feel that i should start with this book, for fundamentals mostly.
In parallel, starting a little project seems a very good idea.
now the hardest part, committing to it and finding time.
Thanks again, see u around.
alptekin
Absolutely! 😸
And yeah... finding the time and actually committing to it is probably the hardest part. 😹
Thanks again for the great conversation, and see you around! 💚
Aqben
Thanks for your reply thank you. They can do the same
Thanks
Luke
The "type-tune got faster, its developer got slower" line is the most honest part of this. AI collapsing the cost of writing Rust while the review cost stays the same is exactly the bottleneck I keep running into too — "compiles and passes tests" doesn't tell me whether the abstraction is right, and the .clone() question is a perfect example of a decision that looks trivial but isn't.
The Scan / Plan / Apply split, with every candidate [ignore] by default, is the design choice I'd steal: it makes the tool's job "surface the decision" instead of "make the decision", and rolling back when tsc validation fails is the safety net that makes apply feel trustworthy rather than scary. Congrats on the release — and on refusing to become a very expensive Enter key.
Thank you! 😸💚
I really like your phrasing: “surface the decision instead of make the decision.”
That’s exactly what I want type-tune to do.
Automate the mechanical work, make the risky parts reviewable, and leave the architectural choice to the developer.
And yes, I’m still trying very hard not to become an expensive Enter key. 😹🦀
Ha, the expensive Enter key line got me too — and honestly it's the exact tension I keep running into with my own tooling. Automate the mechanical parts, keep the risky parts reviewable. Good luck with the Rust side of it, and thanks for writing the trade-offs up so honestly.
Thank you! 😸💚
That balance is exactly what I’m trying to keep: automate the mechanical work, but make sure the parts that can actually change the architecture stay visible and reviewable.
And thanks for the encouragement on the Rust side too. I still have a lot to learn, but that’s part of the fun. 🦀
Exactly — "the parts that can actually change the architecture stay visible" is the perfect way to put it. That's the line I'd draw too: automate the boring bits, keep the decisions that reshape the system in front of human eyes. Enjoy the Rust learning curve, the fun part is real 😄
"I don't want to become a very expensive Enter key" 😹 This hit home!
Honestly, I'm not a great developer. I get a lot of help from AI, and just like you said, I use it to understand. I still don't know everything about how my own two projects are built. I tried reading a bit of your Rust code, but I needed AI to explain it to me 😅
But I truly believe one thing: you have great skills and great ideas, and they will take you further than AI, because you're the one giving the commands.
For me, writing documentation for my projects is how I learn: I understand them better and I keep finding new bugs to fix... and so on! 🐱🦀💚
😁😁
Thank you!! I love your comment. 😸💚
And honestly, using AI to understand our own code is still learning. What matters is that you keep asking why things work instead of just accepting the output.
Writing documentation is a really good way to do that too. If you can explain the code clearly, you usually understand it much better — and like you said, you often find bugs along the way. 👀
Also, your Rust example made me laugh. 😹🦀
The JS cat survived the borrow checker!
Let’s keep learning and building together. 🐱🙌
Thank you so much! 😸💚
The line that hit me: "I don't want to become a very expensive Enter key."
That is the most accurate description of the current AI era I have ever read.
As someone who is currently learning Python, I feel this deeply. It is incredibly easy to just ask an AI to write a script, hit "Accept," and move on. But if you don't understand the why behind the code, you're just accumulating technical debt and learning absolutely nothing.
I also love the Scan / Plan / Apply architecture you built. It perfectly mirrors how we should be using AI. Let the AI automate the tedious scanning and the manual file moves (Apply), but keep the architectural decisions (Plan) in the hands of the human.
I have one question for you: Through this process, do you feel like you actually learned Rust, or did you just learn how to review AI-generated Rust? There's a massive difference between the two, and I'm curious how you feel about it now.
That’s a really good question! 😸
I definitely wouldn’t say "I fully understand Rust" yet.
There are still parts where I need to stop, read the implementation carefully, and sometimes ask for an explanation before I really understand what is happening.
But through actually building
type-tune, reviewing the generated code, and going through those explanations almost like mini lectures, I do feel that I’m gradually learning Rust rather than simply learning how to approve AI-generated Rust.So for me, the workflow that seems to work best is: let AI help with the implementation, but then slow down during review, read the code carefully, understand why it works, and only move forward once I can explain it to myself.
One important detail in this case is that
type-tunealready had its basic architecture implemented in TypeScript before I rewrote it. So I already understood what the tool was supposed to do and how the pieces fit together. That made it much easier to focus specifically on how Rust expresses the same ideas.I’m still very much learning, but I think that combination of "building + reviewing + understanding" is working pretty well for me so far. 🦀
That line about not wanting to become a very expensive Enter key is the whole thing, isn't it. The clone-vs-borrow review problem is the part that would slow me down most — AI handing you code that compiles but you can't tell if the .clone() is load-bearing. Did the rewrite change how you review AI code in TypeScript too, or is it just the Rust that's slower to check?
Yeah, Rust is definitely the slower one for me to review. 😹
In TypeScript, I can usually spot questionable choices pretty quickly because I already have a strong mental model for the language and ecosystem.
But the Rust rewrite did make me more suspicious of AI-generated code in TypeScript too.
“Compiles” and “passes tests” are useful signals, but they still don’t tell me whether the abstraction, API boundary, dependency direction, or ownership of responsibility is actually right.
So Rust mostly slowed down the review itself, but it probably made my TypeScript reviews a bit more skeptical too. 👀
And yeah, the
.clone()question is exactly the kind of thing that makes Rust review take longer for me. 🦀Memory safety and zero-cost abstractions only deliver their promise when you understand the underlying cache hierarchy and syscall overhead.
Rewriting services without profiling memory allocation patterns just trades one set of bottlenecks for another. Systems engineering always comes down to mechanical sympathy with the hardware.
Absolutely. 👀
That’s also why I’m trying not to frame the rewrite as simply “Rust made it faster.”
The Rust version changed more than the language itself:
parser choice, reference analysis, data structures, and execution strategy all changed too.
In controlled benchmarks it is clearly much faster, but profiling the real bottlenecks still matters if I want to understand why.
Otherwise I’m just moving the bottleneck somewhere else. 😹🦀
I am going to ask you 1 thing. where on this planet, earth and sky did you learn rust. It still manages to elude me to this day. and so i got the unholy deity AI to teach me slowly. also,
I didn’t really “learn Rust first and then build it.” I built it while learning Rust, with AI acting as my very patient tutor. 😹🦀
So I’m still learning too. 👀
And yes,
May the fluff be with you. 🐈✨
Keeping the original module as a compatibility re-export is a good safety valve. One edge I’d be curious about: with project references or path aliases, does apply validate only the selected --project, or walk the referenced configs too? A leaf config can pass while a consumer still resolves the old path differently.
Good catch. 👀
Right now, type-tune does not walk TypeScript project references.
If the selected
tsconfighas non-emptyreferences, scan/plan/apply are rejected before any rewrite happens. Path aliases are supported, but final validation still runs against the selected--projectonly.So your leaf-config example is exactly why I don’t want to claim workspace-wide safety yet.
Supporting the full project-reference graph will need a broader analysis/validation model rather than just following references during
apply. 🦀The line about AI generating Rust faster than you can understand it is the most honest thing I've read about agents in weeks. You optimised the typing and accidentally made yourself the bottleneck. I did the same dance with a language I barely knew once and spent more time reading the generated code than I would've spent writing the slow version myself. Still worth it for the learning, or would you pick the boring familiar stack next time and keep the speed?
I think it depends a lot on the size of the project and what I’m trying to achieve. 😸
If I need to ship something quickly and maintain it for a long time, I’d probably still choose TypeScript because that’s where I’m fastest and most comfortable.
If performance really matters, or I specifically want the challenge, then I’d choose the language that fits that goal better.
What this rewrite changed for me is that I’m much less afraid of rewriting something later.
But even with Rust, I probably wouldn’t start from zero there. I’d likely build the first version in TypeScript, get the design and behavior right, and then rewrite once I actually understand what needs to change.
That path feels much more natural for me now. 🦀
omg i gave you star and followed you i loved it so cute 😍😍
YAY!!! 😸💚
Thank you so much for the star and the follow!!
I’m really happy you liked it. 🐈🦀✨
I think porting a working tool is a brave way to learn a new language properly.
Yeah, I think that helped a lot! 😸
Having a working implementation, tests, and a design to compare against made Rust much easier to learn than starting from a blank project.
Still painful sometimes though. 😹🦀
A most laudable endeavour! Though AI may expedite the writing of code, the discernment to comprehend, scrutinise, and refine it remains the developer’s own province. I hold in especial esteem your resolve to acquaint yourself with Rust rather than blindly entrust the machine with the task; therein lies the distinction between wielding a tool with mastery and becoming subservient to its convenience.
Thank you so much! 😸💚
Rust is definitely challenging for me, but that’s also what makes it interesting. I’ll keep learning little by little and try my best to really understand what I’m building instead of just letting the AI do everything for me. 🦀
Really appreciate the thoughtful comment!
the line about type tune getting faster while its developer got slower is the honest part of the post. having design docs and tests already in place is probably why the migration took under a month, most rewrites stall because the spec only lives in the old code. we moved one hot path off node once and the test suite as a contract saved us more than the language did. how are you checking the rust output matches the typescript version on large repos, snapshot diffs or something stricter?
Yeah, having the tests and design docs already in place helped a lot. 😸
For parity, I compare candidate IDs, referrers, plan output, and dry-run previews rather than relying on snapshots alone.
The controlled fixtures match well, but on one much larger real app the two versions still disagreed slightly, so I’m not treating that as a valid benchmark yet.
I’d rather expose the mismatch than hide it behind a snapshot. 👀
Great write-up! The line “AI can generate Rust code much faster than I can understand it” names a problem many people feel but few say out loud. 😹
The review bottleneck is real. AI cuts the cost of writing code, but reviewing still costs the same. Reviewing also depends on how fluent you are in the language. In TypeScript you can spot a smell in seconds. In Rust you stop and look things up, as you described with .clone(), pub vs pub(crate), and macros. Seen that way, the bottleneck is the gap between the code you can generate and the code you can judge.
Your port had a big advantage: the TypeScript version. You had a working implementation, design docs, and tests. That means you had an oracle. A few things that could help you learn faster and trust the port more:
Run the old and new implementations against the same fixtures. Run both on a handful of real TS projects and diff the plan.json output. Because your candidate IDs are deterministic, this should be cheap. It checks the port without you having to read every line of Rust.
Let Clippy do the first pass of the ownership and visibility review. cargo clippy flags many of the things you described, such as redundant_clone and needless borrows. unreachable_pub and clippy::pedantic can also be enabled. When AI writes a .clone(), a lint can tell you whether it’s needed. That leaves your attention for the architectural decisions.
Use AI as a tutor, not only as a generator. Instead of “write this function,” try “write it, then explain every .clone() and pub and what would break without it.” Or ask it for a version with zero clones and have it explain the trade-offs. You write that this is the “expensive Enter key” trap, and this is the opposite habit.
The design philosophy is the strongest part. The Scan / Plan / Apply split, with every candidate [ignore] by default, is the same idea as your AI argument: automate the tedious work, not the decisions. Opt-in by default is a good choice for a tool that rewrites source files. It also means AI-assisted review stays advisory and never touches the code. I’d like to see more AI tools put the human decision point in a reviewable artifact like plan.md, instead of an in-chat “approve all.”
Rolling back when TypeScript validation fails is a nice safety net too. It makes apply feel more like a transaction than a codemod.
Some questions:
Can you share numbers on the speed-up? Which phase gained the most (parsing, reference resolution, or I/O) on a large monorepo?
How do you handle cases the tool can’t safely rewrite, such as export * chains, namespace imports, or declare module augmentations? Do they get skipped with a reason in the plan, or flagged?
Is there a “second pass” idea, such as suggesting destinations based on existing folder conventions, while keeping the human in charge?
On the closing request: Rust is mostly learned by reading the compiler’s error messages carefully. The borrow checker error you showed is a good example. You’re already doing the harder part, which is questioning why the code is written the way it is. Keep reviewing the diffs, and the crab will come. 🦀
Thanks for sharing, and congrats on the release! 🎉
Thank you for such a thoughtful comment! 😸💚
I really like the way you described the old TypeScript implementation as an “oracle.” That’s exactly what made this rewrite practical.
I actually went back and benchmarked the old TypeScript version against the current Rust version after reading your question.
On a controlled fixture with 200 packages and 600 TypeScript files, where the scan results matched:
scanplanapply --dry-runI also tested a real
is-kitcheckout:scanplanThat said, I don’t think I can honestly say “Rust made phase X faster” yet.
The implementations changed quite a lot too: the TypeScript version used ts-morph / TypeScript
findReferences(), while the Rust version uses tree-sitter and its own import/referrer analysis.On one much larger real application, reference lookup in the old implementation was clearly the hotspot, but the two versions produced slightly different analysis results, so I don’t want to present its timings as an apples-to-apples benchmark.
So for now my conclusion is:
The rewrite is clearly much faster in comparable tests, but I can’t attribute that gain to Rust alone or say which phase improved the most on a large real codebase yet. 👀🦀
Also, I really like your suggestion of asking AI to explain every
.clone()andpubinstead of just generating the code. That’s exactly the kind of habit I want to build.Thanks again for such a detailed comment! 🙌
great
Thx! 😸