However difficult it is to deal with, it is even harder to figure it that it is happening when you are learning a new language (lua) and a new platform (computercraft). What should be light fun becomes a soul crushing hunt for an error in your understanding of either. You have to be sure everything you're doing in your code is correct and then notice it only happens when you walk away, and with a technical understanding of how minecraft works, you can start to question what happens to turtles when you walk away and then figure out turtles reboot when you walk away. I am obviously of the opinion this is the crappiest (although most understandable) shortcomings; sorry needed to vent a little.
Aside from that, I feel like I need to point out how ironic it is that dead reckoning (which should be utterly simple for turltes in Minecraft who always move exactly one meter every time they move, with exactly NO accumulating positional errors) need GPS.
If I remember correctly, you cannot simply get your direction from GPS so only most of the state dead reckoning requires is otherwise recoverable. Also, I'm not seeing it as a general solution for any other state a turtle may require to remain consistent. I'm also concerned about how this affects group movements, but I cannot offhand find any compelling examples.
I can understand your frustration. A lot of time does have to be invested in order to get the results that you want, and sometimes it just might not be possible. However, that is the trade-off you have to make: time for versatility. I personally enjoy ComputerCraft because it offers me a mental challenge in Minecraft, where everything else is simply a matter of long hours mining or similar tasks - but that's me. Not a lot of people enjoy coding enough to invest so much time.
As to the actual reasoning behind
why computers work the way they do in regard to chunks, you have to understand how Minecraft works. Apologies if you are already "in the know", but here's the gist of it:
All computers and turtles utilize something we call a tile entity. Tile entities function like blocks, with the exception that they can, a) have more than 16 possible states or stored data, and B)/>/> they are updated every game tick. However, this extra functionality comes at a trade-off: tile entities are considerably more expensive in terms of memory and processing. Examples of tile entities are chests, pistons, signs, and of course computers.
Now by default, tile entities behave the same as any other Minecraft block - when you walk out of the chunk, everything is unloaded in order to preserve memory. However, it would be possible to make computers function as chunkloaders, which ensures that they are always loaded into memory. Of course, if computers behaved this way, you could start encountering severe lag if you have too many computers over a large area (there's a reason there are very few chunkloading blocks). So, dan200 made the decision to let users chunk load areas themselves using other mods. If all computers behaved as chunkloaders, users would be forced to either use them quite sparingly or condense them into a small area.
There are probably a few solutions that would allow computers to run autonomously from their loaded chunks, but then Dan may consider that to either be too much work to worth it or too overpowered.
Either way, I can sympathize with you but hopefully knowing why computers work the way they do will be a small consolation :)/>/>
Now, on to fixing the behavior you mentioned in your last paragraph.
you cannot simply get your direction from GPS
True, you can't get the direction from GPS directly. However, you can get it simply by moving forwards and back and checking the difference.
Also, I'm not seeing it as a general solution for any other state a turtle may require to remain consistent
I'm assuming that you refer to saving things other than movement here. Unfortunately, you're right in that you won't always be able to conclude your programs before the chunk unloads, and this could lead to some issues. The solution really is just to make your program quite versatile. There are some creative solutions for checking the surrounding area to get the state. And if you can't think of any such solutions, you could always use chunkloaders.
I also have one final thing:
If you're really unsatisfied with the way computers behave, you can always go the route of making a peripheral. This would require you to invest a good bit of time in learning how to mod, but as a whole it's not incredibly difficult and it's a very good thing to learn how to do. If you want any help doing something like this, let me know and I could point you towards some resources and help you get started.