Earlier quoted context omitted.
Porting something to a language you don't know doesn't seem very helpful to me. You've locked yourself out of doing useful work except with continued application of more AI. Without the ability to verify it, except with even more AI maybe, you're starting on a slippy slope to slop. If the experiment was "spend 400 bucks to see if it'll work" then that's awesome, and fun, and a cool use of AI. It's impressive that AI…
I work on a C++ codebase. I frequently prototype in c and then have the ai model slopify it back to c++. Nice b/c I am faster at reading c, but hard b/c you miss some of the features/nuances of c++.
I used Fable to rewrite 65kLoC of Go in Rust. It cost $400
41–50 of 76 posts
Re: I used Fable to rewrite 65kLoC of Go in Rust. It cost $400
#42I recently performed this exact exercise of converting a complex library set from one language into an intermediate state machine representation and then translated into N other languages. It worked well but there's a lot of caveats. I'd highly recommend a direct "port" in most cases tbh, as many bugs are "load bearing" and may not survive the intermediate translation. I speak from experience.
Re: I used Fable to rewrite 65kLoC of Go in Rust. It cost $400
#43The title is the worst part of the essay. Which is super interesting, to wit: fable's a very capable model when it comes to transforming concepts in and out of structural descriptions, and you can use it (along with a test suite I presume) to transpile a codebase. I wouldn't have thought to do this, but I think it makes sense, and I like it - it's using model intelligence at a few different steps for sensible things.…
Re: I used Fable to rewrite 65kLoC of Go in Rust. It cost $400
#44Earlier quoted context omitted.
> I'd highly recommend a direct "port" I'm sure there are other caveats. Also cost of the more or less straightforward Bun port was $165000 for 500KLoC.
Are you implying a direct bug for bug port is more expensive than converting to an intermediate representation and then converting via generators? Depending on the "fidelity" of the representation I'd figure the costs are about the same.
If not an intermediate representation, my first question would be: how to split the work. You cannot just prompt full rewrite of 60K LoC, you cannot do it module by module — modules do translate 1:1, like in my case golang packages did not matched Rust crates. Bun did file by file.
With hierarchical state machines in the middle, I did it almost in one shot.
Re: I used Fable to rewrite 65kLoC of Go in Rust. It cost $400
#45Re: I used Fable to rewrite 65kLoC of Go in Rust. It cost $400
#46Earlier quoted context omitted.
I would be afraid to do this with C++. My friend once sent me a snippet, maybe 10 lines of C+++, asking "can you spot the UB?". So I'm staring at these 10 lines, I KNOW there is an UB. I wasn't able to find it without a hint.
Was it the one with the elided null check?
My all-time favourite example is (again, my memory, I may be a bit wrong):
for (int i = 0; i
at some point limit could potentially become greater than INT_MAX, the compiler decided that i while(true)
signed unsigned mismatch makes me shiverRe: I used Fable to rewrite 65kLoC of Go in Rust. It cost $400
#47Earlier quoted context omitted.
I realized that I haven't answered the question. These $400 also include the tests. Fable ported "human fuzzing session" (the best bug hunter) from Go to Rust and used it to validate everything else. I used hierarchical state machines, so a lot of my QA gates were encoded into the implementation — impossible states are, well, impossible. (I ported first 80% practically in one shot, planning and then leaving Fable ove…
This is impressive but it again led me to questions. Porting the fuzzer from Go to Rust to validate Rust is a bit circular, isn’t it^^? Porting a fuzzer bug will hide the same class bug in the code it’s checking, who fuzzes the fuzzer / setup / harness:)? A good standard for rewrites is a differential testing, feed the same input to the old Go app and the new Rust then diff the outputs. Did you do that?
Yes, I completely forgot to mention, this is exactly my case. Rune is a TUI editor, so I feeded the same terminal sequences to the old and new apps.
It didn't translate 1:1 (I ported core editor first, there were side panels, and different chrome elements) so I instructed LLM to use ttyd (tty -> browser render), Fable then could open both apps with playwright, make and compare screenshots.
To rephrase, one critical component is to establish a feedback loop for the model. This new generation of models: Opus 5, Fable, GLM-5.2, even Qwen3.8-27B can self-correct, provided they know whether they are progressing or not.
A month ago, especially smaller model would fall into a rabbit hole it dug for itself and would never recover. This generation can sometimes run tens of hours without losing track.
I still wouldn't trust a model after 70% context window, but the progress is noticeable.
Re: I used Fable to rewrite 65kLoC of Go in Rust. It cost $400
#48Earlier quoted context omitted.
I'm glad you liked it. I was trying to keep both, the title and the content as straightforward as possible. Another point is, Fable is reasonably cheap if you don't allow it to read or write.
Thank you. Yes I would like to hear more about that - I’d be interested to read details about limiting some of its native tool use.
There is a way to control tool invocations at the harness level when writing skills or agents.
Example: ~/.claude/agents/critic.md
---
name: critic
description: >
Plan Critic. Reviews an implementation plan. Use before the implementation.
tools: Read, Agent
---
For Claude skills, the frontmatter is different, the keys are: allowed-tools: Read Grep
disallowed-tools: WebSearch Glob
https://code.claude.com/docs/en/tools-referenceRe: I used Fable to rewrite 65kLoC of Go in Rust. It cost $400
#49The title is the worst part of the essay. Which is super interesting, to wit: fable's a very capable model when it comes to transforming concepts in and out of structural descriptions, and you can use it (along with a test suite I presume) to transpile a codebase. I wouldn't have thought to do this, but I think it makes sense, and I like it - it's using model intelligence at a few different steps for sensible things.…
Ime it remains the best model for prototyping, sims, visualization etc throwaway scenarios. Just don’t look at the generated code if you just let it rip on the problem for hours ;) but that advice applies to any model unfortunately
In my experience, you can get good results if Fable does't write code itself, only spawn subagents.
I can run Fable for 10 hours, and it would output 50k tokens and read 300k (30% of the context window). The resulting code is okay-ish. I would rarely merge LLM-produced code first try without an adversary review.
Re: I used Fable to rewrite 65kLoC of Go in Rust. It cost $400
#50The best language a program to be written in is the original. Languages have conventions and best practices that aren’t portable. We could port COBOL to c and do a crap ton of goto/jmps and make a BEGIN MESS
My point is that one can translate the data flow to another language.
You could imagine any program as input -> [blackbox] -> output. For example, same pixels rendered on the screen provided identical keyboard input.
I propose a way to decompose the blackbox.