3 ms·
The A.I. assistant has to use "old A.I." techniques that explicitly model the difficult things about Rust, particularly, the borrow checker. It's the same wa
by PaulHoule 4y ago
The A.I. assistant has to use "old A.I." techniques that explicitly model the difficult things about Rust, particularly, the borrow checker. It's the same way there is a well-defined theory of how to do arithmetic and if you want do arithmetic you use that theory, you'd don't screw around with other things.
There was a lot of hand-wringing about the difficulty of software reuse in the late 1980s, retrospectively a big part of the problem is that memory management is a global concern. How does a library get access to memory it needs to do its job and how do you know when to free it when possibly the library might need to use it later or possibly the application does.
From that viewpoint the garbage collector was more important than object-orientation, inheritance and such for code reuse in Java because with the garbage collector the interface for managing memory between libraries and applications doesn't need to be defined. Buffers just go away when you don't need them anymore. When you look at people struggling with Rust this is one of the major problems: you can compose two systems that use garbage collection and it "just works", but put together two systems that use borrow checking and it may or may not work.
It's easy to look at "fighting with the borrow checker" as a local problem but it is really is a global problem of having a consistently correct strategy across your application and its dependencies. It is where ChatGPT goes to die because it is always going to use heuristics that work locally but doesn't have any "understanding" (a theory) of the borrow checker.
People were talking about building "expert systems" for this kind of task circa 1980 and a modern approach might combine an LLM with a theorem prover much like the way AlphaGo combines an old A.I. search algorithm with a neural heuristics.