(There are others, such as table, paste, and baste.) The rule I’ve heard is that a vowel is made long when succeeded by a consonant and then another vowel. Some words treat double consonants as a single consonant for this rule – hence able has a long “a”.
Why is this, and is there a rule governing such words?
In the case of haste, the general rule is that an E at the end of the word makes the preceding A (before 1 or 2 consonants) long. Paste has a long A, but past has a short A. Baste and waste have long A’s, but fast, last, mast, and vast have short A’s. Unfortunately (as often happens in the English language), there are occasional exceptions: caste has a short A.