What's the big deal is that "big undos" are an annoyance, not a major problem, and I want to be distracted by as few annoyances as possible. "I want to go back 30 seconds" is not the same as "I want to go back 30 minutes", and no one here is suggesting that you shouldn't regularly commit code. Your "solution" is at least as annoying as the problem I have, so it's not a fucking solution. Tree undo is the solution.
git rekt
Git is a tree which you can undo so you must simply want a git but smaller; a tiny git that automatically records all of your typos and brainfarts for future use, I understand completely.
What would it look like if we could visualize the undo history of a program? A fractal monolith of trying and failing to type the right acronym to get autocomplete to catch on probably
Ah, the national anthem of Git. All rise!
My big issue with Git (and to be fair, many systems, not just in source control) is that while it's rightly praised for its ability to handle the most complex 0.00001% of situations - Linus mucking around in the guts of a 50-way merge on a hotfix for the kernel or whatever - it just doesn't scale down very well to the least complex situations.
I think it's mostly a user experience thing, you have all these various actions with very specific implications, and for example if you perhaps switch branch with uncommitted changes you'll lose them. It makes sense if you think about it, you are replacing project structure after all, but it's not exactly very friendly. I think a good wrapper smooths over the rough spots, and in my experience using it with various IDEs it does. Press button make commit, right click on thing make new branch, branch with uncommited changes get a warning, easy.
This is just kind of a general issue with open source isn't it? Beautiful theory and implementation without so much as a thought to the average user, tbf it's not much better with commercial products a lot of the time, but at least they theoretically have some motivation to actually suit the product to the common user
Elaborating on the ZGC thing, on windows you could pretty easily create the mirror mapping with one of the MapViewOfFile functions from Memoryapi.h, but I'm still not really sure how you'd go about catching dereferences of remapped references. I can sort of imagine doing something with signals —E.G. unmapping the mirrors of the heap before remapping and just catching the resulting SIGSEGVs with a handler, but I'm not sure how you'd then return to the function with the corrected reference though.
libsigsegv seems like it might be a good starting point, and they even advertise it's utility in GC and custom paging systems in it's features. Seems like the issue beyond catching the fault would be to actually change the reference in whatever register/memory address it's been stored, and you'd need to interpret the offending op and correct the specific register or something, seems like an absolute nightmare.
Impressive those java people managed it, and hey maybe java's limitations worked in it's favor by making the problem scope more manageable