[ANN] LuaExec - recursive multitasking for Lua

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

[ANN] LuaExec - recursive multitasking for Lua

Timm S. Mueller
LuaExec is another take on multitasking for Lua.

http://luaexec.neoscientists.org/

It is mainly focused on general applicability, simplicity and concise
semantics. It provides multiple threads of execution in the most
abstract sense, behaving understandably, platform-independently and
unencumbered by OS specific details. Demarcation:

- is a regular module using only the legal Lua API
- should work with Lua 5.1, 5.2, 5.3, and LuaJIT on POSIX and Windows
- runs a Lua interpreter per task
- recursive, a child task itself can require the module and run childs
- data exchange using messages, signals, arguments and return values
- allows to synchronize on: task completion, signals, messages
- abstract signals: a, t, c, m (abort, terminate, child, message)
- tasks can find each other by name or by parent
- no shared data, no marshalling, this is currently left to the user
- child tasks are subject to garbage collection
- underlying OS threads are always joined and never killed forcibly
- small HTTP server included as an example

Your feedback welcome,

--
Timm S. Mueller <[hidden email]>
Schulze & Mueller GbR, Jungstr. 2, 10247 Berlin,
Gesellschafter: Franciska Schulze, Timm S. Mueller,
Tel. +49 30 85610000, http://www.schulze-mueller.de/

Reply | Threaded
Open this post in threaded view
|

Re: [ANN] LuaExec - recursive multitasking for Lua

Hisham
On 21 January 2015 at 20:15, Timm S. Mueller
<[hidden email]> wrote:
> LuaExec is another take on multitasking for Lua.
>
> http://luaexec.neoscientists.org/

Hi!

I gave it a quick spin, and wrote a rockspec for it (it follows
attached — tested only on Linux, but I followed your `config` file).

> - should work with Lua 5.1, 5.2, 5.3, and LuaJIT on POSIX and Windows

I see that the .lua parts use module(), so I believe they run only in
5.1 (or 5.2 with compat flags on). Tweaking so it runs on 5.2 and 5.3
shouldn't be hard (only tedious).

I also suggest having two new build targets in the Makefile, "core"
and "httpd", to build the core libraries and the httpd example
separately. This way, we could have two rockspecs (say, "luaexec" and
"luaexec.httpd"), so one can add the dependencies on luasocket and
luafilesystem only in the second rockspec (which would, of course,
also depend on the first one).

To make your library available via LuaRocks, create an account in the
MoonRocks repository and upload your rockspecs there:
https://rocks.moonscript.org/

Thanks!

-- Hisham

