A Philosophy of Software Design
Lance Bachmeier
no at spam.net
Mon May 25 15:02:15 UTC 2026
On Monday, 25 May 2026 at 05:55:59 UTC, Walter Bright wrote:
>> There's a solution to this. I have the LLM program in a "new
>> language" and upload the spec with some examples. No global
>> state. A maximum of 60 lines in the body of a function. A
>> maximum of 10 function arguments. No code blocks. Only goto
>> for jumping around inside the function. You need to change the
>> syntax to get it to accept that you have a new language, so I
>> require line numbers at the start of every line.
>>
>> The problem with just telling the LLM to write a D program
>> that does such and such without restrictions is that it wasn't
>> trained to impose constraints like this to keep the complexity
>> under control, and there's no way it can work well with the
>> amount of context that's required to write a program that can
>> easily be modified in the future.
>
> I agree with no global state, however, the 60 line limit is
> arbitrary. Complexity comes from how much state you need to
> keep in your head, not how many lines of code.
The limit of 60 lines is for the LLM. It hadn't even entered my
mind, but was proposed by Gemini. It allows a proper balance
between being long enough to incorporate the needed functionality
while keeping the necessary context low enough that the output is
highly likely to be correct.
More information about the Digitalmars-d
mailing list