• TomThomson (3/30/2015)


    sknox (3/30/2015)


    ZZartin (3/30/2015)


    Let's be honest requiring statement terminators is to make life easier on the developers writing the syntax parser not because there is any inherent value in a ;

    That is not the case. Statement terminators don't only make the developers' work easier, but the query parser's as well. A parser with extra code to handle situations which would be clearer with a terminator will use extra CPU time and delay query results.

    As a very simple example, your statement took a small amount of extra effort on my part to parse properly, because you're missing a terminator in there.

    I believe it's been demonstrated (more than 50 years ago) that if two languages are identical except that one uses statement separators and the other uses statement terminators, and they allow compound statements, the one using separators costs less to parse. But if they don't have complex statements the parsing complexity of the two is identical (since they are syntactically identical, differing only in the terminology used to describe them). So the terminator case is never easier to parse.

    That's interesting, and I'd love to see your reference for that. Specifically, I'd like to know if that was proven for languages with terms that can perform as different parts of a statement (such as T-SQL's WITH, which can indicate options for an DDL statement or the beginning of a CTE statement.)

    I'd also like to know if that proof included languages with neither statement terminators nor statement separators, as that is more akin to the current state of T-SQL.