couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alexander Shorin (JIRA)" <>
Subject [jira] [Commented] (COUCHDB-1842) Lua native query server
Date Fri, 28 Jun 2013 14:34:24 GMT


Alexander Shorin commented on COUCHDB-1842:

As far as my Erlang knowledge let me read the sources, there need to not just eval(<<"lua
code">>) but prepare VM state using [luerl_emul:set_global_key|].
So we init Lua VM first with [State0 = luerl:init()|],
then preparing base environmet with [State1 = luerl_emul:alloc_table(State0)|]
and then updating it with `luerl_emul:set_global_key`. When environment is done, executing
Lua code with [luerl:do(LuaCode, StateX)|].

It also looks possible to bypass Erlang functions to Lua VM, so we may use json library or
some set of functions to work with Erlang's proplists inside.

There are some advanced examples available in [Google Group|!forum/luerl].
> Lua native query server
> -----------------------
>                 Key: COUCHDB-1842
>                 URL:
>             Project: CouchDB
>          Issue Type: New Feature
>          Components: View Server Support
>            Reporter: Alexander Shorin
> [Luerl|] - an implementation of Lua in
Erlang. It's runs as within separate Erlang process within controllable environment (so we
could specify only safe functions for global namespace). It will be awesome to have this in
CouchDB as additional query server to Javascript / CoffeeScript which could be enabled by
default and utilize all Erlang's features and still be safety for custom code execution. 
> Sure, it could be implemented as standalone CouchDB plugin like GeoCouch, but why not
to have batteries included to gather more power?(:
> P.S. Some [presentation video|] about.
> P.S.S. License according most active develop branch is [Apache 2.0|]

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see:

View raw message