I feel 'leaving a legacy' would be dying knowing that your work left some tangible mark on humanity that you shared the planet with. It doesn't have to change people lives twenty years from now. Just the fact that my creations were enjoyed by hundreds of thousands of people in an year(or five years) is the satisfaction most people would happily die with and would include in 'legacy'. Of course there is a different spectrum of 'legacy' for different profession and depending on your work the value of 'legacy' would fall somewhere in the spectrum specific to your work. So comparing 'legacy' across professions might not even make sense as long as you are helping thousands(or some higher number) of people. And as others have said, I believe 'impact' is a better word for hacker/scientific community than legacy.