It's not all that hopeless, actually.
Let's ignore meltdown, which seems solvable in hardware with no obvious performance loss (assuming amd's existence proof is correct), and concentrate on spectre, which everyone thinks means the world is ending.
One thing to note is that compilers have been safely speculating instructions for years. Shocking, i know :)
Processors could too.
They just weren't.
One of the cardinal rules of safe speculation is that you can't speculate an instruction unless you can prove it has no observable side-effects (ie possibly faulting, or in this case, ending up in cache), or that the side-effects are the precisely the same whether you speculate it or not (where "precisely the same" generally includes some notion of ordering of side-effect occurrence. i'm not going to get into all the various intricacies)
IE
a+b -> safe to speculate, has no side effects
load a -> generally unsafe, has possible observable side effects
if foo:
load a
else
load a
-> safe to speculate load a to right above the if, it must always be executed, and in this example, side-effects will be the same.
if foo:
load a
-> not safe to speculate load a above the if, it may not execute
Compilers generally did not speculate loads, mainly because they can fault at that level[1]. The fault comes from the processor though.
So processors were/are assuming that speculation of loads, calls, etc, had no side effects because they could "throw away the results". As the processor controlled the faulting, it could just throw away the fault and pretend it never happened.
These two attacks are just proving that is not true, and the side-effects of computation themselves are observable.
The end result should be the same. Processors speculate more like compilers do: only in safe situations.
The idea that you have to give up all speculative execution seems very wrong.
You only have to give it up in cases where there are possibly observable side-effects and it's not guaranteed they will always happen.
The upshot is the most likely outcome is that both processors and compilers will work harder to speculate.
Compilers will get called upon to do more safe speculation.
Processors will have to grow the logic to determine when speculation is safe (or figure out a way to actually undo all side effects, which is fairly hard).
Now, the downside is the most useful speculation is obviously to hide load/store latency, and those things are the hardest to reason about safety.
But like i said, compilers have been doing it for many years at this point.
Our hardware brethren just found out the hard way that they are likely to start having to do it too, and that there are more observable side-effects than they thought.
[1] Some JITs do it and catch the result in a fault handler if it turns out badly. I expect someone is going to discover ways to exploit all of these basically instantly. These will not be fixed by processor related fixes because they are not processor directed.