![]() We argue that domain-specific embedded languages (DSELs) expressed in higher-order, typed (HOT) languages, Haskell in our case, provide a composable framework for domain-specific abstractions that is of greater utility than a collection of stand-alone domain-specific languages: Programmers are exposed to the accidental complexity and idiosyncrasies of the particular database binding, making code harder to write and less robust against the vendor's fads. This makes programming needlesly complex. Programmers have to distinguish between at least two different languages, SQL and the scripting language that generates the queries and submits them to the database engine (Perl, Visual Basic). ![]() Programmers get no (static) safeguards against creating syntactically incorrect or ill-typed queries, which can lead to hard to find runtime errors. This low-level approach has many disadvantages: What is common to all the above database bindings is that queries are communicated to the database as unstructured strings (usually) representing SQL expressions. On Unix platforms this is usually done via ODBC, under Windows there are confusingly many possibilities such as ADO, OLE DB, and ODBC. Hence is is not surprising that database vendors provide hooks that enable client applications to access and manipulate their database servers. Sometimes, servers are even running directly on a database engine that generates pages from database records on-the-fly. For instance, a web site is usually a fancy facade in front of a conventional database, which makes the information available in a convenient browsable form. In particular we apply this idea to implement Haskell/DB, a domain specific embdedded compiler that dynamically generates of SQL queries from monad comprehensions, which are then executed on an arbitrary ODBC database server.ĭatabases are ubiquitous in computer science. We sketch a general design pattern for embedding client-server style services into Haskell using a domain specific embedded compiler for the server's source language. Usually, embedded domain specific languages are build on top of a set of domain specific primitive functions that are ultimately implemented using some form of foreign function call. Such a framework is of greater utility than a collection of stand-alone domain-specific languages. POBox 80.089, 3508 TB Utrecht, The NetherlandsĪbstract Domain-specific embedded languages (DSELs) expressed in higher-order, typed (HOT) languages provide a composable framework for domain-specific abstractions. October 3-5, 1999, Austin, Texas ĭomain Specific Embedded Compilers Domain Specific Embedded Compilers Paper - Proceedings of the 2nd Conference on Domain-Specific Languaes, Proceedings of the 2nd Conference on Domain-Specific Languaes,
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |