Show HN: CCCP – 可编程的、上下文感知的压缩协议(早期阶段)
1 分•作者: brucekaushik•9 个月前
我一直在琢磨一个想法,我称之为 CCCP——上下文感知可组合压缩协议。
大多数压缩格式将这个过程视为一个黑盒:你输入字节,你得到字节输出。我想要一些可编程和可组合的东西,其中格式本身可以适应不同的领域——甚至可以由不同的供应商定制。
到目前为止,CCCP 具有一些有趣的特性:
可组合:可以组合多个 LUT(查找表)和编码阶段。
上下文感知:解码由显式元数据引导,而不仅仅是原始字节流。
可往返 IR:中间表示可以重构最终二进制压缩之前的原始逻辑。
可编程:供应商可以插入他们自己的 LUT、编码器和解码器。
目前还处于早期阶段,还在实验中。很想听听是否有人见过类似的方法,或者这在实际应用中可能会在哪里失效。
仓库:
[https://github.com/brucekaushik/cccp](https://github.com/brucekaushik/cccp)
[https://github.com/brucekaushik/cccp-python-poc](https://github.com/brucekaushik/cccp-python-poc)
查看原文
I have been tinkering with an idea I call CCCP — Context-Aware Composable Compression Protocol.<p>Most compression formats treat the process as a black box: you feed bytes in, you get bytes out.
I wanted something programmable and composable, where the format itself can be adapted to different domains — and even customized by different vendors.<p>So far, CCCP has a few interesting properties:<p>Composable: Multiple LUTs (look-up tables) and encoding phases can be combined.<p>Context-aware: Decoding is guided by explicit metadata, not just raw byte streams.<p>Round-trippable IR: The intermediate representation can reconstruct the original logic before final binary compression.<p>Programmable: Vendors can plug in their own LUTs, encoders, and decoders.<p>It is still very early and experimental. Would love to hear if anyone has seen similar approaches, or where this might break down in real-world usage.<p>Repos:<p><a href="https://github.com/brucekaushik/cccp" rel="nofollow">https://github.com/brucekaushik/cccp</a><p><a href="https://github.com/brucekaushik/cccp-python-poc" rel="nofollow">https://github.com/brucekaushik/cccp-python-poc</a>