Quantcast

[ANN] Lua table serializer

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[ANN] Lua table serializer

Martin
-- Lua table serializer

details = {
  intention = 'Serialize data to machine-and-human readable format.',
  requirements = {'Lua 5.3'},
  license = 'GPLv3',
  priorities = {
    fast = 0,
    simple = 0.4,
    flexible = 0.6,
  },
  handles = {
    cycles = true,
    metatables = false,
    threads = false,
    userdata = false,
    functions = false,
  },
  installation = {
    '$ git clone https://github.com/martin-eden/lua_table_serializer',
    '$ cd lua_table_serializer',
  },
  usage = {
    "require('workshop.base')",
    "local table_to_str = request('!.formats.lua_table_code.save')",
    'print(table_to_str(_G))',
  },
}

-- Martin

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [ANN] Lua table serializer

Charles Heywood
I'm on phone so can't read all that well. Any deserialization that doesn't depend on load() ?

On Sun, May 14, 2017, 4:06 PM Martin <[hidden email]> wrote:
-- Lua table serializer

details = {
  intention = 'Serialize data to machine-and-human readable format.',
  requirements = {'Lua 5.3'},
  license = 'GPLv3',
  priorities = {
    fast = 0,
    simple = 0.4,
    flexible = 0.6,
  },
  handles = {
    cycles = true,
    metatables = false,
    threads = false,
    userdata = false,
    functions = false,
  },
  installation = {
    '$ git clone https://github.com/martin-eden/lua_table_serializer',
    '$ cd lua_table_serializer',
  },
  usage = {
    "require('workshop.base')",
    "local table_to_str = request('!.formats.lua_table_code.save')",
    'print(table_to_str(_G))',
  },
}

-- Martin

--
--

Software Developer / System Administrator
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [ANN] Lua table serializer

Martin
On 05/14/2017 02:08 PM, Charles Heywood wrote:
> I'm on phone so can't read all that well. Any deserialization that
> doesn't depend on load() ?

No, it implements reverse task - serialize table to string with lua
code. (Most challenging part was cyclic tables with table keys.)

AFAIK there are "Ser" by gvx and "serpent" by pkulchenko for same task.
(I've not tried them as my fun was in writing this by myself.)

-- Martin

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [ANN] Lua table serializer

steve donovan
On Mon, May 15, 2017 at 9:20 AM, Martin <[hidden email]> wrote:
> AFAIK there are "Ser" by gvx and "serpent" by pkulchenko for same task.
> (I've not tried them as my fun was in writing this by myself.)

How many of my projects have started this way ;)

I like that you're handling edge cases. They are harder than the rest.

Loading...