As the increase in generative tool usage means engineers are becoming more hands-off in the day-to-day writing of code, the question becomes which language is best for an LLM to program in?
There’s a few metrics on which we can use to help with this decision. The two that come to mind are:
- The ability of the system to actually work with the code base, there’s no denying there are languages with larger corpus’ of data and in turn can work more easily with.
- The efficacy of the output. Different languages sit at different levels of abstraction and in-turn speed and optimisation.
Two libraries that are in the public eye that sit at different ends of this spectrum are Python and Rust. Generative models are great at writing Python, whilst Rust allows for very performant code.
If we have a large codebase of Python, it can be very easily reasoned about, but ends up with computationally expensive sections of the codebase. Assuming a liberal use of unit tests, in theory you could set an agent who goes and times different parts and systematically breaks it out into rust, testing the swapped out unit with the already existing test suite.