lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On Tue, Jan 20, 2015 at 5:45 PM, Timm S. Mueller
<tmueller@schulze-mueller.de> wrote:
> On Tue, 20 Jan 2015 18:15:48 -0500
> Sean Conner <sean@conman.org> wrote:
>
>> It was thus said that the Great Timm S. Mueller once stated:
>> >
>> > I shouldn't have written that "Lua would be fine", because I am more
>> > after a dumper written in C. Any candidates? Maybe I will simply pick a
>> > Lua one and transfer it to C. And I'm still taking MsgPack and JSON
>> > format into consideration, too, despite some limitations.
>>
>>   Any reason why C over Lua?  The performance shouldn't be that different
>> between the two.
>
> For two reasons, performance, and the possibility to include it into a
> bigger C library. I'm in the process of writing said C library (yet
> another take on preemptive multitasking), and I'm still undecided if
> there should be built-in support for serialization of messages (and
> possibly arguments and return values), or if it should be left to the
> user's discretion what is carried in strings, and how. If I started
> looking into such a library as a user, I think I would appreciate
> included support.
>
> - Timm
>
> --
> Timm S. Mueller <tmueller@schulze-mueller.de>
> Schulze & Mueller GbR, Jungstr. 2, 10247 Berlin,
> Gesellschafter: Franciska Schulze, Timm S. Mueller,
> Tel. +49 30 85610000, http://www.schulze-mueller.de/

I've been been surprised by the performance of the pure lua JSON
serializer that we use. If something like that ends up working for
you, it may be reasonable to include Lua in your bigger C library and
to write a C wrapper around the Lua serializer. Obviously not as fast,
but this approach lets you audition the protocol separately from the
implementation. After tweaking it, rewrite the slow bits (or all of
it) in C. Lua isn't a bad dependency to have around?

-Andrew