[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Protocol Specification in Lua
- From: Alexander Gladysh <agladysh@...>
- Date: Sun, 3 Oct 2010 00:22:43 +0400
On Sun, Oct 3, 2010 at 00:16, Alexander Gladysh <email@example.com> wrote:
> On Sun, Oct 3, 2010 at 00:07, Matthew Wild <firstname.lastname@example.org> wrote:
>> On 2 October 2010 20:54, Alexander Gladysh <email@example.com> wrote:
>>> On Sat, Oct 2, 2010 at 11:33, Petr Štetiar <firstname.lastname@example.org> wrote:
>> I shouldn't think aloud, it usually comes back to bite me. But I
>> wonder how hard it would be to make a library by stripping down Lua so
>> that it only implements enough to compile and load table constructors.
>> Then you get a nice way to save/load arbitrary structures, an API to
>> iterate and manipulate them, and compatibility with normal Lua. No?
> It still would be slow. Specialized serialization library is faster.
And speed is not the only reason -- Lua bytecode is not the most
compact form when it comes to serialization (even for code -- minified
source is often smaller than compiled).
If you serialize to specialized format, you may pick more compact data
sizes (think char instead of double for a small table keys and so on).
(Alas, my luabins does not support this yet.)