What a sad sad day.
Even countries with gun control have instances like this (but they're arguably less frequent), and some countries with lots of guns have almost no problems like this at all (Switzerland for instance).
Just trying to imagine dropping a grade school kid off at school to find them dead in the afternoon from an insane thing like this I find that I can't do it, it is just too far from what I can still imagine. And I have a pretty rich imagination...
This world could be so nice, why does it have to be such a crappy place?
My family home schools our children. It coincidentally helps solve this particular problem. (Perhaps it also reduces the likelihood that we spread viruses like the flu).
Making public education more distributed by the use of technology could certainly help with security.
Even so, this represents, very optimistically, a dozen or two hours of interaction with others a week. It cannot hold a candle to the interaction children going to schools experience.