[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Database languages (was Re: Macros Make Me Mad)



Sundar Narasimhan wrote:
> Personally speaking, if any of the LL languages could demonstrate such
> deep integration w/ SQL (esp. wrt dynamic tables etc.) that could be
> something genuinely new and worth looking into.

Take a look at SchemeQL - there's a paper about it here:
http://schematics.sourceforge.net/schemeunit-schemeql.ps
The paper also covers SchemeUnit, a unit testing language.  SchemeQL is
covered in the second half of the paper.

Towards the end of the paper, there are some nice examples of how SchemeQL
queries map to SQL queries that are 3 or 4 times bigger.

> Agreed. But the procedural API's (such as JDBC/ODBC, SQLJ etc. are not
> much better). Java is particularly bad in this respect, and results in
> equal (or worse) amounts of code duplication because you can't easily
> write before/after methods. Some say this is due to lack of true
> closures, some say it's because of "try/catch" semantics .. which do
> not interact well w/ procedural API's for controlling transaction
> boundaries.. whatever.

For Java, take a look at the object/relational persistence and query
service, Hibernate: http://hibernate.sourceforge.net/.  In addition to
supporting transparent Java object access to relational data,
it provides a query language which, a little like SchemeQL, can be much more
concise than SQL.

Anton