Open XVilka opened 6 years ago
ocaml-lzma
and most of the other "OCaml" libraries that deal with compression that I've encountered so far (apart from decompress
) are simply thin bindings to C implementations, so it is not just a simple case of salvaging the old OCaml code; you have to rewrite the compression/decompression algorithms from scratch. :(
Do we have a list of use cases where a LZMA implementation could come in handy?
@cfcs I was using Ctypes bindings to the liblzma until I realized (by pain and blood) that xz-utils are not thread safe and crash all the time. Then I switch to writing OCaml bindings for LZMA SDK from 7zip, but those are a mess do deal with (mainly by API sense). I even searched for Rust implementation of LZMA (to wrap in OCaml bindings) but it turned out incomplete and unusable: https://github.com/meh/rust-lzma
Right, but where is LZMA needed?
This compression format is very popular.
I put it (a long time ago) in my TODO list. Currently, I need to finish some side projects but I will clearly take care about that soon precisely because I need:
1) rewrite some parts of decompress
2) make a release of it with gzip
support
3) optimize process
Here is the good reference in a closer (to OCaml) language (Rust) - https://github.com/gendx/lzma-rs/tree/master/src/decode
I have a simple bindings for 7-Zip SDK in OCaml, might be some source of information too, especially regarding some arcane peculiarities: https://github.com/XVilka/ocaml-lzma_7z
In case there will be some interest, there are some test files to check against: https://github.com/xz-mirror/xz/tree/master/tests/files
Since it seems that ocaml-lzma is dead https://forge.ocamlcore.org/projects/ocaml-lzma/ and there are no libraries that provide a way to do that, it make sense to support it here too.