top | item 42489168

(no title)

jl2718 | 1 year ago

> code is not literature

One thing I’ve thought about is how AI assistants are actually turning code into literature, and literature into code.

In old-fashioned programming, you can roughly observe a correlation between programmer skill and linear composition of their programs, as in, writing it all out at once from top to bottom without breaks. There was then this pre-modern era where that practice was criticized in favor of things like TDD and doc-first and interfaces, but it still probably holds on the subtasks of those methods. Now there are LLM agents that basically operate the same way. A stronger model will write all at once, while a weaker model will have to be guided through many stages of refinement. Also, it turns the programmer into a literary agent, giving prose descriptions piece by piece to match the capabilities of the model, but still in linear fashion.

And I can’t help but think that this points to an inadequacy of the language. There should be a programming language that enables arbitrary complexity through deterministic linear code, as humans seem to have an innate comfort with. One question I have about this is why postfix notation is so unpopular versus infix or prefix, where complex expressions in postfix read more like literature where details build up to greater concepts. Is it just because of school? Could postfix fix the stem/humanities gap?

I see LLMs as translators, which is not new because that’s what they were built for, but in this case between two very different structures of language, which is why they must grow in parameters with the size of the task rather than process linearly along a task with limited memory, as in the original spoken language to spoken language task. If mathematics and programming were more like spoken language, it seems the task would be massively simpler. So maybe the problem for us too is the language and not the intelligence.

discuss

order

skydhash|1 year ago

> If mathematics and programming were more like spoken language, it seems the task would be massively simpler

Mathematics and programming derives from spoken languages. The thing is that spoken languages lack precision: What you said is not what I understand. So they chose a subset, assign the items precise meanings and how to use them in sentences. Then convert the whole in a terser form for ease of notation. Starting with the terse notation is the wrong way to go about it, just like someone does not start learning music by reading sheet music. Learning programming is easier by learning what the components are and not how to write syntax.

> So maybe the problem for us too is the language and not the intelligence.

The issue is understanding. Behind every bad code, there's someone with either lack of understanding or making hasty decisions (time pressure, tiredness,...).

noworriesnate|1 year ago

> The thing is that spoken languages lack precision

This is true, but extreme precision is most useful if there's only communication one way, i.e. the programmer communicates to the computer how to operate and the computer does not respond (other than to execute the code). But if there's a dialog, then both parties can ask for clarification and basically perform a binary search to quickly hone in on the exact meaning.

pjc50|1 year ago

> writing it all out at once from top to bottom without breaks

This only happens for toy examples; all real development is iterative, across years and teams. There are a few people who can do Feynman "think very hard and write down the answer", but it's a unique skill of limited availability.

> One question I have about this is why postfix notation is so unpopular versus infix or prefix, where complex expressions in postfix read more like literature where details build up to greater concepts. Is it just because of school?

Developers (you, and the rest of the audience) really need to be able to distinguish between a personal aesthetic preference and some sort of timeless truth.

> Could postfix fix the stem/humanities gap?

I feel fairly confident when anyone posts One Weird Trick nonsense like this that the answer is "no". Especially as postfix is in no way new, it's decades old.

Heck, this is also Anglocentric: there are plenty of human languages which are "postfix", in that they're subject-object-verb rather than subject-verb-object. Such as German and Japanese. Doesn't seem to convey an automatic advantage in either science or literature against the juggernaut of ubiquitous English.

(Mathematical notation tends to use infix operators for some things and prefix operators for others; postfix seems to be rarer? Mostly for units?)

seansh|1 year ago

> There should be a programming language that enables arbitrary complexity through deterministic linear code, as humans seem to have an innate comfort with.

I agree that linear code is easier to read and understand. I've noticed that often when my own code gets confusing it is because it's too nested, or too many things are happening at once, or the order of actions is not clear. After gaining a deeper understanding of the problem, rewriting it in a more linear fashion usually helps but not always possible.

I'm curious how a programming language could enable writing complex code in a linear fashion if the complexity of the code is due to the interconnected nature of all its parts. In other words, there may be no way to connect all the parts in a linear way without oversimplifying.

Of course, sometimes the complexity is incidental, that is, if I were a little smarter or spent more effort, I could reduce the complexity. But some complexity is intrinsic to the problem being solved.

The question that really fascinates me is not why code is non-linear, but why literature isn't?

nuancebydefault|1 year ago

Exactly what I was thinking of when reading the article. Maybe codeMic comes a year or so too late.

Soon AI will read this big blob of code and I can ask away and the AI can explain while jumping to places in the code, which I can hoover for inspection. Then I ask it to refactor it or add this or that functionality, add tests for it and show the results of the tests.

Code becomes literature, becomes code.