powerline-d (I got an AI to port powerline-shell to D)

FeepingCreature feepingcreature at gmail.com
Thu Sep 5 01:45:30 UTC 2024


On Wednesday, 4 September 2024 at 18:55:07 UTC, user1234 wrote:
> On Wednesday, 4 September 2024 at 17:02:55 UTC, Vladimir 
> Marchevsky wrote:
>>
>> In case that really needs some arguing, I would say 
>> translation is not a programming.
>
> There are semantical differences between two languages. Things 
> like implicit conversions, integral promotion, order of 
> evaluation, etc. still need a good old human behing the screen.

Yeah, the nice thing about translation is that the things that 
LLMs have the most trouble with, ie. high-level semantic design, 
class naming, abstraction, are already handled. But it's also not 
like the LLM isn't making its own choices. Recently, I got a LLM 
to *automatically* translate a program from asyncio-mqtt to 
paho-mqtt.

That's not a syntax rewrite, it's a full-on migration, async to 
threads. It still handled it fine. The boundary at the top of 
abstraction work in programming where LLMs have trouble is really 
not all that big.

The problem is that because current AIs are congenitally 
incapable of backspacing, high-level abstraction basically 
requires the AI to guess what it's gonna need from zero, and be 
right, because it can't change course. Defining an abstract class 
requires guessing what methods that class needs, because you 
can't backtrack. It isn't - can't be - good at that, and because 
of that, it isn't really trained in it either. But you can work 
around that with careful prompting and some iteration.

For instance, you can see that we turned the Python segment 
classes into functions. That's a thing that I suggested, but my 
effort literally amounted to saying:

> Honestly the more I think about it, the more I feel the 
> segments should really just be functions, since they don't 
> interact.

And later:

> Can you please refactor the segment logic so that the functions 
> always return empty arrays for "don't include segments" and we 
> never look at `content.empty`? Also remove unneeded parameters 
> while we're at it.

The LLM works a lot better when it's going "from file to file" 
making small to moderate incremental changes. (Like us, really.)


More information about the Digitalmars-d-announce mailing list