From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by walapai.inria.fr (8.13.6/8.13.6) with ESMTP id q0U9DPAU016595 for ; Mon, 30 Jan 2012 10:13:25 +0100 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AvsCAGteJk9KfVK2kGdsb2JhbABDngqOe4FKCCIBAQEBCQkNBxQEIYFyAQEBAwESAiwBGxEBBAcBAwELBgULDQ0hIQEBEQEFAQoSBhMIChCHWgmbcAqLaoJvhCk/iHECBQuIMQUCAgQKAgEMBAMEAQEZIQODKXUDGgIBBoM/BJUaiwWDED2EAA X-IronPort-AV: E=Sophos;i="4.71,591,1320620400"; d="scan'208";a="129357118" Received: from mail-we0-f182.google.com ([74.125.82.182]) by mail4-smtp-sop.national.inria.fr with ESMTP/TLS/RC4-SHA; 30 Jan 2012 10:13:19 +0100 Received: by werm13 with SMTP id m13so2400015wer.27 for ; Mon, 30 Jan 2012 01:13:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; bh=ZJOZw94OclKYvKNilgL9oeY0zwG1MApUMMPE5zoFvTw=; b=mun4+TnBT8ZcnES/hVRfsW9Mc9kCf2EComunDZnS1J5P+kqrZCpdUE96Y8hr/iiuNV qE6CgMixDx0BNa93VEAaY73WCXOaxq/HPQkKD5N/CDeadeShUP6xxdbopIvLnZ8U1nY+ /M92kFju+cZ2lNj/enbg88TcAOaCzHbai6tpY= Received: by 10.216.144.160 with SMTP id n32mr491577wej.12.1327914799218; Mon, 30 Jan 2012 01:13:19 -0800 (PST) MIME-Version: 1.0 Received: by 10.227.42.208 with HTTP; Mon, 30 Jan 2012 01:12:39 -0800 (PST) In-Reply-To: References: <1327835747.19516.23.camel@samsung> <1327868178.19516.60.camel@samsung> From: Gabriel Scherer Date: Mon, 30 Jan 2012 10:12:39 +0100 Message-ID: To: Diego Olivier Fernandez Pons Cc: Gerd Stolpmann , caml-list Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by walapai.inria.fr id q0U9DPAU016595 Subject: Re: [Caml-list] SQL engine in OCaml with client side cache > You don't seem to like SQL much, which is surprising as it is kind of > isomorphic to comprehension of sets (of tuples). That's why F# added > first class SQL support with comprehension-like syntax > http://msdn.microsoft.com/en-us/library/hh225374(v=vs.110).aspx This may be a little off-topic (but who cares at this point?), but I'll take the chance to do some self-advertising here. We (Jerôme Vouillon and I) have done something related a few years ago: Macaque, a DSL for writing typed and composable SQL queries in OCaml, in a comprehension syntax. http://macaque.forge.ocamlcore.org/ http://darcs.ocamlcore.org/repos/macaque/README The comparison is that we also have something capable of typing SQL queries as parts of OCaml programs. It more or less stops here, this project is much less mature than the excellent LINQ work: it's mostly a research prototype (with a very short development time: three months) that hasn't been put to real use, mostly by lack of interested users; it's understandable that the interest of the approach doesn't compensate the cost of using a small, feature-restricted and relatively arcane library when we have relatively solid SQL bindings. By limitation of the implementation, it only supports PostgreSQL (through the excellent PG'OCaml project, a pure-ocaml reimplementation of the pgsql client protocol), and in retrospect the decision to use a comprehension syntax instead of the real SQL syntax (that can be typed all the same) is a bit unfortunate. But you may still be interested, for example as inspiration if you decide to write some database stuff in OCaml -- or, why not, as a user-developer. http://pgocaml.forge.ocamlcore.org/ For other SQL stuff in OCaml, see the Sqlite3 bindings, and possible the "ocaml-orm-sqlite" project on top of it (whose approach is to use code generation rather than a query DSL or combinator library; less flexible, but result in simpler interfaces): http://www.ocaml.info/home/ocaml_sources.html https://github.com/avsm/ocaml-orm-sqlite On Mon, Jan 30, 2012 at 12:26 AM, Diego Olivier Fernandez Pons wrote: >    Caml-list, > > [Gerd Stolpmann wrote] >> The SQL server "solves" this by deciding on a query strategy beforehand. > > What ??? I thought SQL servers shipped on-the-fly optimizing compilers > that would evaluate the query and use some heuristics (like table size > and density) to decide in which order to execute the loops + learning > on sequences of queries + on-the-fly reindexing. > > [Gerd Stolpmann wrote] >> (Just as I side note: Missing scalability has always been a problem for >> SQL databases. Currently, many companies go away from this technology >> for their giant data warehouses just because of this. Of course, these >> are not read-only, but read-write, but even having read-only scalability >> would be a big achievement.) > > Mmm... I thought relational databases were a universal object, in the > mathematical sense meaning any other object maps into them. What do > they use if not relational databases ? > >> And an ugly parser :-( > > You don't seem to like SQL much, which is surprising as it is kind of > isomorphic to comprehension of sets (of tuples). That's why F# added > first class SQL support with comprehension-like syntax > http://msdn.microsoft.com/en-us/library/hh225374(v=vs.110).aspx > > The idea being probably that on top of a certified whole-program > optimizing compiler, pattern matching optimizer, multi-core capable > garbage collector and generalized lexing/parsing library, functional > language implementers will also have to write an optimizing SQL / > comprehension engine. > >        Diego Olivier > > -- > Caml-list mailing list.  Subscription management and archives: > https://sympa-roc.inria.fr/wws/info/caml-list > Beginner's list: http://groups.yahoo.com/group/ocaml_beginners > Bug reports: http://caml.inria.fr/bin/caml-bugs >