November 20, 2008, 10:54:57 am *
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Raising the abstraction level of SQL?  (Read 13073 times)
KirillOsenkov
Newbie
*
Posts: 11


« on: May 11, 2007, 09:08:27 pm »

Hi all,

Semmle's vision sounds very promising to me. I'm a newbie to query languages, but I'll just share my opinion anyway. I've seen an SQL script recently where some action was carried out for every database in the system. What striked me was the fact, that just enumerating the databases took > 100 LOC. Basically, it was like this:
  • check if a temporary table exists, and if yes, drop it
  • create a temporary table
  • select all databases
  • filter out system databases
  • write the results to the temp table
  • while there is a record in the temp table
  • process the record
  • delete it from the temp table
  • repeat until temp table empty
  • drop the temp table

I mean c'mon, isn't that just too low level? My impression was that SQL was definitely not expressive enough for this particular purpose. And, SQL is poorly (if at all) extensible. There is no (or hardly no) syntactic sugar. The syntax is awkward only for the sake of easy parseability.

So my opinion is that it's just about time to start filling the gap with query languages and I'm glad to see Semmle doing such a terrific job in this area. It would really be great to have expressive, powerful, flexible and extensible languages and tools specifically created and optimized for querying.

I wonder, what long-term strategy would be the best for query languages? Looking at general purpose programming languages, I can see two trends. First is creating a microkernel language (like Lisp or Nemerle) and allowing users to extend it themselves using syntactic macros or quasi-quotation. The second is explicitly disallow extending the language (like C#), but instead carefully choosing and hard-coding distilled most-wanted features manually. Both ways seem to be promising, so I wonder what path will .QL go... Smiley

Anyway, best successes and I'll keep in touch.
Thanks,
Kirill
www.osenkov.com
« Last Edit: June 14, 2007, 09:11:49 pm by KirillOsenkov » Logged
Semmle Coders
Newbie
*
Posts: 13


« Reply #1 on: May 13, 2007, 02:04:57 pm »

Hi Kirill,

Thank you for your interest. It's true that SQL is often very verbose, especially compared to .QL: a .QL query of a few lines often translates to several pages of optimized SQL! Besides, the object orientation of .QL makes it more modular and encourages code reusability.

Thus, .QL is clearly much more pleasant than SQL when it comes to querying complex data. Having the same level of functionality as SQL, however, would require the addition of imperative constructs. We think this approach would be promising as a way to specify load operations in .QL for instance.

Regarding the last part of your message, we are clearly on the second path, carefully adding useful features into the language: we are now working on supporting nested select queries.
Logged
Pages: [1]
  Print  
 
Jump to: