3 ms·
> So, why do AI companies generate code like this? The question of why AI is used to generate imperative or functional code instead of declarative code … is “S
by Nevermark 3y ago
> So, why do AI companies generate code like this?
The question of why AI is used to generate imperative or functional code instead of declarative code … is “So, why do programmers write code like this?”
It is the same issue, with essentially the same pros and cons.
Declarative is the best approach to code - when it works the best. But today declarative languages tend to be more domain specific, so not the best for a large proportion of code.
And also are not really purely declarative. Serious performance improvements still accrue to tuning the “declarative” code to the details of specific implementation models. I.e. to knowledge of specific databases.
—
In a way, AI language models have become the most general, if not the most reliable, declarative tools of all time.
Archiving LLM code generation conversations along with related code is helpful. Easy informal way to document intention.
In a few years a lot of source for casual and non-critical code may be natural language defined entities along side traditional source.
- QueensGambit 3y ago"In a way, AI language models have become the most general, if not the most reliable, declarative tools of all time." Yes, this might happen. In that case, human language would become the declarative language for building software. However, human language is ambiguous and would lead to unpredictable software. Lojban was created for this purpose—to be unambiguous and facilitate machine understanding. Perhaps, an unambiguous subset of English could be the declarative language of the future.
- Nevermark 3y agoI can imagine a natural language declarative project definition, used to generate an implementation by a model. When the natural language specification "source" is updated, the model takes into account the change, and the current implementation, and makes the change in a low impact way. Similar to how developers today would respond to a changing spec, while maintaining strong continuity in the implementation. Only change what you need to.