[racket] Datalog suitable for an accounts package?

From: Wojciech Kaczmarek (wojtekk at kofeina.net)
Date: Sun Sep 18 07:59:25 EDT 2011


You can use Datalog or Racklog. In order to decide or just feel comfortable
with any of them it could be beneficial for you to grasp some basics of
Prolog; here's a decent online material:

Speaking of structures: you don't have to name the fields. Facts you state
are just relations. The position of a term in a fact denotes the meaning.
You can think about it roughly like SQL without schema definition (and with
deduction, backtracing ..etc).

The suitability is more obvious when you realize you how easy you can query
your data, provided you gained some familiarity with Prolog..



On Sun, Sep 18, 2011 at 13:15, Mark Carter <mcturra2000 at yahoo.co.uk> wrote:

> I've been in the process of writing a little financial accounts package in
> Racket. I'm wondering if, instead of writing a lot of scheme code, a lot of
> funtionality could be more expressively and concisely be written in Datalog.
> I've never used Datalog before, nor Prolog, but I know it's something to do
> with "my father's mother's sister".
> I've read the Datalog tutorial, and I wonder if it's worth digging deeper.
> Although my data is relatively simple, there are all sort of weird and
> wonderful ways that I want to slice and dice it.
> I suppose the first question is: does Datalog support structures?
> Let's say I have a concept called an "equity transaction", or etran. It has
> the fields sym (symbol), date, tag, qty (quantity) and cost.
> So suppose I bought 100 shares in Apple on Dec 28 2001 at $11.21 (I
> wish!).The symbol for Apple is "AAPL". How would I express that fact in
> Datalog (assume that the tag is just some arbitrary symbol for now)?
> Or am I completely barking up the wrong tree as to the likely suitability
> of Datalog to the problem at hand?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20110918/893738f8/attachment.html>

Posted on the users mailing list.