Actually, they are not always scripts; compiled programs were used even in the very early days of CGI programming.