Module Compress Deflate Lua |
|
|
This module "compress.deflatelua" implements DEFLATE [1] and gzip/zlib decompression in pure Lua. |
This module compress.deflatelua implements DEFLATE [1] and gzip/zlib decompression in pure Lua. |
|
Here are pre-release files. I'm still working on the LuaRocks and LuaDist packaging. There are no docs at the moment. |
|
Download: |
|
* [lua-compress-deflatelua-0.1.0.zip] compress.deflatelua - [github] * Dependent modules: * [lua-digest-crc32lua-0.1.0.zip] digest.crc32lua - CRC-32 checksum implemented in pure Lua - [github] * [lua-bit-numberlua-0.1.0.zip] bit.numberlua - bitwise operations implemented in pure Lua as numbers - [github] * [lua-pythonic-optparse-0.1.0.zip] - Command-line processing resembling Python optparse module - [github] |
|
* [compress.deflatelua] (github page) [documentation] * Dependencies: * Lua 5.1, Lua 5.2, or LuaJit * One of the following modules for BitwiseOperators: * [bit.numberlua] - bitwise operations implemented in pure Lua as numbers ([documentation]) * [LuaBitOp] 'bit' library (included in LuaJit). * Lua 5.2 'bit32' library [documentation] * [digest.crc32lua] - CRC-32 checksum implemented in pure Lua (optional; CRC calculations can be omitted) [documentation] * [github] - Command-line processing resembling Python optparse module - (optional; command-line tool can be omitted) [documentation] |
|
It's somewhat slow (as expected). To decompress lua-5.1.4.tar.gz, it takes about 9 seconds with CRC-checking enabled (4 with LuaJIT 1.x) or 3 seconds with CRC checking disabled (2 with LuaJIT 1.x). |
|
It's somewhat slow (as expected). To decompress lua-5.1.4.tar.gz using bit.numberlua, it takes about 9 seconds with CRC-checking enabled (4 with LuaJIT 1.x) or 3 seconds with CRC checking disabled (2 with LuaJIT 1.x). It's faster when using native bitop libraries, particularly under LuaJit. |
|
The modules are being packaged to be usable in LuaRocks and LuaDist. |
|
The modules are being packaged to be usable in LuaRocks and LuaDist. (I'm still working on the LuaRocks and LuaDist packaging.) |
|
More notes here are expected later. Comments welcome. |
|
More notes here are expected later. See [compress.deflatelua github page]. Comments welcome. |
|
* This module is used by [sqush][1] - packs Lua code (compression and archiving) |
|
* This module is used by [squish][1] - packs Lua code (compression and archiving) |
compress.deflatelua implements DEFLATE [1] and gzip/zlib decompression in pure Lua.
Download:
Example:
It's somewhat slow (as expected). To decompress lua-5.1.4.tar.gz using bit.numberlua, it takes about 9 seconds with CRC-checking enabled (4 with LuaJIT 1.x) or 3 seconds with CRC checking disabled (2 with LuaJIT 1.x). It's faster when using native bitop libraries, particularly under LuaJit.
Why? Possible reasons include these: (1) for pedagogical reasons, (2) to benchmark Lua, (3) to bootstrap applications like LuaRocks/LuaDist that might not have a precompiled copy of gunzip, and (4) because DEFLATE has been implemented in other languages too [1] (including Python, Perl, and Lisp).
The modules above follow a somewhat Perl CPAN-like naming convention. Compare to [Compress::Zlib::Perl], [Digest::CRC32], and the Bit:: modules.
The modules are being packaged to be usable in LuaRocks and LuaDist. (I'm still working on the LuaRocks and LuaDist packaging.)
More notes here are expected later. See [compress.deflatelua github page]. Comments welcome.