Daily Thought - 2024-10-01
< back to listCode updates are very buggy right now, and even after more work, will remain imperfect for a while. For the time being, the developer will be expected to keep an eye on things, and restart the program from time to time, as necessary.
The easier problem to solve, is certainly that we can't just keep appending new code. Initially, I want to implement a code size limit, and after that's reached, the program just has to be restarted before live updates can resume. Longer-term, this can be solved using garbage collection of old code, and some kind of defragmentation maybe. Not rocket science, but it will take time.
The bigger problem is that new code might expect or produce different types than the code it replaces. This currently leads to undefined behavior, and there's no easy solution for that. We need a static type system to detect it, and I expect that to become a priority pretty soon. Then we can at least detect the problem and restart. Longer-term, more sophisticated handling should be possible.