logoalt Hacker News

legobmw99today at 7:50 PM1 replyview on HN

How pessimistic you are on this subject depends on how much you believe in domain transfer for these tools. No programming language sprung out of a vacuum, and it seems reasonable to think that a LLM sufficiently trained on all the C++, Haskell, and OCaml in the world could probably do a decent job at writing Rust, even if it had never seen it before, given the rust compiler as a tool and rust documentation as input

It certainly does worry me, though. As does the increasing amount of materials and manuals that seem to be written assuming the LLMs will be the (only? primary?) audience


Replies

klibertptoday at 9:49 PM

> How pessimistic you are on this subject depends on how much you believe in domain transfer for these tools.

I tried to force various LLMs to generate many strange languages for the past 3 years. From Raku to Smalltalk, to Common Lisp and Janet, to Prolog, D, Nim, Zig, Elixir, F#, etc.

It's a mess.

They do a mostly good job with language semantics. Agents can also use standard tooling to catch and fix syntax errors. So far so good, though if a given language provides an unusual implementation for a popular feature, the model can get confused. It's usually easy to spot.

The problem is with the ecosystems. They tend to be tiny, and for new languages, they will be tiny almost by definition. As a result, the vast majority of the generated code either reimplements things from scratch or hallucinates dependencies. Since the agents iterate and the hallucinated deps don't materialize, the model fixes that... more often than not by writing from scratch. Or leaving a `// TODO:` comment.

What I found helpful is straight-up vendoring deps as submodules. Armed with grep and sources, they are much more likely to produce working code. But that also means you still need to handle the dependencies yourself, while it'll "just work" for a Kotlin/Gradle project.

It doesn't matter for all projects to the same degree, of course, but it is a pain point that will add to the difficulty (sky-high already) of a new language getting any traction, unfortunately :(