Showing posts with label sicp. Show all posts
Showing posts with label sicp. Show all posts

Not Lisp Again...

a first exposure to Lisp

"I was floored. Here we take the simple, straightforward definition of the derivative of a function. Type it in with essentially no modification and suddenly the computer knew how to do calculus! This was serious magic. I had never seen anything like it before."

Had similar feeling while watching recently SICP video lectures.

Lem-E-Tweakit and Logic programming



from SICP lectures 8a & 8b.

While watching these, one thing that striked me is that this logic programming seems very similar to kind of things we use SQL for, just better... more flexible.

So why we do use SQL after all? after a bit of googling found this good article: http://search.cpan.org/dist/AI-Prolog/lib/AI/Prolog/Article.pod one of the references says:

So if prolog(read AI) and SQL(DB) are so similar, Why is one so successful commercially and the other deemed A complete failure in terms of scalability?

Databases implement powerful techniques to improve performance:
  • Indexing
  • Hashing
  • reordering goals to reduce backtracking

Where as prolog based systems have very few such Techniques.

So does have SQL have everything needed?

One of the most powerful features of Prolog is recursion.

SQL does not have recursion built into it. This is a severe Handicap. However there is a way to overcome this problem by invoking multiple SQL queries from a host language like C
Or JAVA. SQL3 has begun supporting recursion.