by silentbicycle · 17y ago · 0 comments
I've played with it a bit and it seems well-designed, but at the time I hadn't done much serious with Erlang, and felt it would make more sense to learn the Erlang idioms (supervisor trees, etc.) from Erlang itself and come back to ConcurrentLua later. I'm very interested in it, though - Lua is one of my favorite languages.
It also seems to be the work of one grad student, who since graduated (and may have moved on). OTOH, it's a rather small project, since Lua (as with Scheme and Termite) already provides most of the necessary infrastructure in the core language (it's mostly a scheduling wrapper for coroutines and some distribution primitives), so forking it wouldn't be terribly difficult.
concurrentlua seems more maintained, though; it showed up on luaforge more than a year ago and its latest update was in May, which to me means that the creator is interested in continuing the project. I believe this is the paper that introduced concurrentlua:
http://docs.google.com/gview?a=v&q=http://www.google.com...
luaproc's luaforge page is here, for comparison's sake:
IIRC, luaproc was put up on luaforge because people on the mailing list read the paper and started asking if the source was available.
There are also about a half dozen other concurrency packages for Lua, which at first seems rather odd. As a language, it has quite a few semi-official extensions, but unlike Scheme (with its standard and several implementations), it's because the language designers are very serious about keeping the core language small and portable for embedding. You can import the ~800k of source into your project tree and fork it as necessary, compile it down to a ~200k library, etc. In practice, this means that people contribute Lua extensions that help it can work nicely with whatever funky C++ game engine they're using, etc., as well as more general libraries.
So http://metalua.luaforge.net/ has an implementation of pattern matching as one of it's shipped examples. Do you know if ConcurrentLua could be used with pattern matching. or is it designed such that, as it stands, pm would be useless.
After wondering before, I just checked the source. In message.lua, receive just takes an optional timeout. It'd be easy to have it take an optional function argument that tests each message in turn (since it's just a list of messages, modified in place), and returns a true if that message should currently be used. I'll test and submit a patch for it later. Not as flexible as pattern matching, but PM would be better off in the base language. As for integrating Metalua's PM with selective receive, I'm not sure.
[1]: http://concurrentlua.luaforge.net/reference.html