Hi!
I'm participating in a discussion in the progfun course on Coursera (Scala
based). Interesting discussions are going on there, especially when Clojure
is involved. I was wondering if something like
Slick<http://slick.typesafe.com/>would be doable in Clojure. I've no experience
with Slick (and very little
with Scala), but from a learning perspective I was wondering if I could
write something like it in Clojure (another good, probably advanced,
exercise that maybe I could do in the future to improve my Clojure-fu).
Here the relevant portion of the comment that made me think:
[...] if at runtime you can get the metadata inferred by the compiler and
> the syntax tree used, then this allows for libraries like LINQ in .NET ...
> i.e. reuse of existing syntax to issue queries to a DB or to offload
> processing to a GPU, all while keeping type-safety. The point being that
> you do not care about how those queries are going to get processed, you
> just issue queries using standard syntax and let the provider compile and
> execute those queries. You can also change the implementation on the fly,
> as easily as you can change between a LinkedList and an ArrayList in Java.
> The macros support and the compiler refactoring happening in Scala 2.10 is
> awesome and you should checkout Slick, which is the LINQ alternative for
> Scala: slick.typesafe.com.
>
> Here's a sample:
>
> val l = for {
> c <- coffees if c.supID == 101
> } yield (c.name, c.price)
>
> Where "coffees" can represent anything, from a collection of in-memory
> objects, like a linked list, to a database table or a MongoDB collection.
> And the filtering could be implemented in whatever is best for the
> collection type, from parallel filtering by multiple threads to issuing the
> right SELECT to a MySQL, or the right API call to MongoDB. Same syntax,
> same type-safety, polymorphism at its best.
>
> I've never seen such a library for LISP, with all their support for
> multimethods, homoiconicity and macros.
>
Sounds quite complex, but I'm thinking mainly about the syntax part: same
syntax different implementations in the background. From an intuitive point
of view, it should be possible I think but I'm wondering what would be the
best approach to do this.
(M)
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to [email protected]
Note that posts from new members are moderated - please be patient with your
first post.
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en