Theoretically you could relocate memory periodically in a system like Rust (or Java). This could be done so that the high level doesn't realize it has happened. It might have a fairly heavy performance cost, depending on how frequently the relocations are done and how you detect when you should do them. (scoreboard vs static analysis)
I could write a very simple language/environment where rowhammer is essentially impossible. But it would be very slow. Obvious example is that every address is looked up on a hash table to find the physical address. The application cannot see this hidden hash table, it would allow a byte granularity to relocation instead of a page granularity. It would was a tremendous amount of memory and be very slow. (basically memory layout randomization)
If you use SRAM instead of DRAM, there is no performance penalty for layout randomization. Of course, SRAM doesn't have the issue with rowhammer either.