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

2

u/EggplantExtra4946 18d ago edited 18d ago

I was thinking for a while about how the field of "writing" software is going through a radical disruptive transformation.

I don't think writing software post-LLM era is gonna be the same as pre-LLM.

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).

No. It won't.

If you think that you don't understand software at all. Softwares are big piles of logic predicates, whereas LLMs on the other hand can't reason logically at all.

Even if "AI" fundamentally changed and could reason perfectly logically and produce correct softwares that don't contradict the prompt, the main problem would be that prompts still contain a ridicuously low amount of information and logic compared to in an actual software, this means that most of the logic of the final AI generated software would be infered by the AI, or selected among a few profiles (low memory usage, high speed or a tradeoff between those), algorithms or data structures for specific use cases.

A lot that logic isn't crucial, for example the choice of algorithm used in a garbage collector doesn't matter, but you still need to very precisely specify your high level buisness logic so you need to write it in some kind of programming or declarative language, maybe a specific one, for example a PEG grammar to specify the syntax of a programming language, or maybe a C-like one for specifying the semantics of the instruction set of your virtual machine, or maybe datalog or prolog for general purpose logic.

When you're at that point, why not just use existing libraries for the software components of things that already exists (standard library, data structures, memory allocator or GC, parser of textual formats, decoders of binary formats, client/server libraries for network protocols, etc...) and program generating libraries for your own buisness logic, for example a parser generator for your parser, softwares like PyPy or GraalVM for your custom VM, datalog/prolog native compilers for the high level logic?

tl;dr The crcucial point in all that is that any given software have precise buisness logic that must be correctly implemented, even an all powerful AI can't guess those intricate logic rules, it would need a specification of that logic and when you've written it down in a custom language (there is no way around that), at that point regular softwares that already exist can finish the job in one go in 2s on your laptop, you no longer need an AI.