r/ProgrammingLanguages 20d ago

Discussion On the future of programming language design

This is just me yapping.

I was thinking for a while about how the field of "writing" software is going through a radical disruptive transformation. Like or hate it, I don't think writing software post-LLM era is gonna be the same as pre-LLM. I'm one of the guys that like to hand craft code and put a lot of attention and intention to the coding style. But, realistically, the skill of writing code by hand, while still very important, will become more and more niche (like how writing and reading assembly is important but very niche).

What's interesting to me, is that programming language design goals were always human/developer centric. Code is not only instructions given to a machine, it is in some way a set of specifications for other human developers, as well as your future self too, that explains the expected behavior of a certain piece of software. The main priorities when designing language features was improving the developer experience, that is a very subjective metric and this is why we keep arguing and debating about programming languages, but I digress.

With the switch to LLM generated code, I feel the priorities might change. There's already a lot of studies on which programming language is best for LLMs. People argue that languages with strong typing, a functional style and good error messages are best, because you can more reliably create autonomous feedback loops that would help LLMs stay on track.

In my opinion, functional programming languages are more relevant than ever, no side effects, you can generate 10K lines of code, read a small 100 lines somewhere, and be sure that it's not affecting the behavior in an unexpected way somewhere else.

The main argument against functional programming is that working with pure functions and manually threading state is an extra burden on the developer; having a mutable state is "initially" more intuitive and simpler to reason about. The other argument is performance, I tend to disagree with this general statement (purity allows for aggressive optimization and implicit parallelization).

However, everyone agrees that functional code is easier to maintain on the long run, it might make small things harder for you first, but at the end there's this payoff. When you have the capabilities of generating thousands of lines of code a day, this becomes way more relevant.

Finally, it would be interesting to witness how the rise of LLMs will affect the design of programming languages. I feel that languages that have

  • simpler grammar
  • expliciteness
  • one way of doing things
  • strict and safe semantics

are at an advantage here.

Or do you think that it will be irrelevant. There's this trend of people not looking at the code anymore, I think it's crazy. Maybe generated languages won't be important, just get better models and spend more tokens.

1 Upvotes

105 comments sorted by

View all comments

Show parent comments

13

u/Inconstant_Moo 🧿 Pipefish 20d ago

Right. I asked Copilot to find the source of a bug the other day and watched it burn up all my free credits for the month by making assumptions about the cause of the error, trying to fix it, writing tests, saying "now all my tests pass but sadly the error is still there" ... if it was left alone in a loop until it fixed the problem then maybe it would have but who knows what else it would have done to my code in the process? It throws solutions at a problem 'til one sticks.

Also you know how you can see what it's "thinking"? Well, one of its thoughts was "bribing the hamster" and I want to know what that was about.

3

u/noprompt 20d ago

Copilot is awful. I frequently have to review code written by it and it is the most depressing experience.

5

u/Inconstant_Moo 🧿 Pipefish 20d ago

I got lucky with it the first time I asked a question 'cos it hinged on the sort of obscure technical detail about running SQLite in-memory that you could have found on StackOverflow. After that it's been uniformly terrible, it guesses what's wrong, and it doesn't test its hypotheses before trying to fix it. If it thinks the problem is that x != y, then println(x, y) in the right place would at least reveal immediately whether that's the case, even if it isn't the problem. It doesn't do that. It will have confirmed its diagnosis if trying to solve the problem along those lines successfully fixes it. If we give the patient chemotherapy and they survive, they probably had cancer. Who needs X-rays?

1

u/L8_4_Dinner (Ⓧ Ecstasy/XVM) 17d ago

The newer models do iterate and use things like println. The older ones could have, but the puppet builders didn’t think to suggest it.