Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I think the most relevant papers would be:

"Relational completeness of data base sublanguages"

"A data base sublanguage founded on the Relational Calculus"

SQL is most similar to the calculus "sublanguage", so that would be the main point of reference. ISBL was an early implementation of relational calculus[1].

The The Datalog Educational System (DES)[2] is the only available implementation of relational calculus (in both its forms), and it also implements relational algebra, Datalog, and SQL!

I agree, in general it's more convenient to state "what the solution should look like", but in some cases we find it easier to give instructions to follow instead. This is true in everyday conversation between humans as well. Cooking recipes are a good example - we generally want to know the steps required, but sometimes it's helpful to add a description of what the end result should be like.

[1]: https://en.wikipedia.org/wiki/ISBL [2]: https://des.sourceforge.io/



Thanks very much! I had heard of Codd's first two languages as not being "usable by mortals" (non-mathematicians). ALPHA seems to be the first one.

Re: functional programming is a subset of relational programming. I read them as brand names, so it was revealing when you pointed out that they are literally true - formal properties. I wonder, what are their consequences?

For relations, each input can have a set of outputs. So this is like a tree at each call level, ever-expanding. (in general a call graph, not a tree)

For functions, I think it's only that one input always gives the same output, including nested functions. So, only immutability?

For injections, it's just reversibility. A cute idea, implemented by only having injective functions to compose, but hasn't taken off. I expect it's too restrictive, except when reversibility is the purpose.


Just so you know your guidance wasn't wasted: I looked into all these references, and Codd's calculus is based on predicate calculus (like Answer Set Programming), so it all seems inspired by set builder notation, all x such that ...

  { x : property(x) }
Is encryption another example of having the result (the encrypted message) but not knowing how to make it?




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: