Live data from Hacker News

I used Fable to rewrite 65kLoC of Go in Rust. It cost $400

iurii.net

21–30 of 76 posts

Re: I used Fable to rewrite 65kLoC of Go in Rust. It cost $400

#21

Earlier quoted context omitted.

Human-written. I was trying to be short and straight to the point. LLM-powered rewrites and huge refactors are better done using 1 additional step "convert the code to that represents it best". The simplest example is, for a CRUD app it can be swagger description. The more complex behaviour exhibit the app, the more raw information should be provided. Like ontologies, "A is a child of B" model can derive and enforce…

honestly it is hard to believe that seeing your replies and this heading: "The secret sauce". Giving the benefit of doubt, we all might be writing a bit like claude nowadays. If that is the case, I'd recommend reviewing the content before publishing to see if it sounds like a LLM. Or if you are trying to create "better" AI slop and think that is enough to say the text is human-written, don't do that, just say it was…

I wrote this elsewhere. Reading so much LLM output may have affected how I write.

Probably I need some fresh air and a good fiction book.

Re: I used Fable to rewrite 65kLoC of Go in Rust. It cost $400

#23

Earlier quoted context omitted.

I found this part to be interesting/clever: 1. Extract the data representation Ask the LLM to represent your code as any combination of: graphs ontologies hierarchical state machines UML process charts constraints math formulae 2 Operate on the representations 3 Convert representations back to code

Do we think that was necessary? What would have happened if OP had just asked it to rewrite and test/validate each piece as it went until everything is verified and complete? My gut feeling is this is doing way too much, and it would've figured it out.

converting code to more abstract and denser representations and then manipulating them makes sense to me. Finding better representations is like half of mathematics.

Re: I used Fable to rewrite 65kLoC of Go in Rust. It cost $400

#24

Earlier quoted context omitted.

All very good questions. Agents are actively destroy QA gates in many ways, usually by cheating ("the test is buggy, not my changes" — changes the test), or just rot QA slowly by writing buggy overcomplicated tests What works for me 10/10 is fuzzing and my own constant usage. For this project specifically (text editor), I asked LLM to create human-like fuzzing session, it sends keystrokes like: "the user is searching…

Why are you just pasting LLM answers :(? I see this constantly in Slack DMs to every day from work. It hurts

this is not llm writing. there's no need to startle at the sight of an em-dash

Re: I used Fable to rewrite 65kLoC of Go in Rust. It cost $400

#25

Earlier quoted context omitted.

Why are you just pasting LLM answers :(? I see this constantly in Slack DMs to every day from work. It hurts

This is genuinely how I write :'( It is probably because I read tons and tons of LLM output.

It's ok, it is slightly llm-like but not in the worst way, like it was edited after. You aren't Claude at least.

Re: I used Fable to rewrite 65kLoC of Go in Rust. It cost $400

#26
I 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

#27
post #10

Following the recent "Rewriting bun in Rust" I thought to run an experiment which turned out to be success.

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++.

Re: I used Fable to rewrite 65kLoC of Go in Rust. It cost $400

#28
post #22

Makes sense it would have been 6 USD in GLM 5.3?

I doubt that it is possible with GLM.

I haven't played with GLM 5.3, only with 5.2, so I cannot say for sure.

GLM is at the level of Opus. Fable is something different entirely. It is capable of tracing the data flows of the app, I even tried it in a huge PHP codebase, it works.

PHP is a weird beast because it allows something like

    $v = 'SomeClass' + 'Controller'
    ... // and later
    new($v)

In other words, it could be hard to understand the code without running it, Fable reads this.

And another distinct feature of Fable — it is an amazing orchestrator. I prohibit it basically read and write, and it operates a swarm of haiku and sonnet.

Re: I used Fable to rewrite 65kLoC of Go in Rust. It cost $400

#29

I 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.

> 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.

Re: I used Fable to rewrite 65kLoC of Go in Rust. It cost $400

#30
post #10

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 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.

Post reply on HN