Embedding in Erlang

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Embedding in Erlang

Henning Diedrich
Hi list,

I posted some details on how to efficiently embed Lua in Erlang here: http://www.eonblast.com/blog/optimizing-erlualib-calls/

It's about embedding Lua in Erlang as a driver port, discussing in detail how to go beyond single step stack manipulation port calls towards directly accessing the Lua C API in one go. In the end I thought the post might be quite interesting to get a feel for the issue.

Feedback and critique very welcome.

Regards,

Henning
Reply | Threaded
Open this post in threaded view
|

Lua in Nginx on Gentoo

Henning Diedrich
I plugged Lua into Nginx and it feels good. Now.

The way there was the usual 7 times harder than it should be and possibly the best practice books are all out there and I am just to dumb to find them. Let me add to the chaos and relay my path to get it up and running: http://www.eonblast.com/blog/lua-nginx-gentoo/

That's it for today.

Best,

Henning

Reply | Threaded
Open this post in threaded view
|

Re: Lua in Nginx on Gentoo

Javier Guerra Giraldez
On Tue, Nov 23, 2010 at 6:20 PM, Henning Diedrich <[hidden email]> wrote:
> I plugged Lua into Nginx and it feels good. Now.

nice howto.

another option which might be (eventually) simpler is uWSGI.  it's a
FastCGI replacement for python with a tighter protocol than FastCGI
and integrated thread/process management, and many other goodies.

it's mainly for python, but has a Lua option since a few versions ago,
and the current -dev version is becoming more modularized so you could
let out the python plugin and keep the Lua one... seems like an option
to watch.

--
Javier

Reply | Threaded
Open this post in threaded view
|

Re: Lua in Nginx on Gentoo

云帆江
In reply to this post by Henning Diedrich
nice , could it be possible to use luajit2 instead the official lua implement

On Wed, Nov 24, 2010 at 7:20 AM, Henning Diedrich <[hidden email]> wrote:

> I plugged Lua into Nginx and it feels good. Now.
>
> The way there was the usual 7 times harder than it should be and possibly
> the best practice books are all out there and I am just to dumb to find
> them. Let me add to the chaos and relay my path to get it up and running:
> http://www.eonblast.com/blog/lua-nginx-gentoo/
>
> That's it for today.
>
> Best,
>
> Henning
>
>



--
welcom to gtalk me
http://hi.baidu.com/jyf1987

Reply | Threaded
Open this post in threaded view
|

Re: Lua in Nginx on Gentoo

kevin beckford
In reply to this post by Henning Diedrich
On Tue, Nov 23, 2010 at 3:20 PM, Henning Diedrich <[hidden email]> wrote:
> I plugged Lua into Nginx and it feels good. Now.

Curious:  did you know about this project?

https://github.com/chaoslawful/lua-nginx-module

and if so, what made you decide on your course of action.  I would
like to do similar, except I'm not in a headspace to properly compare
and contrast the approaches...

Reply | Threaded
Open this post in threaded view
|

Re: Embedding in Erlang

Robert G. Jakabosky
In reply to this post by Henning Diedrich
On Tuesday 23, Henning Diedrich wrote:
> Hi list,
>
> I posted some details on how to efficiently embed Lua in Erlang here:
> http://www.eonblast.com/blog/optimizing-erlualib-calls/
>
> It's about embedding Lua in Erlang as a driver port, discussing in
> detail how to go beyond single step stack manipulation port calls
> towards directly accessing the Lua C API in one go. In the end I thought
> the post might be quite interesting to get a feel for the issue.

About a month ago I create the attached Lua module for encoding/decoding
Erlang binaries.  It would be interesting to see Erlang style processes
written in Lua (maybe using ConcurrentLua [1]) and have them send messages
back and forth with Erlang processes.

Right now it can handle most of the basic types:
integer, float, atom, string, nil, tuple, list

but not these types:
reference id, port id, pid id, binaries, bignums, functions, exports, bit
binary, new floats

Most of the unimplemented types can be stored in there binary format in-side a
Lua table (so they can have a type tag like tuples & lists) so that they can
still be passed around.

For a description of Erlang's binary term format see [2].

Tuples & lists are converted to/from Lua tables with metatables to mark them
as a tuple or list.

The module depends on LuaSocket & Roberto's struct [3] module.

LuaSocket is only used for the socket.gettime() function for creating Erlang
Timestamps (See the now() function in erlang.lua).

1. http://concurrentlua.luaforge.net/
2. http://www.erlang.org/doc/apps/erts/erl_ext_dist.html
3. http://www.inf.puc-rio.br/~roberto/struct/

--
Robert G. Jakabosky

erlang.lua (8K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Embedding in Erlang

Zark Yoc
Lua embedded in Erlang ....      oh , that's Cool... I like it....


--
�o��