Hacker News new | ask | show | jobs
by dcre 18 days ago
> since AI makes rewrites to certain languages relatively easy

This premise makes no sense. AI makes rewrites to any language easy.

4 comments

That's absolutely not true. Differently languages have greater or lesser representation in the training sets. You see a similar bias toward specific libraries within a given ecosystem, so much so that I worry about AI created technical monocultures as AI generated code converges to specific languages, packages, etc.

The LLM companies have truly astounding power to now steer the direction of the entire industry. It should worry all of us.

Rust does not have a bigger training set than say Python/JS/TypeScript/C++ .
Yes but it goes deeper than just corpus, because not all programming languages are created equal. More statically enforced language perform better with AI because the tooling catches more bugs earlier. Highly dynamic languages like JS are very poor rewrite targets, despite being popular, because you essentially have to live in the debugger and employ maximum TDD to make it work reliably. And AI doesn't do that.

Consider just having a typechecker. That alone eliminates a whole class of bugs and unit tests, which means your remaining unit tests check more logic. I've seen JS projects with high test coverage that cover essentially zero logic, only type checking class things. And nobody even knows it, really. But when your tests are just "okay pass an empty array. Now an empty string. This should fail, great. Now pass an array with the wrong elements..." you're not testing anything. You're probing the type system, which many languages do automatically and perfectly.

Meta for example is spending a lot of effort and money into creating new curated programming training sets.

That means at least from their POV what's already available is not enough or not good enough, and if they're correct then the companies making the models can "artificially" inflate a language's representation.

I never said it did.

My comment shouldn't be read as an explanation for why Anthropic chose Rust in this case.

I was simply disputing the claim that LLMs are good at all languages, and that their biases--both intentional and otherwise--will swing the entire industry.

That's not all there is to it, to be fair. Rust seems to work particularly well for LLMs in part because it's better at catching their errors.
IMO there is no reason to believe llms create equal quality code in all languages.
They really don't. Even per-project it can be a shitshow. For instance, while I use LLMs to write some typescript, when I'm writing code for Unreal Engine in C++ & Blueprint I pretty much do it by hand because it absolutely can't do blueprint in any meaningful sense. Even the most basic requests result in an absolute mess. (I imagine it's also very hard to train on since its stored as binary data). Even the C++ code it generates is pretty rough -- regular linker errors etc.
This isn't true. AI couldn't rewrite Firefox in Brainfuck.
easy or good?
Both!