On Sat, May 01, 2010 at 09:25:54AM -0400, Tim Romano scratched on the wall:

> In part, this is a very broad question but I hope it's not unacceptable.
> From a birdseye perspective, what is involved in integrating an interpreted
> scripting language with a database engine?

  A number of people have looked into adding some kind of PL/* language
  to SQLite so that you can store functions, etc., in the database
  itself.  There are third-party folks working on a PL/SQL extension
  that converts stuff to compiled code, but that's a bit different
  since it isn't tied directly to the database.

  It is extremely unlikely anything would ever end up in the core.
  The biggest issue is license.  I know of no public-domain scripting
  language implementations (that are worth using).  Language systems
  also tend to be big and tricky to test.  So you'd still need the
  correct extension, but you could use the same extension for every
  database.

  Adding support for functions, aggregates, and collations is easy
  enough.  Many of the scripting language API wrappers already include
  stubs that allow functions, etc., to be defined in the scripting
  language.  Triggers are a bit more difficult, unless you can can
  reduce the logic down to a function.  The issue is passing the row
  state in and out of the function.  There may be some clever way of
  doing it deeper in the library, but I'm not sure it is possible with
  the public API.



  I'd love to see a Lua extension.  I know that's been proposed. Lua is
  MIT licensed, small, fast, and reasonably mature.  It is also designed
  to be easily embeddable, making it a good fit. I realize many of you
  may not know about Lua, but it is heavily used in a number of specific
  areas, including the game industry, where it is *the* behavioral
  and AI language, mostly because it is easy to learn, easy to embed,
  and will compile on just about anything.      http://www.lua.org/

    -j

-- 
Jay A. Kreibich < J A Y  @  K R E I B I.C H >

"Our opponent is an alien starship packed with atomic bombs.  We have
 a protractor."   "I'll go home and see if I can scrounge up a ruler
 and a piece of string."  --from Anathem by Neal Stephenson
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to