My personal experience is that somewhere between 10 and 20% of professional programmers are women, and a similar or slightly higher fraction of CS majors.
I've heard the number 1-2% batted around for the fraction of female open source developers (i.e. 10x less than the professional rate). It's hard to find good sources, but this site suggests that it's higher now:
http://geekfeminism.wikia.com/wiki/FLOSS
Although some of these numbers are about conference attendees and speakers, and is looks like there have been dramatic increases there, probably because of conscious effort. (I think this is probably a good thing; I rarely attend conferences, but an all-male dynamic can be depressing.)
What wikipedia and open source have in common is "text-based interaction", and I think that is offputting to some people, in particular women. I don't think it is surprising that female programmers would prefer interaction in a workplace or school to text-based interaction.
Likewise, you could infer that Hacker News probably has a lower fraction of women than the fraction in the startup/YC community, because it's very text-based. And looking at the top posters list, I think that inference would be correct!
(I'm curious who the top female on this list is: https://news.ycombinator.com/leaders)