"grass mown," Old English heg (Anglian), hieg, hig (West Saxon) "grass cut or mown for fodder," from Proto-Germanic *haujam (source also of Old Norse hey, Old Frisian ha, Middle Dutch hoy, German Heu, Gothic hawi "hay"), literally "that which is cut," or "that which can be mowed" (from PIE *kau- "to hew, strike;" source also of Old English heawan "to cut;" see hew).
Slang phrase hit the hay (pre-1880) was originally "to sleep in a barn;" hay in the general figurative sense of "bedding" is from 1903; roll in the hay (n.) is from 1941.
stack n.
c. 1300, "pile, heap, or group of things," from a Scandinavian source akin to Old Norse stakkr "haystack" (cognate with Danish stak, Swedish stack "heap, stack"), from Proto-Germanic *stakon- "a stake," from PIE *stog- (source also of Old Church Slavonic stogu "heap," Russian stog "haystack," Lithuanian stokas "pillar"), variant of root *steg- (1) "pole, stick" (see stake (n.)). Meaning "set of shelves on which books are set out" is from 1879. Used of the chimneys of factories, locomotives, etc., since 1825. Of computer data from 1960.