When someone succeeds in this and goes out, the other players may lose a fixed amount, or may be penalised according to the number of unmelded cards they have left.
Here the aim is simply to form your whole hand into sets as soon as possible. David Parlett's History of Gin Rummy, originally published on the Game Account site, also includes some material on the history of Rummy games in general. Although they are now widepread throughout the world, games of this sort were unknown outside the orient until the twentieth century.
Rummy games seem to be ultimately of Chinese origin. The basic move is to draw one (or more) cards from an undealt stock or from the (face up) discard pile, possibly meld a set or sets, putting them face up on the table, and then discard a card. In this large group of draw and discard games, the object is generally to improve one's hand by forming it into sets of matching cards (usually groups of the same rank or sequences in a suit).