Sean McBride Profile picture
Software Engineering Stuff (Mostly C, C++) | AI and Tech Industry Thoughts | AI-Generated Music, Photos, Videos | NOW WITH MORE MIDLIFE CRISIS!
Apr 30 5 tweets 5 min read
Uncle Bob recently described SQL as a reporting language that was never intended to be embedded into computer programs. In this thread, I dig into the original IBM Research SEQUEL academic literature to investigate this claim. 🧵👇 The original SEQUEL paper from 1974 is mostly focused on the "console language" use case that Uncle Bob highlighted. Used in this way, SEQUEL enabled direct querying by business analysts that wouldn't know what Edgar Codd meant by "first-order predicate calculus" in his relational database papers.

In fact, the language is called SEQUEL because the previous language SQUARE used terse math-like syntax, and this was considered too difficult for such non-technical business users. SEQUEL was made more verbose and English-like to be more approachable to non-technical business folks that might only run a few queries a year. Other tools designed with this target audience include COBOL, CODASYL data languages, and the RPG language.

While the paper doesn’t mention embedding SQL explicitly, it does make a few implicit references that hint that this was perhaps under consideration as a future enhancement.

First, the introduction opens as follows:

As computer systems become more advanced, we see a gradual evolution from procedural to declarative problem specification. There are two major reasons for this evolution. First, a means must be found to lower software costs among professional programmers. The costs of program creation, maintenance, and modification have been rising very rapidly. The concepts of structured programming have been introduced in order to simplify programming and reduce the cost of software. Secondly, there is an increasing need to bring the non-professional user into effective communication with a formatted data base. Much of the success of the computer industry depends on developing a class of users other than trained computer specialists.

The paper then goes on to focus on the second reason. However, the introduction begs the question: might SEQUEL also be somehow used to simplify programming and reduce the cost of software?

Additionally, the paper calls SEQUEL a "sublanguage." Does a sublanguage imply a superlanguage? If so, that term might be 1970s for "embeddable DSL."

Given the fact that relational databases were considered a next-gen CODASYL, and CODASYL was an evolution from the DATA DIVISION in a COBOL program, it seems very likely that embeddability in host languages was in the mind of IBM Researchers.

Source: dl.acm.org/doi/10.1145/80…Image