luaexec-0.80r2-1.rockspec (2K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [ANN] LuaExec - recursive multitasking for Lua

Timm S. Mueller
On Thu, 22 Jan 2015 16:21:36 -0200
Hisham <[hidden email]> wrote:

> On 21 January 2015 at 20:15, Timm S. Mueller
> <[hidden email]> wrote:
> > LuaExec is another take on multitasking for Lua.
> >
> > http://luaexec.neoscientists.org/
>
> Hi!
>
> I gave it a quick spin, and wrote a rockspec for it (it follows
> attached — tested only on Linux, but I followed your `config` file).
>
> > - should work with Lua 5.1, 5.2, 5.3, and LuaJIT on POSIX and Windows
>
> I see that the .lua parts use module(), so I believe they run only in
> 5.1 (or 5.2 with compat flags on).

Yes, this is documented, and I updated the documentation in the meantime
to reflect that LUA_COMPAT_MODULE is really only needed for the example.

> Tweaking so it runs on 5.2 and 5.3
> shouldn't be hard (only tedious).
>
> I also suggest having two new build targets in the Makefile, "core"
> and "httpd", to build the core libraries and the httpd example
> separately. This way, we could have two rockspecs (say, "luaexec" and
> "luaexec.httpd"), so one can add the dependencies on luasocket and
> luafilesystem only in the second rockspec (which would, of course,
> also depend on the first one).

I would think that this isn't ready for packaging, and especially the
HTTP server, which should probably be exempted from installation.

Methinks it was a silly idea to include it, a proper tutorial would
have been more useful.

I'm working on an update, but this may take some time. Supplying an
application with a built-in HTTP server was one of my use cases to
develop against, but it may distract too much from what the package is
about.

> To make your library available via LuaRocks, create an account in the
> MoonRocks repository and upload your rockspecs there:
> https://rocks.moonscript.org/

Thank you,

- Timm

--
Timm S. Mueller <[hidden email]>
Schulze & Mueller GbR, Jungstr. 2, 10247 Berlin,
Gesellschafter: Franciska Schulze, Timm S. Mueller,
Tel. +49 30 85610000, http://www.schulze-mueller.de/

Reply | Threaded
Open this post in threaded view
|

Re: [ANN] LuaExec - recursive multitasking for Lua

Hisham
On 22 January 2015 at 17:48, Timm S. Mueller
<[hidden email]> wrote:

> On Thu, 22 Jan 2015 16:21:36 -0200
> Hisham <[hidden email]> wrote:
>
>> On 21 January 2015 at 20:15, Timm S. Mueller
>> <[hidden email]> wrote:
>> > LuaExec is another take on multitasking for Lua.
>> >
>> > http://luaexec.neoscientists.org/
>>
>> Hi!
>>
>> I gave it a quick spin, and wrote a rockspec for it (it follows
>> attached — tested only on Linux, but I followed your `config` file).
>>
>> > - should work with Lua 5.1, 5.2, 5.3, and LuaJIT on POSIX and Windows
>>
>> I see that the .lua parts use module(), so I believe they run only in
>> 5.1 (or 5.2 with compat flags on).
>
> Yes, this is documented, and I updated the documentation in the meantime
> to reflect that LUA_COMPAT_MODULE is really only needed for the example.

...and the documentation generator (though I see the docs come
pre-generated (excellent!) so that's not a problem).

-- Hisham

Reply | Threaded
Open this post in threaded view
|

Re: [ANN] LuaExec - recursive multitasking for Lua

Timm S. Mueller
In reply to this post by Timm S. Mueller
On Wed, 21 Jan 2015 23:15:15 +0100
"Timm S. Mueller" <[hidden email]> wrote:

> LuaExec is another take on multitasking for Lua.
>
> http://luaexec.neoscientists.org/

I have cleaned up the package a bit, wrote a quickstart tutorial, and
fixed some severe bugs in the process that warranted a new version.

The tutorial here:

http://luaexec.neoscientists.org/#tutorial

I'm sorry if you tried to get your head around it, missed documentation
or ran into problems.

- Timm

--
Timm S. Mueller <[hidden email]>
Schulze & Mueller GbR, Jungstr. 2, 10247 Berlin,
Gesellschafter: Franciska Schulze, Timm S. Mueller,
Tel. +49 30 85610000, http://www.schulze-mueller.de/

Reply | Threaded
Open this post in threaded view
|

Re: [ANN] LuaExec - recursive multitasking for Lua

aryajur
In windows while making I get an error that the mkdir command syntax is incorrect for the statement:

mkdir -p ../../lib/posix

I think it does not like -p. So the build is failing.

On Fri, Jan 23, 2015 at 4:32 AM, Timm S. Mueller <[hidden email]> wrote:
On Wed, 21 Jan 2015 23:15:15 +0100
"Timm S. Mueller" <[hidden email]> wrote:

> LuaExec is another take on multitasking for Lua.
>
> http://luaexec.neoscientists.org/

I have cleaned up the package a bit, wrote a quickstart tutorial, and
fixed some severe bugs in the process that warranted a new version.

The tutorial here:

http://luaexec.neoscientists.org/#tutorial

I'm sorry if you tried to get your head around it, missed documentation
or ran into problems.

- Timm

--
Timm S. Mueller <[hidden email]>
Schulze & Mueller GbR, Jungstr. 2, 10247 Berlin,
Gesellschafter: Franciska Schulze, Timm S. Mueller,
Tel. <a href="tel:%2B49%2030%2085610000" value="+493085610000">+49 30 85610000, http://www.schulze-mueller.de/


Reply | Threaded
Open this post in threaded view
|

Re: [ANN] LuaExec - recursive multitasking for Lua

Timm S. Mueller
On Fri, 23 Jan 2015 09:35:05 -0800
Milind Gupta <[hidden email]> wrote:

> In windows while making I get an error that the mkdir command syntax is
> incorrect for the statement:
>
> mkdir -p ../../lib/posix
>
> I think it does not like -p. So the build is failing.

You would have to replace MKDIR in the config file with what is
appropriate for Windows, or for the shell that you are using.

I can only recommend using MinGW

- using the MSYS shell under Windows, with which I just tested and
found LuaExec to compile flawlessly.

- A sample configuration for cross-building LuaExec using MinGW
is in etc/config-mingw-cross. This is what I am using most of the time.

> On Fri, Jan 23, 2015 at 4:32 AM, Timm S. Mueller <
> [hidden email]> wrote:
>
> > On Wed, 21 Jan 2015 23:15:15 +0100
> > "Timm S. Mueller" <[hidden email]> wrote:
> >
> > > LuaExec is another take on multitasking for Lua.
> > >
> > > http://luaexec.neoscientists.org/
> >
> > I have cleaned up the package a bit, wrote a quickstart tutorial, and
> > fixed some severe bugs in the process that warranted a new version.
> >
> > The tutorial here:
> >
> > http://luaexec.neoscientists.org/#tutorial
> >
> > I'm sorry if you tried to get your head around it, missed documentation
> > or ran into problems.

- Timm

--
Timm S. Mueller <[hidden email]>
Schulze & Mueller GbR, Jungstr. 2, 10247 Berlin,
Gesellschafter: Franciska Schulze, Timm S. Mueller,
Tel. +49 30 85610000, http://www.schulze-mueller.de/

Reply | Threaded
Open this post in threaded view
|

Re: [ANN] LuaExec - recursive multitasking for Lua

aryajur
I am using mingw. Somehow mkdir is not working for directory trees. I will have to dig into that.

Milind

On Fri, Jan 23, 2015 at 10:31 AM, Timm S. Mueller <[hidden email]> wrote:
On Fri, 23 Jan 2015 09:35:05 -0800
Milind Gupta <[hidden email]> wrote:

> In windows while making I get an error that the mkdir command syntax is
> incorrect for the statement:
>
> mkdir -p ../../lib/posix
>
> I think it does not like -p. So the build is failing.

You would have to replace MKDIR in the config file with what is
appropriate for Windows, or for the shell that you are using.

I can only recommend using MinGW

- using the MSYS shell under Windows, with which I just tested and
found LuaExec to compile flawlessly.

- A sample configuration for cross-building LuaExec using MinGW
is in etc/config-mingw-cross. This is what I am using most of the time.

> On Fri, Jan 23, 2015 at 4:32 AM, Timm S. Mueller <
> [hidden email]> wrote:
>
> > On Wed, 21 Jan 2015 23:15:15 +0100
> > "Timm S. Mueller" <[hidden email]> wrote:
> >
> > > LuaExec is another take on multitasking for Lua.
> > >
> > > http://luaexec.neoscientists.org/
> >
> > I have cleaned up the package a bit, wrote a quickstart tutorial, and
> > fixed some severe bugs in the process that warranted a new version.
> >
> > The tutorial here:
> >
> > http://luaexec.neoscientists.org/#tutorial
> >
> > I'm sorry if you tried to get your head around it, missed documentation
> > or ran into problems.

- Timm

--
Timm S. Mueller <[hidden email]>
Schulze & Mueller GbR, Jungstr. 2, 10247 Berlin,
Gesellschafter: Franciska Schulze, Timm S. Mueller,
Tel. <a href="tel:%2B49%2030%2085610000" value="+493085610000">+49 30 85610000, http://www.schulze-mueller.de/